[Xymon] Custom Non Green Displays

Henrik Størner henrik at hswn.dk
Thu May 19 17:51:44 CEST 2011


> Is there a way to create multiple custom non-green displays?
>
> I have a large environment where each department is only concerned with
> thier own devices.

I think the easiest way to do this would be via the "Critical systems" 
view. Usually you only have one of those, but there is nothing wrong 
with having several of them, and the criticalview CGI has an option so 
you can run it with different configuration files.

Something like this might be what you are after. This is a CGI script 
that generates a config file for the criticalview CGI with the hosts on 
the "windows" page, and then builds a "Critical Systems" page for only 
those hosts:

----- cut here and save in the Xymon cgi-bin directory -----
#!/bin/sh

# Pick only hosts on the "windows" page
PAGE="windows"

# Get red ones as priority 1
xymon 127.0.0.1 \
  "xymondboard color=red fields=hostname,testname page=$PAGE" | \
  awk '{ print $1 "||||1|||" }' > /tmp/crit_$$.cfg
# Yellow ones get priority 2
xymon 127.0.0.1 \
  "xymondboard color=yellow fields=hostname,testname page=$PAGE" | \
  awk '{ print $1 "||||2|||" }' >> /tmp/crit_$$.cfg

# Build the webpage
. /usr/lib/xymon/server/etc/cgioptions.cfg
$XYMONHOME/bin/criticalview.cgi $CGI_CRITVIEW_OPTS \
    --config=/tmp/crit_$$.cfg

rm -f /tmp/crit_$$.cfg
exit 0
----- end cut -----

In fact, if you leave out the "page=$PAGE" filtering, this would give 
you the normal "All non-green" webpage, but with the additional 
filtering and ack-options of the "Critical Systems" view. In real-time 
instead of the updated-once-a-minute view ...

See the xymon(1) manpage if you want to know more about how you can 
filter hosts retrieved from the xymondboard command.


Regards,
Henrik



More information about the Xymon mailing list