Page 1 of 2

Uptime warnings

Posted: Wed Nov 13, 2013 10:03 am
by dcordero
I keep getting "uptime state=warning" notifications and then about 20 mins later receive "uptime state=OK" but there was never any reboot/shutdown of the system specified. My guess is that it just normal network latency. Is there any way to tweak uptime thresholds so that it's not so quick to tell me a system is down when it's actually not?

Re: Uptime warnings

Posted: Wed Nov 13, 2013 10:07 am
by slansing
This would typically be done either by tweaking your check thresholds "warning / critical" or by bumping out your max_check_attempts directive for your hosts/services:
max_check_attempts: This directive is used to define the number of times that Nagios will retry the service check command if it returns any state other than an OK state. Setting this value to 1 will cause Nagios to generate an alert without retrying the service check again.
http://nagios.sourceforge.net/docs/3_0/ ... tions.html

Re: Uptime warnings

Posted: Wed Nov 13, 2013 12:19 pm
by dcordero
This is what the uptime service definition entry looks like:

define service{
use host-service
hostgroup_name network-servers, branch-servers
service_description Uptime
check_command check_nt!UPTIME
servicegroups uptime-services
}

Currently there are no numbers or thresholds specified for anything in this entry. From that link, it says the ones in red are required but a few of those aren't in the entry. How is it even working in the first place? Just an FYI I'm inheriting this system from a previous administrator that left without giving much training.

Re: Uptime warnings

Posted: Wed Nov 13, 2013 12:27 pm
by slansing
What do you have defined in the "host-service" service template?

Re: Uptime warnings

Posted: Wed Nov 13, 2013 12:37 pm
by dcordero
Where exactly would that be? Because I'm not seeing any template definition for a "host-service" in the Windows.cfg file.

Re: Uptime warnings

Posted: Wed Nov 13, 2013 5:40 pm
by tmcdonald
Assuming a CentOS/RHEL distribution:

Code: Select all

grep -r -C 10 "host-service" /usr/local/nagios/etc/

Re: Uptime warnings

Posted: Thu Nov 14, 2013 11:47 am
by dcordero
All results are coming from the windows.cfg file but nothing to do with "host-service". Could there just not be any entry for it? And by the way I'm running Ubuntu.

Re: Uptime warnings

Posted: Thu Nov 14, 2013 4:15 pm
by slansing
You will have to define a host for your service, like so:

http://nagios.sourceforge.net/docs/3_0/ ... ml#service

Do you have a host for this windows service set up?

Re: Uptime warnings

Posted: Thu Nov 14, 2013 4:50 pm
by dcordero
When you say host, do you mean a computer that I want to use this uptime monitor on? If so, then yes I have many hosts for this.

Re: Uptime warnings

Posted: Fri Nov 15, 2013 11:56 am
by lmiltchev
I believe slansing wanted to point our that nagios needs to know which host this service belongs to. You will have to have a service definition like this one:
define service{
host_name <put the name of the host here>
use host-service
hostgroup_name network-servers, branch-servers
service_description Uptime
check_command check_nt!UPTIME
servicegroups uptime-services
}
See again this link (entries in red a mandatory):

http://nagios.sourceforge.net/docs/3_0/ ... ml#service