[Xymon] Adding to subject line of email notice?

Jeremy Laidman jlaidman at rebel-it.com.au
Fri Jan 1 02:05:43 CET 2016


By using a SCRIPT alert you can display whatever you like. As long as you
can get it. In this case, the only tricky but is finding the name of the
subpage.

The "subpage" config directive is intended for web page display and is
parsed only by xymongen. The page tags are not actually assigned to each
host and so there is no mechanism to query what page a host is on.

However you could find a host's subpage by using GNU grep context on the
output of the xymoncfg command. Something like this (untested):

SUBPAGE=`xymoncfg | egrep "^[.0-9]*[[:blank:]]*$BBHOSTNAME|^subpage" |
egrep -B1 "^[.0-9]*[[:blank:]]*$BBHOSTNAME" | { read A B C; echo "$C" }`

Cheers
Jeremy

On Fri, 1 Jan 2016 02:29 Neal, Jonathan W via Xymon <xymon at xymon.com> wrote:

> Is there a way to include the subpage as part of the subject AND the body
> of the email alert that Xymon sends.
>
>
>
> So if your hosts.cfg had something like this in it:
>
>
>
> subpage chicken Chicken Servers
>
>
>
> I get a CPU alert via email and the subject says:
>
>
>
> Xymon [120954] server01:cpu CRITICAL (RED)
>
>
>
> I would like the subject to say instead:
>
>
>
> Xymon [120954] server01:cpu CRITICAL (RED)     Chicken Servers
>
>
>
> Thanks in advance!
>
>
>
>
>
> ---------- Forwarded message ----------
> From: "Neal, Jonathan W via Xymon" <xymon at xymon.com>
> To: "xymon at xymon.com" <xymon at xymon.com>
> Cc:
> Date: Thu, 31 Dec 2015 16:29:43 +0100 (CET)
> Subject: [Xymon] Adding to subject line of email notice?
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20160101/8b5c62ab/attachment.html>


More information about the Xymon mailing list