Service check in server level pre and post Patching

Hi Team,

Able to check the services like (sql, application service) of any servers OS windows and Linux using any script in Bigfix console.

If yes, Could you help me on it.

Thank you.

You generally don't need a script just to perform this type of check. BigFix Relevance can usually handle it directly.

For Windows, if you want to check whether a service exists and return its current state, you can use something like:

if exists service "XYZ" then state of service "XYZ" as string else "Not Installed"

For Linux/UNIX, if checking for the running process is sufficient for your requirement, you could use:

if exists process "XYZ" then "Running" else "Stopped"

Just keep in mind that checking for a process is not exactly the same as checking the state of a service. Depending on the application and platform, you may need a more specific check.

You could also create a single cross-platform property, for example:

if windows of operating system then (if exists service "XYZ" then state of service "XYZ" as string else "Not Installed") else (if exists process "XYZ" then "Running" else "Stopped")

You can also take examples from existing BigFix properties that report service/process status, such as those related to BESClient, BESRelay, etc.

Note: On Linux/UNIX, applications may be running as services/daemons, but how you identify them through Relevance can depend on the OS and application. In practice, I have mostly seen process-based checks used on Linux/UNIX, while service-based checks are very common on Windows.

So I would first investigate how the particular application/service is represented on the target OS and then write the Relevance accordingly. You can test the required inspectors directly using Fixlet Debugger/QnA on a representative endpoint before creating the Analysis property.

2 Likes