Re: [Nagios-devel] Custom misccommands.cfg

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Custom misccommands.cfg

Post by Guest »



> -----Original Message-----
> From: [email protected] [mailto:nagios-devel-
> [email protected]] On Behalf Of Jeremy Young
> Sent: Wednesday, December 13, 2006 1:34 PM
> To: Nagios-Devel
> Subject: [Nagios-devel] Custom misccommands.cfg
>=20
> Quick question, wondering if it was possible to grab a HOSTGROUP
> variable when using a command like host-notify-by-email, or
> notify-by-email. I would like the notification to show which hostgroup
> the affected host belongs to?
>=20
> The following does not work:
>=20
> define command{
> command_name notify-by-email
> command_line /usr/bin/printf "%b" "***** Nagios-MCI
> *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
> $SERVICEDESC$\nHost: $HOSTALIAS$\nHost Group: $HOSTGROUP$\nAddress:
> $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time:
> $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s
> "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is
> $SERVICESTATE$ **" $CONTACTEMAIL$
> }
>=20
> Any help is much appreciated?

This is really a question for nagios-users. All available macros are
well documented here --
http://nagios.sourceforge.net/docs/2_0/macros.html. You probably want
$HOSTGROUPNAME$ or $HOSTGROUPALIAS$ presuming you are using Nagios 2.x.

--
Marc





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked