Contact is not defined anywhere
Posted: Fri Jan 03, 2020 12:00 pm
Hello!
I just got Nagios on a vm and I am playing around with it. I am trying to create a custom contact, but for some reason I keep getting the error:
I have tried inserting the contact into contacts.cfg, but I receive the same error when restarting Nagios. I've tried inserting the contact directly above the host object (in the host objects .cfg file) as well, receiving the same error. If I insert the contact into contacts.cfg and test.cfg, I receive an error that there is a duplicate contact, so Nagios knows it exists.
test.cfg:
Thank you!
I just got Nagios on a vm and I am playing around with it. I am trying to create a custom contact, but for some reason I keep getting the error:
Code: Select all
Jan 03 10:52:56 nagios nagios[4075]: Error: Contact 'test_contact' is not defined anywhere!
Jan 03 10:52:56 nagios nagios[4075]: Error: Could not add contact 'test_contact' to host (config file '/usr/local/nagios/etc/servers/test.cfg', starting on line 12)
Jan 03 10:52:56 nagios nagios[4075]: Error processing object config files!
test.cfg:
Code: Select all
define contact{
name test_contact
email [email protected]
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
}
define host{
host_name test
address 192.168.252.148
check_interval 1
retry_interval 1
max_check_attempts 1
check_command check-host-alive
contacts test_contact
notification_interval 60
notification_period 24x7
}