Fixlet for Linux to scan specific version of application and product report

(imported topic written by jkinning)

I am trying to figure out how to go about creating a fixlet which will tell me what version of Samba is installed and produce this information into the reporting console of TEM.

I am using Centrify on several SUSE Linux servers along with Centrify Samba. I have SUSE stock Samba installed on a few server so I would like to leverage TEM to provide me with a report so I can see what machines are using stock Samba or have stock Samba installed and which ones are using Centrify Samba. The overall goal is to have all servers running Centrify Samba.

I am just starting out with TEM so any information would be helpful regarding the best solution for my problem.

(imported comment written by NoahSalzman)

How would you identify the Samba version if you were sitting at the Linux box?

It’s probably going to be one of these three, right?

smbd -V

smbstatus -V

smbclient -V

So, let’s pick the last one. In TEM you would create a task that had this “sh”-type action:

smbclient -V > /tmp/smb_version

Then create a separate Fixlet – an Analysis – that has the Relevance:

concatenation of lines of file "/tmp/smb_version"

There are fancier ways to parse the smb_version file. For instance, if the output looks like “Version: 3.5.0” you could do this:

(following text of first ": " of line whose (it contains "Version") of file "/tmp/smb_version") as trimmed string

(imported comment written by MarkA.Stevens)

If I were looking for the version of a package, I would ask RPM, first if it was installed and then package information. This way I can do it all in relevance without resorting to action scripts. I tend to avoid them for historical and other reasons. Personal bias.

Q: installed “samba” of rpm

A: True

T: 69582

I: boolean

Q: package “samba” of rpm

A: samba-3.5.4-4.1

T: 331

I: package

Q: (matches (regex "

(

-+)-(.*)$") of (package “samba” of rpm as string))

A: samba-3.5.4-4.1

T: 776

I: regular expression match

Q: (parenthesized part 2 of it is greater than “3.4”) of (matches (regex "

(

-+)-(.*)$") of (package “samba” of rpm as string))

A: True

T: 443

I: boolean

Both Noah and my answers presume something, mine installation via RPM, Noah’s the path to the samba commands is known/stable.

I Hope This Helps …Mark A. Stevens

(imported comment written by NoahSalzman)

That’s a much better solution. Thanks Mark.