Query regarding Nagios notification

Satish Kumar P satishkumarp2k1 at gmail.com
Wed Oct 14 09:58:01 CEST 2009


On Wed, Oct 14, 2009 at 12:58 PM, Marc-André Doll <mad at b-care.net> wrote:
> Le mercredi 14 octobre 2009 à 12:17 +0530, Satish Kumar P a écrit :
>> On Wed, Oct 14, 2009 at 11:22 AM, Justin Pryzby <justinp at norchemlab.com> wrote:
>> > On Wed, Oct 14, 2009 at 11:13:08AM +0530, Satish Kumar P wrote:
>> >> Hi,
>> >>
>> >> We have a Nagios server that monitors around 300 production servers
>> >> and around 2000+ services on all these servers. Recently, when the
>> >> STATE of one of the services on a particular host turned HARD, but
>> >> Nagios didn't NOTIFY. So I am just trying to understand why it didn't
>> >> notify. Here's more information regarding the configuration:
>> >
>
> What happened te me once was Nagios not sending notification because for
> some reasons the output was changed and contained spaces. As the
> "$OUTPUT$" macro wasn't quoted in the notification command definition,
> we encountered some erratic behaviours. Check your notification command
> definition to be sure.
>
> Marc-André
>

Hi Marc,

Thanks for the update. Actually all the macros seem to be quoted in
the command definitions. Check the below mentioned command
definitions. Nagios was supposed to use them for the service I
mentioned.

define command{        command_name    notify-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nURL:
https://some-url/hosts/show/$HOSTADDRESS$\nState:
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$
alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
        }

# 'notify-by-pager' command definition
define command{
        command_name    notify-by-pager
  command_line  /usr/bin/printf "%b" "$NOTIFICATIONTYPE$:
$HOSTALIAS$/$SERVICEDESC$ is
$SERVICESTATE$\n$SHORTDATETIME$\n$SERVICEOUTPUT$" | /usr/bin/mail -s
"$NOTIFICATI
ONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
        }

But one more quick question: If the issue were related to "not quoting
the macros in command definition", Nagios should have logged something
regarding the "SERVICE NOTIFICATION" right (though whether we received
the notification or not). Correct me if I am wrong. Looking at the
logs, I am guessing that due to some reason, Nagios didn't initiate a
notification at all.

Thanks,
Satish

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list