LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-07-2015, 07:47 AM   #1
sazzad
LQ Newbie
 
Registered: Apr 2015
Posts: 2

Rep: Reputation: Disabled
Angry Receiving Error(Service notification command is not defined anywhere!)


root@RR-DE-NMS-1:/home/rr-de-nms-1# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Error: Service notification command 'notify-by-email' specified for contact 'nagiosadmin' is not defined anywhere!
Error: Host notification command 'host-notify-by-email' specified for contact 'nagiosadmin' is not defined anywhere!
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 2

***> One or more problems was encountered while running the pre-flight check...

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.
 
Old 04-07-2015, 08:50 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Your contacts.cfg and/or contactgroups.cfg probably specifies notify-by* commands to use.

The commands should be defined in something like commands.cfg or misccommands.cfg. You can see examples in templates.cfg.

Your nagios.cfg needs to define whichever config files you are using.
 
Old 04-07-2015, 08:56 AM   #3
sazzad
LQ Newbie
 
Registered: Apr 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Question

Thanks for the reply!

I have tried to install NAGIOS again & its ok now.

I am trying to activate email alert from NAGIOS & unfortunately failed to do so each time. I have followed so many blogs & tried. Could you please share a trustworthy site for this? So, that i can follow & have support from you.

Expecting your prompt reply as usual..

Have a nice day!
 
Old 04-07-2015, 09:23 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Examples from my misccommands.cfg:
Code:
# 'notify-by-email' command definition
define command{
        command_name    notify-by-email
        command_line    /usr/bin/printf "%b" "Enterprise Monitoring Assistant\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n\n$NOTIFICATIONCOMMENT$\n\n$NOTIFICATIONAUTHOR$" | /bin/mailx -s "`echo $NOTIFICATIONTYPE$ | sed -e 's/RECOVERY/RCVR: /' -e 's/PROBLEM/ALRT: /'` $HOSTALIAS$ $SERVICEDESC$ is $SERVICESTATE$" $CONTACTEMAIL$
        }
Code:
# 'notify-by-epager' command definition
define command{
        command_name    notify-by-epager
        command_line    /usr/bin/printf "%b" "Enterprise Monitoring Assistant\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mailx -s "`echo $NOTIFICATIONTYPE$ | sed -e 's/RECOVERY/RCVR: /' -e 's/PROBLEM/ALRT: /'` $HOSTALIAS$ $SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
        }
Code:
# 'host-notify-by-email' command definition - New definition Feb 2010
define command{
        command_name    host-notify-by-email
        command_line    /usr/bin/printf "%b" "Notification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\n$NOTIFICATIONCOMMENT$\n\n$NOTIFICATIONAUTHOR$" | /bin/mailx -s "`echo $HOSTSTATE$ | sed -e 's/UP/RCVR: /' -e 's/DOWN/ALRT: /'` $HOSTNAME$ is $HOSTSTATE$" $CONTACTEMAIL$
        }
As noted previously we have defined misccommands.cfg in our nagios.cfg as one of the configuration files:
Code:
cfg_file=/usr/local/nagios/etc/objects/misccommands.cfg
I suggest you review the nagios.cfg as it has a lot of notes in it. Also look at templates.cfg as it has some examples.

You can go to Nagios' site to determine the meaning of the variables used in the above.
 
Old 04-07-2015, 10:38 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://www.linuxquestions.org/questi...3/#post4890806

Object inheritance

Last edited by Habitual; 04-07-2015 at 10:39 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Opennms -not receiving alert wen the service get down ramecare Linux - Server 3 07-12-2011 03:38 PM
How is the concept of notification defined in LQ? stf92 LQ Suggestions & Feedback 12 05-25-2009 06:42 PM
how to insert a module in kernel through a user defined service sharad Linux - General 5 03-25-2007 11:46 PM
user defined service Tonatiuh Linux - General 2 03-22-2006 01:44 PM
Not receiving notification emails Nylex LQ Suggestions & Feedback 2 09-07-2005 08:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration