====== Column Overview ======
^ Author | [[ gudm00@gmail.com | Gudmundur Ingvarsson ]] |
^ Compatibility | Xymon 4.2+ |
^ Requirements | Perl |
^ Download | http://sourceforge.net/projects/xymonesxi/files/redboard-imagepack.tar.gz/download |
^ Last Update | 2012-04-11 |
===== Description =====
When you click on a column header link you get a overview page for that test that displays the status of all hosts using the given test.
===== Installation =====
Find a this line in your hobbitserver.cfg and change it to this COLUMNDOCURL="$CGIBINURL/hobbitcolumn.sh?%s" # URL formatting string for column-links
hobbitcolumn.sh goes under the base cgi-bin directory
bb-csvinfo.cgi goes under the web cgi-bin directory
dashboard_header goes under the server/web directory with the rest of the headers.
Enjoy!
===== Source =====
==== hobbitcolumn.sh ====
#!/bin/sh
QS="${QUERY_STRING}"
QUERY_STRING="db=columndoc.csv&key=${QS}&nongreen=all"
export QUERY_STRING
. /usr/local/xymon/server/etc/hobbitcgi.cfg
exec /usr/local/xymon/server/bin/bb-csvinfo.cgi $CGI_HOBBITCOLUMN_OPTS
==== bb-csvinfo.cgi ====
#!/usr/local/bin/perl
# Written by Gudmundur Orn Ingvarsson
# Last update: May 31st 2011
# Please contact me at: gudm00@gmail.com for questions or comments
#use strict;
use warnings;
use diagnostics;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use Math::Complex;
# Basic Config Variables
$version = "0.1";
my $bb_home = "/usr/local/xymon";
my $bb_header = "$bb_home/server/web/dashboard_header"; # Change this if needed.
my $bb_footer = "$bb_home/server/web/edit_footer"; # Change this if needed.
my $bb_web = "/";
my $bb_gifs = "/gifs";
my $hobbitcfg="/usr/local/xymon/server/etc/hobbitserver.cfg";
my $hobbitdrel = `$bb_home/server/bin/bb --version | awk '{print \$3}'`;
my $BBMENUSKIN = "/menu";
$i = 0;
$greencount = 0;
$redcount = 0;
$bluecount = 0;
$yellowcount = 0;
$clearcount = 0;
$unknowncount = 0;
$purplecount = 0;
$incoming = $ENV{"QUERY_STRING"};
($arg1,$arg2,$arg3,$arg4) = split(/\&/, $incoming);
($db,$dbvalue) = split(/\=/, $arg1);
($testkey,$test) = split(/\=/, $arg2);
($non,$green) = split(/\=/, $arg3);
$date = localtime;
sub print_error() {
my $error_msg = shift;
my $color = shift || 'clear';
$error = 1;
print "
$error_msg
";
}
sub header () {
# Basic HTML Code at the top
print "Content-type: text/html\n\n";
my $color = "black";
open (HEAD, "<$bb_header") or &print_error("I can't open $bb_header for reading!");
while (