How is uptime calculated for each OS?

I am using “uptime of operating system” to show system uptime. How is that calculated for each OS?

On Windows windows the agents checks how long it’s been since the first process started on the OS instance.
On Linux/Nix/Mac the agent reads value from /proc/uptime.

2 Likes

hi Can you tell me how you’re getting the uptime of computer via relevance

here you go - uptime in Days

if (uptime of operating system < 0*second) then ERROR "0" else ((uptime of operating system) / day) of ((now - boot time of operating system) / day)

@ vk.khurava,

I would like to use this relevance in the API like this,

https://bigfixservername:52311/api/query?relevance=(relevance to get the up time)

can you guide me how to attach the computer name with the relevance you mentioned

Yes, you can do that but what I am understanding you dont have Uptime Retrieved property created, use above relevance & create one 1st after that try using below query in your API relevance.

@vk.khurava,
In Production , I’ve seen one property for uptime and I tried it in API. It worked and gave the uptime in days, like this.
This is the screenshot for successful query

In dev env, I’ve created custom system property , I’m able to see the uptime in minutes for the servers in the console, but when I query the property in API again it is returning the same error given below.

1 Like

hufff you made it finally !!! :slight_smile:

1 Like

yes with the help of you guys, but not sure why in dev env, it is not giving the output even when the output is properly coming in console