3 Replies Latest reply on Feb 24, 2014 6:59 PM by Joe Piotrowski

    How do I create a BL Job to search for specific files within a directory?

      Hi,

       

      I need to create a BL job to identify which servers are running a local service by searching for a specific log directory within all our Unix servers in our environment. I'm new to this community and to BMC for that matter but need to figure this out, any help from you gurus would be greatly appreciated. Thanks!

        • 1. Re: How do I create a BL Job to search for specific files within a directory?
          Joe Piotrowski

          A Compliance Job is perfect for this. Is there a reason you need to look for a log directory rather than a list of running services? Normally you would create a rule that looks to see if a service contain a certain string is running or not.

           

          If you can be a lot more specific about what it is you're looking to do, we can be more specific on how to do it within BladeLogic.

          • 2. Re: How do I create a BL Job to search for specific files within a directory?

            Thanks Joe. Basically we have many unix servers within our environment however not all are running local web services. This local HTTP web service is what I'm trying to identify. Generate a list of any server that us running this HTTP instance. The first thing that came to mind was perhaps write some batch script that checks and returns a value of success or failure and then have BladeLogic audit that output file somehow. The web service writes logs under /usr/XX/access.log for example. Does this make sense? Perhaps that is not the best way of accomplishing this any recommendations or best practices that can get this job done would be appreciated. Can you expand a little more on a compliance job perhaps I don't need to reinvent the wheel.........thanks!

            • 3. Re: How do I create a BL Job to search for specific files within a directory?
              Joe Piotrowski

              So here's an example that might help. In BSA we break down servers into server objects. In compliance we call them parts. A service, for example, is a part. Once we have the parts we want, we can do conditional programming against those parts.

               

              For example, this was me coming up with different logical ways to check and see if our agent daemon (rscd) was running on a Linux server. This is the list of my server parts. The rules are listed below them.

              example1.jpg

              If I open my rule called Process, you can see the different types of logic I was testing with to look for that running process.

              example2.jpg

              Lastly, you can review the analysis job and see the results. If you select the rule you can see the left and right hand values the check was looking for and what the server was reporting. And whether or not it passed/failed the check.

              example3.jpg

              This is how I would recommend you check for a running service. You can also check for a configuration file in a similar way, does this file exist or not. Or, does an entry in this file equal this value.

               

              You can also create remediation packages that can be deployed against servers that fail your rule.