Page 1 of 1

Uptime check not showing properly

Posted: Wed Oct 31, 2018 8:25 am
by ganeshsambandam
Uptime check not showing properly. I have tested in one of the server, but the event log shows different. I rebooted the server about 16 minutes, but in uptime service check shows "SNMP OK - Uptime 88634" the seconds calculation looks not correct.

Below is the command, using check_snmp plugin.

-o sysUpTime.0 -C NAGIOS-SNMP -P 2c -l Uptime -c 28800:0

Event log for the uptime alert:-

Type Date / Time Information
Service Recovery 2018-10-31 09:12:17 SERVICE ALERT: whcinxtest04;Uptime;OK;HARD;1;SNMP OK - Uptime 28911
Service Critical 2018-10-31 09:11:18 SERVICE ALERT: whcinxtest04;Uptime;CRITICAL;SOFT;2;SNMP CRITICAL - Uptime *23019*
Service Critical 2018-10-31 09:10:19 SERVICE ALERT: whcinxtest04;Uptime;CRITICAL;SOFT;1;SNMP CRITICAL - Uptime *17132*

Re: Uptime check not showing properly

Posted: Wed Oct 31, 2018 3:29 pm
by lmiltchev
I rebooted the server about 16 minutes, but in uptime service check shows "SNMP OK - Uptime 88634" the seconds calculation looks not correct.
In this output - "SNMP OK - Uptime 88634", the 88634 are not seconds, but timeticks (1/100 second), so this seems correct. This is 886.34 seconds (14.77 min).

Re: Uptime check not showing properly

Posted: Thu Nov 01, 2018 10:56 am
by ganeshsambandam
How do i make it using seconds/Minutes/hours to be more clear to understand ?

Re: Uptime check not showing properly

Posted: Thu Nov 01, 2018 2:23 pm
by ganeshsambandam
Is timeticks (1/100 second) calculation is common for the wizards we use in Nagios XI?

Re: Uptime check not showing properly

Posted: Thu Nov 01, 2018 4:41 pm
by lmiltchev
It's a SNMP thing... If you want to keep using SNMP and uptime, but change the output to seconds, you would need to find (or develop) a custom plugin. You can search Nagios Exchange for a suitable plugin. I am not sure if there is one that does the conversion.

https://exchange.nagios.org/

Another option would be to use NCPA, which provides you with much "user friendly" output.

Example:

Code: Select all

[root@main-nagios-xi libexec]# ./check_ncpa.py -H x.x.x.x -t 'mytoken' -M 'system/uptime'
OK: Uptime was 1 day 1 hour 13 minutes 2 seconds | 'uptime'=90782.00s;;;

Re: Uptime check not showing properly

Posted: Thu Nov 01, 2018 4:48 pm
by ssax
It's just returning a value that the remote SNMP daemon returns.

I found this plugin that should do the calculation:

https://exchange.nagios.org/directory/P ... me/details

Please see here for more information on setting it up:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf