contacts.cfg is not working properly

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.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

yes in same file contacts_nagios2.cfg
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

Is the file properly defined in nagios.cfg?

Code: Select all

grep contacts_nagios2.cfg /usr/local/nagios/etc/nagios.cfg
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

i didnt specify each file in nagios.cfg.
i put all the servers config in a folder and specified that folder.

For example

Code: Select all

# Debian uses by default a configuration directory where nagios3-common,
# other packages and the local admin can dump or link configuration
# files into.
cfg_dir=/usr/local/nagios/etc/conf.d
conf.d folder has all the server config files in separate folders and also contacts folder.

ubuntu@nagios-2015:/usr/local/nagios/etc/conf.d$ ls
admin-resourses dc-servers generic-host_nagios2.cfg ips rds service_groups.cfg timeperiods_nagios2.cfg webservers-stage
cacheservers elb generic-service_nagios2.cfg localhost_nagios2.cfg riak services.cfg weblinux-servers
contacts extinfo_nagios2.cfg hostgroups_nagios2.cfg pnp4nagios.cfg schedulers services_nagios2.cfg webservers
ubuntu@nagios-2015:/usr/local/nagios/etc/conf.d$
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

All right, just wanted to eliminate that one from the pool. What version of core are you using? I believe in older versions you had to specify

Code: Select all

        host_notifications_enabled	     1
	service_notifications_enabled	1
in the contact definition.

https://assets.nagios.com/downloads/nag ... ml#contact
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

Nagios® Core™ 4.0.8
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

Could you post one of the service definitions that is failing to send out an alert?
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

Free disks space, Check_HTTP critical checks.
They are showing up as critical in [email protected].
But not in [email protected]
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

Can you post the actual service definition from the configuration file?

Such as:

Code: Select all

define service{
	host_name		linux-server
	service_description	check-disk-sda1
	check_command		check-disk!/dev/sda1
	max_check_attempts	5
	check_interval	5
	retry_interval	3
	check_period		24x7
	notification_interval	30
	notification_period	24x7
	notification_options	w,c,r
	contact_groups		linux-admins
	}
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

Code: Select all

define service{
        use                             generic-service,srv-pnp
        hostgroup_name                  weblinux-servers
        service_description             Free disks space
        contact_groups                  admins
        check_command                   check_nrpe_args!check_all_disks!20%!10%
        _graphiteprefix                 ua-east-1a.weblinux
        _graphitepostfix                disk
        }
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

What is the output of a grep -Pzo "(?s)^define\s*?(contact|contactgroup)\s*.*?}" /usr/local/nagios/var/objects.cache command?
Former Nagios Employee.
me.
Locked