Question for macros for host-notify-by-email
Marc Powell
marc at ena.com
Wed Mar 23 16:38:40 CET 2005
> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Holger Wirtz
> Sent: Wednesday, March 23, 2005 3:37 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Question for macros for host-notify-by-email
>
> Hi all,
>
> I have a simple problem with my configs for the host-notify-by-email
> command. I have defined the following:
>
> 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: $OUTPUT$\n\nDate/Time:
> $DATETIME$\n" | /usr/bin/mail -s "Host $HOSTSTATE$ alert for
$HOSTNAME$!"
> $CONTACTEMAIL$
> }
>
> But inside the email I got this:
>
> --- cut here ---
> ***** Nagios *****
>
> Notification Type: PROBLEM
> Host: bla.fasel.org
> State: DOWN
> Address: 222.211.200.2
> Info: $
>
> Date/Time: $
> --- cut here ---
>
> Seems that the macros for $DATETIME$ and $OUTPUT$ have changed or what
is
> the problem?
Since there are few details about what version you are using, I am going
to assume that you are using 1.x config files with a 2.x installation of
nagios. There have been significant changes to the macros with 2.x and
you should review any that you are using.
http://nagios.sourceforge.net/docs/2_0/macros.html
In this case, I think you're looking for $HOSTOUTPUT$ and either
$LONGDATETIME$ or $SHORTDATETIME$, depending on which you want.
--
Marc
-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_idh82&alloc_id148&op=click
_______________________________________________
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