Variable showing $ in email & pages?
Marc Powell
mpowell at ena.com
Fri Jan 28 14:00:36 CET 2005
> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Bill Akins
> Sent: Thursday, January 27, 2005 6:53 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Variable showing $ in email & pages?
>
> 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.
Did you upgrade from 1.x? The macros changed with 2.0 and you're using
the old ones --
http://nagios.sourceforge.net/docs/2_0/macros.html
You probably want $LONGDATETIME$, $SERVICEOUTPUT$ and $HOSTOUTPUT$.
--
Marc
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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