Variable showing $ in email & pages?

Bill Akins Bill_Akins at emoryhealthcare.org
Fri Jan 28 15:38:56 CET 2005


Thanks for all of the responses.  Alerting is fully reporting now.

>>> Subhendu Ghosh <sghosh at sghosh.org> 1/28/2005 9:27 AM >>>
On Thu, 27 Jan 2005, Bill Akins wrote:

> Hi all,
>
> I am running Nagios 2.0b1 on RedHat Enterprise 3 (kernel
> 2.4.21-27.0.2.ELsmp).
>
> I have recently installed Nagios and have 99 hosts and almost 200
> services defined and monitoring works great!  I am having a very
minor
> problem with alerting.  I get the messages by email and pager, but
it
> seems Nagios is passing the variable for datetime & output as an
empty
> and is catching the trailing $ as shown below:
>
> ***** Nagios  *****
>
> Notification Type: RECOVERY
>
> Service: MTA
> Host: GroupWise Server 0
> Address: AAA.BBB.CCC.DDD
> State: OK
>
> Date/Time: $
>
> Additional Info:
>
> $
>
> The relevant sections of misccommands.cfg follow:
>
> # '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:
> $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
> $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional
Info:\n\n$OUTPUT$"
> | /bin/mail -s "** $NOTIFICATIONTYPE$ alert -
$HOSTALIAS$/$SERVICEDESC$
> is $SERVICESTATE$ **" $CONTACTEMAIL$
>        }
>
>
> # 'notify-by-epager' command definition
> define command{
>        command_name    notify-by-epager
>        command_line    /usr/bin/printf "%b" "Service:
> $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState:
> $SERVICESTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$" | /bin/mail -s
> "$NOTIFICATIONTYPE$: $HOSTALIAS$: $SERVICEDESC$ is $SERVICESTATE$"
> $CONTACTPAGER$
>        }
>
> Any clues on this one?  It's not a show-stopper since email and
pages
> have a time stamp, but I would like to have it working before I show
the
> boss what Nagios can do for us.
>
> Thanx!
>

You are using the commands definitions from 1.x and some of the macros

have changed in 2.0 to support the new features...

$OUTPUT$ should be $SERVICEOUTPUT$ or $HOSTOUTPUT$ depending on the 
notification

$DATETIME$ should be $LONGDATETIME$ or $SHORTDATETIME$ and depends on
the 
date_format directive in nagios.cfg

-- 
-sg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050128/4ba01e9c/attachment.html>


More information about the Users mailing list