(imported topic written by SarahGalvan)
Is it possible to retrieve the package names/versions of RedHat (or other distribs) packages with Session Relevance?
(imported topic written by SarahGalvan)
Is it possible to retrieve the package names/versions of RedHat (or other distribs) packages with Session Relevance?
(imported comment written by SarahGalvan)
I have tried the following on linux (RH6, Ubuntu 10.x) computers without result:
(names of items 0 of it, values of results(item 0 of it, item 1 of it)) of (bes computers whose (operating system of it as lowercase starts with “linux”), bes properties whose (name of it ends with “Package List”))
(imported comment written by SarahGalvan)
With Lifecycle’s Analysises enabled I have had great luck with getting package names using the following:
( values of (results of it) ) of bes properties whose ( name of it =
"Packages Installed - Linux" )
BUT how do I get the version information for each package?
(imported comment written by Lee Wei)
Hi Sarah,
Session Relevance is reporting on data already collected by the TEM Clients.
“Packages Installed - Linux” is a property of the “Application Information (Linux)” analysis from the “BES Inventory and License” site.
The Client Relevance is the following and it apparently is not retrieving the version information.
if not exists rpm then “” else unique values of names of packages of rpm
So we will have to first create a property using Client Relevance to extract the data, before we can use Session Relevance to report on it.
The Client Relevance can be something like:
if not exists rpm then
"<no rpm database>"
else unique values of (name of it &
"|" & version of it as string) of packages of rpm
After clients report theirs values, you can use the Session Relevance as you had.
( values of (results of it) ) of bes properties whose ( name of it =
"Packages Installed with Version- Linux" )
Lee Wei
(imported comment written by SarahGalvan)
So the property you are describing has to be created manually? There is no analysis precanned to retrieve this information available for any TEM product?
Thank you for the response, by the way. You have no idea how long I have been trying to figure this out.
(imported comment written by Lee Wei)
Sorry to hear that you had been searching a while for an answer!
It is actually quite easy to create a property if have not tried one before.
You can give the property the name I suggested above and paste in the Client Relevance code.
I don’t know of a TEM solution that will make this any easier than to just create it ourselves.
Lee Wei
(imported comment written by SarahGalvan)
I followed your instructions, but appears under its entry in Custom Properties. I have sent refreshes and waited days.
(imported comment written by SarahGalvan)
I assume that this is because the client has not checked-in (the checked-in stamp confirms this). I turned on the machine and am clicking “send refresh” in hopes it will update. I’ll wait a bit and if nothing else works will bug the forum again.
(imported comment written by SarahGalvan)
That particular problem is solved. Is there a way to get them back as more than one value? so I can reference the name by item 0 and the version by item 1?
(imported comment written by Lee Wei)
Here is an example statement that you might be able to use:
( name of computer of it, preceding texts of firsts
"|" of values of it, following texts of firsts
"|" of values of it ) of results from (bes computers whose (operating system of it as lowercase starts with
"linux")) of (bes properties whose (name of it =
"Packages Installed with Version- Linux"))
(imported comment written by SarahGalvan)
This worked fantastically! I need to perform some optimization and only send these queries when I know in advance that the queried computer most likely has an RPM database.
At the time of the query, I have the OS property value (e.g. Linux Red Hat Enterprise Server 6.3 …) available for my consideration. If I could get a list of possible OS values (not from what’s on the network, but some kind of master list if it exists) I could only query if it matches one that I know to be RPM based.
Does a master list of OS property values exist?
(imported comment written by Lee Wei)
We don’t have a master list of all possible OS values.
However, you can generate one for your environment using the following Session Relevance.
unique values of values of results of bes property whose (name of it =
"OS" and reserved flag of it)
For Linux only values:
unique values whose (it as lowercase contains
"linux") of values of results of bes property whose (name of it =
"OS" and reserved flag of it)
Lee Wei
(imported comment written by SarahGalvan)
I appreciate all the help you’ve been providing! You have no idea how useful it has been. I imagine this will be a great resource for other people walking in my shoes.
How would I do the same for apt based distros like Debian (and family)?
(imported comment written by Lee Wei)
Regarding Debian, you can use the Relevance that shows all the operating systems, and look for the ones belonging to Debian.
Then replace “linux” with something unique to Debian.
Lee Wei
(imported comment written by SarahGalvan)
Sorry, I should have been more specific. I meant package retrieval.
(imported comment written by Lee Wei)
The equivalent RPM inspector for Debian is “debianpackage”.
So an example would be:
if not exists debianpackage then
"<no debian package database>"
else unique values of ( name of it &
"|" & (
if (exists version of it) then (version of it as string)
else (
"No version info")) ) of packages of debianpackages
(imported comment written by SarahGalvan)
Thanks for the response! Unfortunately your code (verbatim) doesn’t seem to work on operating systems without Debian packages.
The operator “debianpackage” is not defined.
Is there a way to check for the availability of the operator WITHOUT consulting the OS string?
(imported comment written by Lee Wei)
You are right that the the inspector DebianPackage does not exist on other OSes.
So we should use the operating system string to run only on systems that are Ubu/Debian distros.
(imported comment written by SarahGalvan)
Is there any way to check if an operator exists?
As I said, as a design requirement I need to at all costs avoid using lists that need to be updated/maintained (like OS strings as new ones are encountered or created). Some level is required, of course, but if there is a way to check if an operator exists or some sneaky way to go about it, then that’d be highly preferred.
(imported comment written by Lee Wei)
Sorry that there is no way to check for the existence of an operator that I know of.