Analyses for a Service Not present

(imported topic written by yakyak)

Recently we deployed Power Broker an want to do an Analyses against servers where the Service is not present. I’ve looked all through BF but can’t find this analyses for Solaris / Unix. Any help creating an Alalyses would be much appreciated. the Service for Power Broker is named lwsmd and is in the directory /opt/pbis/sbin/

(imported comment written by jgstew)

Could you just look if the file exists? or also check if the process is running?

(imported comment written by yakyak)

Sorry for the delay in response.

I was able to run the following Analyses

exists process whose (name of it as string as lowercase = “lwsmd”)

Now I have an issue where we have several hosts that have more then 15 characters in the hostname. These hosts cannot join AD but have the software installed and are reporting to my analyses for lwsmd as “True”

Now I’m trying to write an analyses that would report back “False” if there was no response to the following command in the Domain= field. If the host has successfully joined AD the Domain= field will display the domain ourdomain.this.gov

root@d0-hostname15+# /opt/pbis/bin/domainjoin-cli query

Name = hostname15+

Domain =

(imported comment written by JasonWalker)

You can approach this a couple of different ways. The simplest check might be to use BigFix itself to check the hostname length - you could use this in a Fixlet relevance or Analysis property -

length of hostname > 15

Otherwise, you could create a Task to execute the domainjoin-cli command, save the output to a file, and then parse the results of the file in an Analysis. Forgive me if this needs some tweaking, I don’t have a Linux host in front of me right now -

// Relevance:
(it contains "solaris" or it contains "unix") of name of operating system as lowercase
AND
exists file "/opt/pbis/bin/domainjoin-cli"

//ActionScript

delete __createfile
createfile until <eof>
#!/bin/sh
/opt/pbis/bin/domainjoin-cli query > /{data folder of client}/domainjoin-cli-query.out
<eof>

delete domainjoin-query.sh
waithidden chmod +x domainjoin-query.sh
waithidden /bin/sh domainjoin-query.sh

Then, you could have an Analysis parse the output file -

// Relevance:

(it contains "solaris" or it contains "unix") of name of operating system as lowercase
AND
exists file "domainjoin-cli-query.out" of data folder of client

// Parse Results - maybe you want this in a Fixlet Relevance, or as an Analysis Result

exists (lines of file "domainjoin-cli-query.out" of data folder of client) whose (it contains "Domain" AND it as trimmed string = "Domain =")