Trying to get nagios up and running and been stuck here awhile, not exactly sure what I am doing wrong.. Any help would be great =)
/usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg
Checking contacts...
Error: Contact 'nagios' has no service notification commands defined!
Error: Contact 'nagios' has no host notification commands defined!
So I figure this is an issue with my contacts.cfg?
define contact
contact_name nagios
alias Nagios Admin
host_notification_period24x7
service_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r email
nagios-admin@localhost
can_submit_commands 1
Or maybe my contactgroups.cfg?
define contactgroup
contactgroup_name localadmins
alias Local Site Administrators
members nagios
Thanks for the help!
Did you copy all of the sample cfg files to start from?
You should have these two lines in either your contact or your contactgroup:
Also, they need to be defined as commands, which by default should be the sample commands.cfg
It Appears that you are missing several things.
First, Make sure that when you define a contact that it is defined propery ie..
From your post, it appears that you are missing the { } that define the beginning and end of the contact. It looks like you are also missing exactly what the error message states. In my deployment, I use templates, in fact the generic templates in the templates file are a good starting point. When creating a contact you can reference these generic templates by calling it in your define statement like so:
Then your contact definition will inherit all the default values from the generic template.
Hope this helps.
You are missing the options
service_notification_commands
andhost_notification_commands notify-host-by-email
so nagios doesn't know what to do when it gets an alert.You're also missing the
email
keyword before the email addressMy nagios contact looks like this:
This tells nagios to send an email to the account specified in the
email
option. in this case [email protected]Its a old post, but sharing my input if anyone comes across the issue.
You can add the commands in UI under
CoreConfigManager->Contacts->(Select Contact)->Alert Settings.
Dont forget Apply Config after that. :)