Xymon Mailing List Archive search

Adding to subject line of email notice?

2 messages in this thread

list Wes Neal · Thu, 31 Dec 2015 10:18:52 -0500 ·
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!
list Jeremy Laidman · Fri, 01 Jan 2016 01:05:43 +0000 ·
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
quoted from Wes Neal

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?