Uptime warnings

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
dcordero
Posts: 9
Joined: Wed Nov 13, 2013 9:12 am

Uptime warnings

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Uptime warnings

Post 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
dcordero
Posts: 9
Joined: Wed Nov 13, 2013 9:12 am

Re: Uptime warnings

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Uptime warnings

Post by slansing »

What do you have defined in the "host-service" service template?
dcordero
Posts: 9
Joined: Wed Nov 13, 2013 9:12 am

Re: Uptime warnings

Post by dcordero »

Where exactly would that be? Because I'm not seeing any template definition for a "host-service" in the Windows.cfg file.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Uptime warnings

Post by tmcdonald »

Assuming a CentOS/RHEL distribution:

Code: Select all

grep -r -C 10 "host-service" /usr/local/nagios/etc/
Former Nagios employee
dcordero
Posts: 9
Joined: Wed Nov 13, 2013 9:12 am

Re: Uptime warnings

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Uptime warnings

Post 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?
dcordero
Posts: 9
Joined: Wed Nov 13, 2013 9:12 am

Re: Uptime warnings

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Uptime warnings

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked