[Xymon] Setting up a new non-green page for a specific list of systems

J.C. Cleaver cleaver at terabithia.org
Tue Mar 18 17:39:12 CET 2014


On Tue, March 18, 2014 9:00 am, Root, Paul T wrote:
> I believe you can include one file in the other.
>
> On Fri, Feb 14, 2014 at 6:22 PM, John Thurston
> <john.thurston at alaska.gov<mailto:john.thurston at alaska.gov>> wrote:
> On 2/14/2014 6:59 AM, Steve B wrote:
> I would like to have a non-green page that only shows network devices (at
> the moment I just have the one setup with all machines) and saw the
> following in a previous exchange of emails:
>
> Alternatively, you can set up a new non-green page for just that
> specific list of systems.
> Look here for more
> information.http://www.hswn.dk/hobbiton/2008/05/msg00121.html
>
> http://lists.xymon.com/archive/2008-September/021103.html
>


If it's its own subpage already, you can use the BOARDFILTER environment
variable read by xymongen and something like this. If it's not a distinct
page, but is a distinct file, you can just feed the file directly as the
HOSTSCFG variable

This is an untested (!), hastily-genericized version of a script we use
internally as one of our dashboards. We have a huge number of host-like
objects in hosts.cfg, so being able to create special nongreen subviews
helps keep certain dashboards useful.

Just set this to run via a tasks.cfg stanza like normal, editing the
parameters as needed.

HTH,

-jc

=============================================================

#!/bin/sh

# Create a special page for a "specialsites-only"-ish production view of
nongreen (outages)
#
PAGESCREATED="red nongreen critical"
LABEL="specialsites"
TESTFILTER=' test=http'


# You should run this from the xymon environment
test -z "$XYMONTMP" && echo "XYMONTMP is empty" && exit 1


# Save the real output dir so we know where to put the results
oldXYMONWWWDIR="$XYMONWWWDIR"
export XYMONWWWDIR="$XYMONTMP/xymongen_${LABEL}.$$"
mkdir -p "$XYMONWWWDIR"

# optional - if you have them in a segregated hosts.cfg file anyway
# export HOSTSCFG=/etc/xymon/hosts.d/all-specialsites-list

# Only include items on this specific page... eg, "page=importantsites
test=http"
export BOARDFILTER="page=${LABEL}${TESTFILTER}"

xymongen --recentgifs --nopropack='*' --report=xymongen-${LABEL}
--no-pages --eventignore=conn --includecolumns=trends
RES="$?"

if [ "$RES" -gt 0 ] ; then
        echo "xymongen-${LABEL} exited with $RES dealing with
$XYMONWWWDIR" >&2
		# safe - see above
		for THIS in $PAGES; do
			rm -f "$XYMONWWWDIR/${THIS}.html"
		done
		rmdir "$XYMONWWWDIR"
        exit $RES
fi

for THIS in $PAGES; do
        mv "$XYMONWWWDIR/${THIS}.html"
"${oldXYMONWWWDIR}/${THIS}-${LABEL}.html"
done

# should be empty
rmdir "$XYMONWWWDIR"

exit 0





More information about the Xymon mailing list