check_uptime giving wrong time on output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
danniiffxi
Posts: 121
Joined: Tue Jan 30, 2018 3:29 am
Location: UK

check_uptime giving wrong time on output

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_uptime giving wrong time on output

Post 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;;;
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
danniiffxi
Posts: 121
Joined: Tue Jan 30, 2018 3:29 am
Location: UK

Re: check_uptime giving wrong time on output

Post 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!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_uptime giving wrong time on output

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked