Welcome, Register for free! or Login below:
EduGeek.net RSS Feeds Register FAQ Members Social Groups User Map Calendar Search Today's Posts Mark Forums Read

*nix

*nix forum sponsored by
*nix Forum Sponsored by Navaho

Powering the backend of many of our networks, unbeknown to many. Linux, Solaris, Unix...

Go Back   EduGeek.net Forums > Technical > *nix
Reply
 
LinkBack Thread Tools Search Thread
Sponsored Links
Old 21-05-2008, 01:32 PM   #1
 
DanW's Avatar
 
Join Date: Oct 2007
Posts: 186
uk uk yorkshire
Thanks: 25
Thanked 7 Times in 7 Posts
Rep Power: 7 DanW will become famous soon enough
Default Quick Nagios Problem

Checking my config file and i'm getting the following two errors...


Code:
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
  Reply With Quote
Old 21-05-2008, 01:41 PM   #2
 
rush_tech's Avatar
 
Join Date: Jul 2006
Location: Nottingham
Posts: 881
uk uk england
Thanks: 63
Thanked 162 Times in 112 Posts
Rep Power: 40 rush_tech is a splendid one to behold rush_tech is a splendid one to behold rush_tech is a splendid one to behold rush_tech is a splendid one to behold rush_tech is a splendid one to behold rush_tech is a splendid one to behold rush_tech is a splendid one to behold rush_tech is a splendid one to behold
Default

Quote:
Originally Posted by DanW View Post
Checking my config file and i'm getting the following two errors...


Code:
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
  Reply With Quote
Old 21-05-2008, 01:45 PM   #3
 
Geoff's Avatar
 
Join Date: Jun 2005
Location: Fylde, Lancs, UK.
Posts: 10,753
uk uk lancashire
Thanks: 93
Thanked 381 Times in 327 Posts
Blog Entries: 1
Rep Power: 98 Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute
Send a message via ICQ to Geoff Send a message via AIM to Geoff Send a message via MSN to Geoff Send a message via Yahoo to Geoff Send a message via Skype™ to Geoff
Default

I have the following in my commands.cfg

Code:
# '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.
  Reply With Quote
Old 21-05-2008, 01:56 PM   #4
 
DanW's Avatar
 
Join Date: Oct 2007
Posts: 186
uk uk yorkshire
Thanks: 25
Thanked 7 Times in 7 Posts
Rep Power: 7 DanW will become famous soon enough
Default

Quote:
Originally Posted by rush_tech View Post
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


Quote:
Originally Posted by Geoff View Post
I have the following in my commands.cfg

Code:
# '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 ...

Code:
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.
  Reply With Quote
Old 21-05-2008, 02:32 PM   #5
 
Ric_'s Avatar
 
Join Date: Jun 2005
Location: Lancashire
Posts: 7,193
uk uk lancashire
Thanks: 78
Thanked 535 Times in 410 Posts
Rep Power: 125 Ric_ ooh
Ric_ ooh
Send a message via MSN to Ric_ Send a message via Skype™ to Ric_
Default

What is on line 38 of that file?
  Reply With Quote
Old 21-05-2008, 03:08 PM   #6
 
Geoff's Avatar
 
Join Date: Jun 2005
Location: Fylde, Lancs, UK.
Posts: 10,753
uk uk lancashire
Thanks: 93
Thanked 381 Times in 327 Posts
Blog Entries: 1
Rep Power: 98 Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute Geoff has a reputation beyond repute
Send a message via ICQ to Geoff Send a message via AIM to Geoff Send a message via MSN to Geoff Send a message via Yahoo to Geoff Send a message via Skype™ to Geoff
Default

I'm using nagios 2.6. You are using nagios 3.01. I suspect the command definitions differ.
  Reply With Quote
Old 21-05-2008, 04:56 PM   #7
 
DanW's Avatar
 
Join Date: Oct 2007
Posts: 186
uk uk yorkshire
Thanks: 25
Thanked 7 Times in 7 Posts
Rep Power: 7 DanW will become famous soon enough
Default

Think i've solved the problem .... was a classic case of PEBKAC ....
  Reply With Quote
Reply

EduGeek.net Forums > Technical > *nix

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Nagios... what do you want to know? Ric_ *nix 51 10-11-2009 06:23 AM
Nagios Problems DanW *nix 5 07-05-2008 01:56 PM
nagios error dezt *nix 13 13-03-2008 03:02 PM
Nagios - MRTG rush_tech *nix 2 05-03-2008 04:54 PM
Nagios Problem sqdge *nix 10 25-04-2007 09:11 PM



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search Thread
Search Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:53 AM.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Copyright EduGeek.net




website uptime

© 2005 - 2010 EduGeek.net
SERVER: 4
no new posts