Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 
  service_notification_period   24x7 
  service_notification_options  w,u,c,r 
  host_notification_options d,u,r email             
  can_submit_commands       1

Or maybe my contactgroups.cfg?

define contactgroup
  contactgroup_name localadmins
  alias             Local Site Administrators
  members           nagios

Thanks for the help!

share|improve this question
up vote 2 down vote accepted

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:

service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email

Also, they need to be defined as commands, which by default should be the sample commands.cfg

share|improve this answer

It Appears that you are missing several things.

First, Make sure that when you define a contact that it is defined propery ie..

define contact {                     
    contact_name                    INSERT_NAME_HERE;
    alias                           SOME_ALIAS_HERE;
    email                           EMAIL@EXAMPLE;
    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; send service notifications via email
    host_notification_commands      notify-host-by-email; send host notifications via email                  

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:

define contact {
     contact_name                       INSERT_NAME_HERE;
     use                                generic-contact;
     alias                              SOME_ALLIAS_HERE;
     email                              EMAIL@EXAMPLE;

Then your contact definition will inherit all the default values from the generic template.

Hope this helps.

share|improve this answer

You are missing the options service_notification_commands and host_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 address

My nagios contact looks like this:

define contact {
        contact_name    george
        alias   george
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email <-- Missing
        host_notification_commands      notify-host-by-email    <-- Missing

This tells nagios to send an email to the account specified in the email option. in this case

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.