Analysis not pulling the information

Hi Gang, I have made a fixlet which will run uptime command on unix servers (AIX, HP-UX, Red-Hat and Suse) which will awk the output to bring only the number of uptime days to a file /var/opt/numberofdays. I am pulling the number of days via analysis using the following relevance:-1:
if (name of operating system contains “HP-UX”) then (lines of files “/var/opt/numberofdays”) else “Not Found”

It brings the required data for HP-UX and AIX but it is not working for Suse and RedHat, have tried multiple ways like below:-1:

if (name of operating system contains “redhat”) then (lines of files “/var/opt/numberofdays”) else "Not Found"
if (name of operating system contains “RHEL”) then (lines of files “/var/opt/numberofdays”) else "Not Found"
if (name of operating system contains “red”) then (lines of files “/var/opt/numberofdays”) else “Not Found”

lines of files “/var/opt/numberofdays” else “Not Found”

and not the least

lines of files "/var/opt/numberofdays"
but still the analysis output shows “Not Found”. I also changed the path of script to produce the file in /tmp/numberofdays, I can see the file shows the output with number of days but don’t why analysis not reading it. Please suggest.

My action script code:-1:

#!/bin/bash
rm -f /var/opt/numberofdays
abc=$(uptime | sed -e ‘s/^.up //’ -e 's/[^0-9:].//’ | sed ‘s/:/*60+/g’)
echo $abc “days” > /var/opt/numberofdays

While this doesn’t answer your question regarding the analysis, is there any reason to take this approach vs. leveraging the uptime of <operating system> relevance inspector (which should be easier and more efficient)?

If you want it to only return the number of days (rather than a more precise time interval), you might try something like:

(uptime of operating system) / (1 * day)

Regarding the analysis, on machines where it is not returning the expected results, what do you see if running the relevance in question interactively via QnA or Query?

I agree with @Aram about using the uptime of operating system property. You should know that I THINK that property actually returns how long the BES Client has been running. If you restart the BES Client it seems to reset the value.

What happens if you replace your lines of files "/var/opt/numberofdays" else “Not Found”

with

If Exists (File "/var/opt/numberofdays") THEN (Number of Lines of file "/var/opt/numberofdays") ELSE ("No File")