DanW Posted May 21, 2008 Posted May 21, 2008 Checking my config file and i'm getting the following two errors... Error: Service notification command 'notify-by-email' specified for contact 'nagios' is not defined anywhere! Error: Host notification command 'host-notify-by-email' specified for contact 'nagios' is not defined anywhere! where do i specify these options as i can't see anything in the documentation..... Dan
rush_tech Posted May 21, 2008 Posted May 21, 2008 Checking my config file and i'm getting the following two errors... Error: Service notification command 'notify-by-email' specified for contact 'nagios' is not defined anywhere! Error: Host notification command 'host-notify-by-email' specified for contact 'nagios' is not defined anywhere! where do i specify these options as i can't see anything in the documentation..... Dan Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts. nano /usr/local/nagios/etc/objects/contacts.cfg
Geoff Posted May 21, 2008 Posted May 21, 2008 I have the following in my commands.cfg # 'host-notify-by-email' command definition define command{ command_name host-notify-by-email command_line /usr/bin/printf "%b" "***** Nagios 2.6 *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$ } # 'notify-by-email' command definition define command{ command_name notify-by-email command_line /usr/bin/printf "%b" "***** Nagios 2.6 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "* *$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ } They appear to be installation defaults.
DanW Posted May 21, 2008 Author Posted May 21, 2008 Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts. nano /usr/local/nagios/etc/objects/contacts.cfg I already did that I have the following in my commands.cfg # 'host-notify-by-email' command definition define command{ command_name host-notify-by-email command_line /usr/bin/printf "%b" "***** Nagios 2.6 *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$ } # 'notify-by-email' command definition define command{ command_name notify-by-email command_line /usr/bin/printf "%b" "***** Nagios 2.6 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "* *$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ } They appear to be installation defaults. Geoff - yours command.cfg seems to give me errors ... Nagios 3.0.1 Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org) Last Modified: 04-01-2008 License: GPL Reading configuration data... Error: Invalid command object directive 'Address:'. Error: Could not add object property in file '/usr/local/nagios/etc/objects/commands.cfg' on line 38. ***> One or more problems was encountered while processing the config files... Check your configuration file(s) to ensure that they contain valid directives and data defintions. If you are upgrading from a previous version of Nagios, you should be aware that some variables/definitions may have been removed or modified in this version. Make sure to read the HTML documentation regarding the config files, as well as the 'Whats New' section to find out what has changed.
Geoff Posted May 21, 2008 Posted May 21, 2008 I'm using nagios 2.6. You are using nagios 3.01. I suspect the command definitions differ.
DanW Posted May 21, 2008 Author Posted May 21, 2008 Think i've solved the problem .... was a classic case of PEBKAC ....
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now