Installed RPM in Suse Linux relevance error

I am trying to find out RPM installed on SuSE servers 11 version by using below relevance, but i dont see any output it is giving as “N/A”.
relevance :
if (exists file “/etc/SuSE-release” whose (exists line whose (it as string as lowercase contains “suse linux enterprise server 11 (x86_64)”) of it AND exists line whose (it as string as lowercase contains “patchlevel = 3”) of it)) then ((unique values of (name of it & “-” & version of it as string & “.” & architecture of it) of packages of rpm) as string) else (“N/A”)

servers OS and Architecture:
Linux SuSE Enterprise Server 11 (3.0.101-108.21-bigmem)

Greetings.

There are no issues with the relevance as it is returning the ‘else’ and not an error. I would double check the lines of “/etc/SuSE-release” and that it does in fact contain “patchlevel = 3”.

-Matt

Thanks Matt

I will have check on that, as i am sure we have some RPM’s installed on these devices and still. it goes to else statement.

output of this might help “/etc/SuSE-release”"

In more recent versions of the client you would see Linux SuSE Enterprise Server 11.3 as the version so you wouldn’t need to go through the SuSE-release file

1 Like

Thanks Alan and Matt

Below relevance worked:
if (exists file ((if (version of client >= “9” as version) then (pathname of parent folder of data folder of client) else (pathname of parent folder of parent folder of client folder of site “actionsite”)) & “/LMT/CIT” & “/sua_package_data”)) then (lines of file ((if (version of client >= “9” as version) then (pathname of parent folder of data folder of client) else (pathname of parent folder of parent folder of client folder of site “actionsite”)) & “/LMT/CIT” & “/sua_package_data”)) else (if (name of operating system as lowercase starts with “hp-ux”) then (((html tag “HPUXPackage” of ( (html tag “Name” of (unique values of tag of it)) & (html tag “Version” of (unique values of revision of it)) & (html tag “Vendor” of (unique values of (if (exists (vendor of it)) then (vendor of it) else ("")))) & (html tag “Description” of (unique values of (if (exists (title of it)) then (title of it) else ("")))) ) ) of products of software depot)as string) else if (((name of it as lowercase starts with “sunos 5”) AND NOT (name of it as lowercase contains “sunos 5.7”) ) of operating system) then (((html tag “SunPackage” of ( (html tag “Name” of (unique values of params “PKGINST” of it)) & (html tag “Version” of (unique values of params “VERSION” of it)) & (html tag “Vendor” of (unique values of (if (exists (params “VENDOR” of it)) then (params “VENDOR” of it) else ("")))) & (html tag “Description” of (unique values of (if (exists (params “DESC” of it)) then (params “DESC” of it) else ("")))) ) )of pkginfos of pkgdb)as string) else if (name of operating system as lowercase starts with “mac”) then(((html tag “CustomPackage” of ( (html tag “PackageType” of (“MacPackage”)) & (html tag “Name” of (name of it)) & (html tag “Version” of (if (exists version of it) then (version of it as string) else(""))) & (html tag “Vendor” of ("")) & (html tag “Description” of ("")) ) ) of applications)as string) else if (name of operating system as lowercase starts with “linux”) then if (exists folder (((pathname of parent folder of parent folder of client folder of site “actionsite”) & “/LMT/RPM”)) whose (exists file “rpms.xml” of it)) then (lines of file “rpms.xml” of folder ((pathname of parent folder of parent folder of client folder of site “actionsite”) & “/LMT/RPM”)) else “” else if (name of operating system as lowercase starts with “aix”) then (substrings separated by “<—|!@##@!||___>” of (concatenation “<—|!@##@!||___>” of (((html tag “AIXPackage” of ( (html tag “Name” of (lpp_name of it)) & (html tag “Version” of (version of it as string)) & (html tag “Vendor” of ("(none)")) & (html tag “Description” of (description of it)) )) of filesets of products of object repository) as string) & ( if (exists folder (((pathname of parent folder of parent folder of client folder of site “actionsite”) & “/LMT/RPM”)) whose (exists file “rpms.xml” of it)) then (concatenation “<—|!@##@!||___>” of (lines of file “rpms.xml” of folder ((pathname of parent folder of parent folder of client folder of site “actionsite”) & “/LMT/RPM”))as string) else “”))) else “”)

The only added comment I have is you don’t need the “as version” on the end. Comparing a version against a string has an implicit conversion