[Xymon] IP of host in mail subject

Jeremy Laidman jeremy at laidman.org
Sat Aug 4 13:30:09 CEST 2018


On 31 July 2018 at 05:35, Gabo Suárez <jgsuareza1984 at gmail.com> wrote:

> Hi greetings from Ecuador,
>

Hello Gabo


> Please your help, I need that the XYMON monitoring mails include the IP of
> the host-client
>

> How do i do it?
>

The IP address of the client is in the variable $MACHIP. I think this
variable is only available to scripts, not the standard MAIL function. To
do this, you can create a script that sends an email.

For example, use this in alerts.cfg:

HOST=client.host.name
    SCRIPT /usr/local/bin/mailscript placeholder FORMAT=TEXT

Then create a script that goes something like this:

#!/bin/sh
mail -s "$BBHOSTNAME $BBSVCNAME - $BBCOLORLEVEL $ACKCODE $RECOVERED
$DOWNSECMSG" $RCPT <<EOF
$BBALPHAMSG
IP is $MACHIP
EOF

For more information about the Xymon alert environment variables, check out
the Alerts documentation:

http://xymon.sourceforge.net/xymon/help/xymon-alerts.html

 and the alerts.cfg man page:

http://xymon.sourceforge.net/xymon/help/manpages/man5/alerts.cfg.5.html

J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20180804/23e5bbfd/attachment.html>


More information about the Xymon mailing list