check_uptime with check_nrpe_v2

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
User avatar
JohnFLi
Posts: 517
Joined: Mon Jun 17, 2013 3:11 pm

check_uptime with check_nrpe_v2

Post by JohnFLi »

I am having some brain issues today, so I am hoping somebody might be able to point me in the right direction.

I am needing a check that will let me know if a server (windows) has not restarted in under 30 days.
check_uptime.jpg
if i just run the check as is, it returns
OK: uptime: 1w 2d 10:5h, boot: 2023-10-04 09:34:55 (UTC)|'uptime'=813920s;172800;86400

any thoughts on what I need to do to accomplish my goal?
You do not have the required permissions to view the files attached to this post.
Everybody is somebody else’s weirdo
cbyers
Posts: 11
Joined: Mon Sep 19, 2022 12:53 pm

Re: check_uptime with check_nrpe_v2

Post by cbyers »

Good afternoon JohnFLi,

Are you are using NSClient++ on your windows server ? If so you can find NSClient's documentation via the link below:
https://nsclient.org/docs/
Unfortunately NSClient++ isn't our product and as a result we can't provide any official support or guidance for it. Have you tried using NCPA ?
If you are willing to try NCPA here is a link regarding information about it:
https://www.nagios.org/ncpa/
Cody Byers
User avatar
JohnFLi
Posts: 517
Joined: Mon Jun 17, 2013 3:11 pm

Re: check_uptime with check_nrpe_v2

Post by JohnFLi »

I have nsClient++ and NCPA installed (in process of migrating to ncpa)

if you know how to have ncpa check for uptime, please let me know.
Everybody is somebody else’s weirdo
cbyers
Posts: 11
Joined: Mon Sep 19, 2022 12:53 pm

Re: check_uptime with check_nrpe_v2

Post by cbyers »

Good morning JohnFLi,

I created a new check command in the core config manager. This is the command I created:
$USER1$/check_ncpa.py -H $HOSTADDRESS$ -t $_HOSTTOKEN$ -M $ARG1$ $ARG2$
From there I created a service using the check command I just created
$ARG1$: 'system/uptime'
$ARG2$: -c 2592000 -w 2419200
The warning is at the 28th day, while the critical is at the 30th day. You can change those (time in seconds) as you see fit for your alerting desires.
I then created a free variable in the host I wanted to monitor called _token and gave it the value of the NCPA token for that machine. If you only use one token for everything or only have one machine you can just put in your token instead of $_HOSTTOKEN$

If you have anymore questions please feel free to reach out
Cody Byers
User avatar
JohnFLi
Posts: 517
Joined: Mon Jun 17, 2013 3:11 pm

Re: check_uptime with check_nrpe_v2

Post by JohnFLi »

Sorry for the delay...

Thank you for your assistance on this.
Everybody is somebody else’s weirdo
Post Reply