UPTIME Threshold
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: UPTIME Threshold
Please refer to my first attachment, UPTime Definition.
It is also the same as you suggested.
but Still the same status.
I Hope that below command i need to run from the Nagios Server:
./check_nt -H IP_ADDRESS -p 12489 -s secret-password760 -v UPTIME -l hours -c 5
From which path i should run this command?
It is also the same as you suggested.
but Still the same status.
I Hope that below command i need to run from the Nagios Server:
./check_nt -H IP_ADDRESS -p 12489 -s secret-password760 -v UPTIME -l hours -c 5
From which path i should run this command?
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: UPTIME Threshold
I try to run the command from the nagios Server
But it is not generating any Alert, see the attached screenshot.
But it is not generating any Alert, see the attached screenshot.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: UPTIME Threshold
you had thisamitgupta19 wrote:Please refer to my first attachment, UPTime Definition.
Code: Select all
check_command check_nt!UPTIME -l hours -c 5
Code: Select all
check_command check_nt!UPTIME!-l hours -c 5
Running the command doesn't generate Nagios notifications the rest of the configuration doesamitgupta19 wrote:But it is not generating any Alert, see the attached screenshot.
Here is the documentation on notifications
https://assets.nagios.com/downloads/nag ... tions.html
Nagios XI takes a lot of the complexity our of setting up and configuring notifications with easy to use web UI and configuration wizards, you may want to check that out
https://www.nagios.com/products/nagios-xi/
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: UPTIME Threshold
Thanks for pointing this out:
PFA screenshot from services.cfg, hope this time command should be OK.
But still no Alert generated.
PFA screenshot from services.cfg, hope this time command should be OK.
But still no Alert generated.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: UPTIME Threshold
Did you read the doc I sent?
Your config that you are showing doesn't have a contact specified to alert
Your config that you are showing doesn't have a contact specified to alert
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: UPTIME Threshold
i have defined the
contact_groups admins
Still the status is same.
Atleast it should show the Alert on the Console. I hope that contact_groups is for generating Notifications like Email.
Please correct if i am wrong here.
contact_groups admins
Still the status is same.
Atleast it should show the Alert on the Console. I hope that contact_groups is for generating Notifications like Email.
Please correct if i am wrong here.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: UPTIME Threshold
It should only show critical if the machine has been up less than 30 hours
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: UPTIME Threshold
But it is not showing.
Re: UPTIME Threshold
You will see an alert when you have an exit code of 2 (CRITICAL). Test your check again from the command line to see what is the exit code. Here's an example of exit code of 0 (OK), when I use "20" hours as a critical threshold, and exit code of 2 (CRITICAL), when I use "30" hours as a critical threshold:
In case your service goes to hard critical, you would see something like this in the nagios.log:
If contacts/contactgroups have been added to this service, and it's been configured properly, notifications will be sent as well. Read more about notifications in Nagios Core here:
https://assets.nagios.com/downloads/nag ... tions.html
Code: Select all
[root@main-nagios-xi libexec]# ./check_nt -H x.x.x.x -s password -p 12489 -v UPTIME -l hours -c 20
System Uptime - 1 day(s) 1 hour(s) 30 minute(s) |uptime=25
[root@main-nagios-xi libexec]# echo $?
0
[root@main-nagios-xi libexec]# ./check_nt -H x.x.x.x -s password -p 12489 -v UPTIME -l hours -c 30
System Uptime - 1 day(s) 1 hour(s) 30 minute(s) |uptime=25
[root@main-nagios-xi libexec]# echo $?
2
Code: Select all
[1521136984] SERVICE ALERT: Windows7;Uptime;CRITICAL;HARD;5;System Uptime - 1 day(s) 1 hour(s) 27 minute(s)
https://assets.nagios.com/downloads/nag ... tions.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: UPTIME Threshold
Please find here with the Output of the manual command
It is giving 0 in both the cases.
It is giving 0 in both the cases.