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
}