(no subject)

Alexis Chauvin Alexis.chauvin at courtsplc.com
Wed Oct 1 15:39:33 CEST 2003


Glad this one wasn't > /dev/null ;-)
Sorry, this is  the informations :

OS :redhat 9.0, nagios 1.1.

So I'm sure there are no problems with /bin/mail ...

And your first answer, marc, made me think ...

In fact, I had only one command to send email, which is the one by default :
"notify-by-email", and I was using it for both services and hosts.

Now, I have (in $NAGIOS_DIR/etc/miscommands.cfg ) :

# '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$\n
State: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n" | /bin/mail -s "Host $HOSTSTATE$ alert
for $HOSTNAME$!" $CONTACTEMAIL$
        }

(I just copied this from your first message ..)

# 'service-notify-by-email' command definition
define command{
        command_name    service-notify-by-email
        command_line    /bin/echo -e "Subject: Service $SERVICEDESC$ $SERVICESTATE$ alert for $HOSTNAME$!\n\n***** Nagios ****
*\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $SERVICESTATE$\nAddress: $HOSTADDRESS$\n\nService: $SERVI
CEDESC$\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n" | /bin/mail -s '** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is
 $SERVICESTATE$ **' $CONTACTEMAIL$
        }
and surprisingly, I now have all the informations I need :

***** Nagios  *****

Notification Type: PROBLEM
Host: test
State: DOWN
Address: 10.100.10.15
Info: PING CRITICAL - Host Unreachable (10.100.10.15)

Date/Time: Wed Oct 1 14:13:45 BST 2003

For the host notification at least, didn't test yet for services.

Thank you very  much for that.

Regards

Alexis



-----Original Message-----
From: Marc Powell [mailto:mpowell at ena.com] 
Sent: 01 October 2003 14:27
To: Alexis Chauvin
Cc: nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] (no subject)

Well, without seeing your specific host, service and notify commands and a sample notification email, it's going to be hard to diagnose further. This functionality is very stable within nagios itself (i.e. it's very unlikely that it's a bug) and is more likely the result of a formatting error or the use of some unusual character in a definition somewhere. Also, since we're relying on other components of the OS like /bin/mail, OS vendor and version information might prove useful as well for vendor specific implementation issues. Finally, as the footer says --

::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null

--
Marc

> -----Original Message-----
> From: Alexis Chauvin [mailto:Alexis.chauvin at courtsplc.com]
> Sent: Wednesday, October 01, 2003 8:19 AM
> To: Marc Powell
> Cc: nagios-users at lists.sourceforge.net
> 
> Well, I 've got the same command, but what I meant is that I filled all
> options in the config files. But the macros don't get the values, that is,
> I receive email with blank spaces instead of informations
> 
> 
> Cheers,
> 
> alex
> 
> -----Original Message-----
> From: Marc Powell [mailto:mpowell at ena.com]
> Sent: 01 October 2003 14:12
> To: Alexis Chauvin; nagios-users at lists.sourceforge.net
> Subject: RE: [Nagios-users] (no subject)
> 
> This works for me --
> 
> # 'service-notify-by-email' command definition
> define command{
>         command_name    service-notify-by-email
>         command_line    /bin/echo -e "Subject: Service $SERVICEDESC$
> $SERVICESTATE$ alert for $HOSTNAME$!\n\n***** Nagios *****\n\
> nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
> $SERVICESTATE$\nAddress: $HOSTADDRESS$\n\nService: $SERVICEDESC$\nI
> nfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n" | /bin/mail -s '**
> $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$
> **' $CONTACTEMAIL$
>         }
> 
> When you say that you checked the variables in the config files and they
> weren't blank, what do you mean? They shouldn't be specified as they are
> used internally by nagios and change for each notification.
> 
> --
> Marc
> 
> ________________________________________
> From: Alexis Chauvin [mailto:Alexis.chauvin at courtsplc.com]
> Sent: Wednesday, October 01, 2003 6:12 AM
> To: nagios-users at lists.sourceforge.net
> 
> Hi,
> 
> Does anybody has a problem  with macros and notification by email ?
> It appears that I can't have $SERVISTATE$ and $SERVICEDESC$ in the
> notification by email.
> In the documentation, it is written that these macros should be available
> for service notifications.
> 
> I checked that the variables in the config files are not blank, and I use
> the "default" command for emailing, provided by the "make install-config".
> 
> Any ideas ?
> 
> Thanks
> 
> Alexis
> 
> 
> 
> Alexis Chauvin
> International IT
> tel +44(0)2084109476
> 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
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