not receiving the nagios notifications

Felipe Tocchetto felipe at tocchetto.com
Wed Jul 26 21:54:11 CEST 2006


Hi Marc

Thaks for your effort in help me.

Here is the commands outputs

bash-3.00$ /bin/echo '/usr/bin/printf "%b" "***** Nagios
*****\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$' >> /tmp/host-notify


bash-3.00$ cat /tmp/host-notify
/usr/bin/printf "%b" "***** Nagios *****

Notification Type: $NOTIFICATIONTYPE$
Host: $HOSTNAME$
State: $HOSTSTATE$
Address: $HOSTADDRESS$
Info: $HOSTOUTPUT$

Date/Time: $LONGDATETIME$
" | /usr/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$


bash-3.00$ id
uid=100(nagios) gid=1(other)

2006/7/26, Marc Powell <marc at ena.com>:
> I'm running out of ideas. Try changing your notify command_line to be --
>
>        command_line    /bin/echo '/usr/bin/printf "%b" "***** Nagios *****\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$' >> /tmp/host-notify
>
> Make sure it's all one line. After a notification attempt, the file /tmp/host-notify will contain the command line that nagios would have executed. Try running that as the nagios user.
>
> --
> Marc
>
> > -----Original Message-----
> > From: tocchetto at gmail.com [mailto:tocchetto at gmail.com] On Behalf Of Felipe
> > Tocchetto
> > Sent: Tuesday, July 25, 2006 4:31 PM
> > To: Marc Powell
> > Cc: Nagios Users Mailinglist
> > Subject: Re: [Nagios-users] not receiving the nagios notifications
> >
> > Hi Marc
> >
> > Here some tests
> >
> > The command:
> >
> > id;/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: Host
> > Notification\nHost: teste.xxx.xxxx.br\nState: CRITICAL\nAddress:
> > 200.xxx.xx.xx\nInfo: CRITICAL - Plugin timed out after 10
> > seconds\n\nDate//Time: 24/07/2006 11:11:11\n" | /usr/bin/mail -s
> > "alert" felipe at tocchetto.com
> >
> > just 1 line!
> >
> > The output for the command:
> >
> > uid=100(nagios) gid=1(other)
> >
> > And I receive the email:
> >
> > ***** Nagios *****
> >
> > Notification Type: Host
> > Notification
> > Host: teste.xxx.xxxx.br
> > State: CRITICAL
> > Address:
> > 200.xxx.xx.xx
> > Info: CRITICAL - Plugin timed out after 10
> > seconds
> >
> > Date/Time: 24/07/2006 11:11:11
> >
> > All commands are in just 1 line...
> >
> > I am using the default commands from the nagios instalation, I didn´t
> > change anything.
> >
> >
> >
> > 2006/7/24, Marc Powell <marc at ena.com>:
> > >
> > >
> > > > -----Original Message-----
> > > > From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> > > > bounces at lists.sourceforge.net] On Behalf Of Felipe Tocchetto
> > > > Sent: Monday, July 24, 2006 3:34 PM
> > > > To: Nagios Users Mailinglist
> > > > Subject: Re: [Nagios-users] not receiving the nagios notifications
> > > >
> > > > I am using the default command.
> > > >
> > > > Manually it works, without the vars.
> > > > Thanks a lot.
> > > >
> > > > I really dont know how to fix it.
> > >
> > >
> > > I see a couple more things that I originally attributed to my mail
> > > client formatting of your original message. They may actually be
> > > problems with your config.
> > >
> > > # 'host-notify-by-email' command definition
> > > define command{
> > >        command_name    host-notify-by-email
> > >        command_line    /usr/bin/printf "%b" "***** Nagios
> > > *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\
> > > nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo:
> > > $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "Host
> > > $HOS
> > > TSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
> > >        }
> > >
> > > In the above definition I see a carriage returns between "$HOSTNAME\"
> > > and "nState:" as well as between "Host $HOS" and "TSTATE$". Do they
> > > really exist in your config file? They should not. If no, can you send
> > > the output of the following command when run as the nagios user?
> > >
> > > id;/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: Host
> > > Notification\nHost: teste.xxx.xxxx.br\nState: CRITICAL\nAddress:
> > > 200.xxx.xx.xx\nInfo: CRITICAL - Plugin timed out after 10
> > > seconds\n\nDate/Time: 24/07/2006 11:11:11\n" | /usr/bin/mail -s "Host
> > > CRITICAL alert for Test Machine!"  felipe at tocchetto.com
> > >
> > >
> > >
> > > ------
> > >
> > > # 'notify-by-email' command definition
> > > define command{
> > >        command_name    notify-by-email
> > >        command_line    /usr/bin/printf "%b" "***** Nagios
> > > *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVI
> > > CEDESC$\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$ **" $CONTACTE
> > > MAIL$
> > >        }
> > >
> > > In the above command I see a carriage returns between "$SERIV" and
> > > "CEDESC$" as well as between "$CONTACTE" and "MAIL$". Do they really
> > > exist in your config file? They should not.
> > >
> > > --
> > > Marc
> > >
> > > ------------------------------------------------------------------------
> > -
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to share
> > your
> > > opinions on IT & business topics through brief surveys -- and earn cash
> > >
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > _______________________________________________
> > > 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
> > >
> >
> >
> > --
> > Felipe L. Tocchetto
> > http://felipe.tocchetto.com
>


-- 
Felipe L. Tocchetto
http://felipe.tocchetto.com

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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