Page 1 of 1

check_uptime giving wrong time on output

Posted: Mon Sep 02, 2019 9:41 am
by danniiffxi
Hi Forum

I have implemented a check where if a server fails to reboot during our monthly patching cycle Nagios will notify us. But I have come across a problem where the time displayed by Nagios is not the same as what is displaying on the host.

For example.

Code: Select all

[root@nagios libexec]# ./check_nrpe -H SQLNMNP01 -c check_uptime
OK: uptime: 8w 56d 1195:71636h, boot: 2019-Jul-02 04:38:12 (UTC)|'uptime'=5392100s;172800;86400
Yet on the server it is displaying the uptime as 62 days.. Now 62 days is 8.85714 weeks but where on earth is Nagios getting the '56d 1195:71636h' part from? I am assuming that Nagios is telling me that the server has been up for 8w, or 56d or 1195hours, because 8w and 56d makes no sense. Even though, 1195 hours is 49 days not 56.

Current setup:
Nagios XI 5.6.6
Nagios Core 4.2.4 running Gearman
NRPE Plugin 3.2.1

If you need anymore info please let me know.

Re: check_uptime giving wrong time on output

Posted: Tue Sep 03, 2019 8:39 am
by scottwilkerson
Can you show the the nrpe.cfg command for check_uptime on the remote machine? This output is different from the format of the /usr/local/nagios/libexec/check_uptime script delivered with Nagios which looks like the following

Code: Select all

# /usr/local/nagios/libexec/check_uptime
Uptime OK: 96 day(s) 22 hour(s) 5 minute(s) | uptime=139565.000000;;;

Re: check_uptime giving wrong time on output

Posted: Wed Sep 04, 2019 9:59 am
by danniiffxi
Hi Scott

Feel free to lock this thread. We are using NSClient++ 0.4.3 and after a bit of digging it looks as though the mate is broken in that version.

https://forums.nsclient.org/t/nsclient- ... esult/3959

I upgraded that one machine to NSClient++ 0.5.2 and it reports correctly. Now I only have 1342 servers left to update FML!

Re: check_uptime giving wrong time on output

Posted: Wed Sep 04, 2019 10:16 am
by scottwilkerson
danniiffxi wrote:Hi Scott

Feel free to lock this thread. We are using NSClient++ 0.4.3 and after a bit of digging it looks as though the mate is broken in that version.

https://forums.nsclient.org/t/nsclient- ... esult/3959

I upgraded that one machine to NSClient++ 0.5.2 and it reports correctly. Now I only have 1342 servers left to update FML!
:o
At least we know the cause.

Locking