[Xymon] MAPE: tweak for display of servers

Deiss, Mark Mark.Deiss at xerox.com
Wed Feb 13 18:06:15 CET 2013


This is for MAPE 1.4 - may not be correct for 1.4+.

The MAPE web page displays the server entries in a branch in a random order. The www/MAPE/bin/parse-config.pl can be adjusted so that MAPE displays the upper branches, and the servers under a branch, follow the ordering in the Xymon hosts.cfg file. Alternatively, the file can be adjusted so the MAPE displays branches and servers under a branch in alphabetical sequence.

For the case of MAPE web page displaying per order of Xymon hosts.cfg entries. Need to save the entryid values into the map hash table for each entry (this change is sprinkled through parse-config.pl and not shown here), and sort on the entryid value in the drawMap subroutine via:

# 2/13/13 mcd - disable original loop control
#foreach my $element (keys %map)

# 2/13/13 mcd - add sort on entryid in loop control - this will follow server ordering in hosts.cfg
foreach my $element (sort { $map{$a}{"entryid"} <=> $map{$b}{"entryid"} } keys %map)

For the second case of MAPE web page displaying levels and servers in a branch in alphabetical order. Need to sort on the name value in the drawMap subroutine via:

# 2/13/13 mcd - disable original loop control
#foreach my $element (keys %map)

# 2/13/13 mcd - add sort on name in loop control - this will alphabetize order groups and servers
#       override ordering in hosts.cfg
foreach my $element (sort { $map{$a}{"name"} cmp $map{$b}{"name"} } keys %map)

For this latter sort, a minor tweak is also required to populate the top leaf with a "name" value.

Popular root note
$map{0}{"title"} = $config{"company-name"};             # Read company name from config file
....
$map{0}{"entryid"} = 0;
# 2/13/13 mcd - add in something for name entry
$map{0}{"name"} = $config{"company-name"};

I can post the modified www/MAPE/bin/parse-config.pl that covers all of the changes if there is any interest, it's a 332 line file at the moment.

Some sites may want to take this sorting another step and promote red alerts (then yellow alerts) so they are grouped at the top of the MAPE web page. Right now they are scattered around in the MAPE web display. Of course the other green servers in a branch with a red/yellow server entry would also be displayed at the top of the display but the idea is to move all red/yellow tree paths and red/yellow server leafs to the top of the display.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20130213/0b585425/attachment.html>


More information about the Xymon mailing list