From: <buc...@us...> - 2011-01-14 13:32:13
|
Revision: 190 http://devmon.svn.sourceforge.net/devmon/?rev=190&view=rev Author: buchanmilne Date: 2011-01-14 13:32:06 +0000 (Fri, 14 Jan 2011) Log Message: ----------- Change Hobbit-related strings to be based on bbtype Allow 'xymon' as a value for bbtype, and make it the default Update some other occurances of the string "Hobbit" Modified Paths: -------------- trunk/README trunk/devmon.cfg trunk/modules/dm_config.pm trunk/modules/dm_snmp.pm trunk/modules/dm_tests.pm Modified: trunk/README =================================================================== --- trunk/README 2011-01-13 12:04:27 UTC (rev 189) +++ trunk/README 2011-01-14 13:32:06 UTC (rev 190) @@ -1,5 +1,5 @@ -Devmon, version 0.2 +Devmon, version 0.3.1-beta1 ===================================================================== This program is free software; you can redistribute it and/or modify @@ -62,11 +62,11 @@ is used to execute the Devmon code. In addition, you will need a machine (either the same machine - running Devmon, or a different one) runing either the Hobbit + running Devmon, or a different one) runing either the Hobbit/Xymon or BigBrother monitoring program, which displays the messages that Devmon generates. - Finally, you will need your to have your Hobbit or BigBrother + Finally, you will need your to have your Hobbit/Xymon or BigBrother program set up to monitor at least one host that Devmon has a template for. Only then will Devmon be able to poll a remote host and display the results. For more information on Modified: trunk/devmon.cfg =================================================================== --- trunk/devmon.cfg 2011-01-13 12:04:27 UTC (rev 189) +++ trunk/devmon.cfg 2011-01-14 13:32:06 UTC (rev 190) @@ -19,9 +19,9 @@ # used when running devmon with the --readbbhosts flag. In a multi-node # cluster, the only system that needs to have this set is the one that # the display server is running on; other systems can leave this at default. -# (case sensitive) [DEFAULT: /home/hobbit/server/etc/bb-hosts or +# (case sensitive) [DEFAULT: /home/xymon/server/etc/bb-hosts or # BBHOSTS environment variable set] -#BBHOSTS=/home/hobbit/server/etc/bb-hosts +#BBHOSTS=/home/xymon/server/etc/bb-hosts # BBTAG: This is the indentifier (aka tag) that you use in your bb-hosts # which allows Devmon to determine which of the options after a host @@ -89,11 +89,11 @@ ### # BBTYPE: Determines how devmon will format its output pages.Accetable values -# are 'bb' or 'hobbit', either each option setting the output format to that -# of its respective server type [DEFAULT: hobbit] -BBTYPE=hobbit +# are 'bb','hobbit' or 'xymon, either each option setting the output format to that +# of its respective server type [DEFAULT: xymon] +BBTYPE=xymon -# DISPSERV: Should contain the DNS name or IP address of th BB or hobbit +# DISPSERV: Should contain the DNS name or IP address of th BB or hobbit/xymon # display server. [DEFAULT: localhost or BBDISP environment variable if set] #DISPSERV=localhost Modified: trunk/modules/dm_config.pm =================================================================== --- trunk/modules/dm_config.pm 2011-01-13 12:04:27 UTC (rev 189) +++ trunk/modules/dm_config.pm 2011-01-14 13:32:06 UTC (rev 190) @@ -169,8 +169,8 @@ # Our global options %{$g{'globals'}} = ( - 'bbtype' => { 'default' => 'hobbit', - 'regex' => 'bb|hobbit', + 'bbtype' => { 'default' => 'xymon', + 'regex' => 'bb|hobbit|xymon', 'set' => 0, 'case' => 0 }, 'dispserv' => { 'default' => (defined $ENV{'BBDISP'} and $ENV{BBDISP} ne '') ? $ENV{'BBDISP'} : 'localhost', @@ -338,7 +338,7 @@ do_log("---Initilizing devmon...",0); do_log("Verbosity level: $g{'verbose'}",1); do_log("Logging to $g{'logfile'}",1); - do_log("Node $g{'my_nodenum'} reporting to $g{'dispserv'}",0); + do_log("Node $g{'my_nodenum'} reporting to $g{'bbtype'} at $g{'dispserv'}",0); do_log("Running under process id: $g{'mypid'}",0); # We are now initialized Modified: trunk/modules/dm_snmp.pm =================================================================== --- trunk/modules/dm_snmp.pm 2011-01-13 12:04:27 UTC (rev 189) +++ trunk/modules/dm_snmp.pm 2011-01-14 13:32:06 UTC (rev 190) @@ -65,8 +65,8 @@ # Query our hobbit server for device reachability status # we dont want to waste time querying devices that are down # Note: this doesn't work for the original BigBrother server - if($g{'bbtype'} eq 'hobbit') { - do_log("Getting device status from hobbit at " . $g{'dispserv'} . ":" . $g{'dispport'},1); + if($g{'bbtype'} eq 'hobbit' or $g{'bbtype'} eq 'xymon') { + do_log("Getting device status from $g{'bbtype'} at " . $g{'dispserv'} . ":" . $g{'dispport'},1); %{$g{'hobbit_color'}} = (); my $sock = IO::Socket::INET->new ( PeerAddr => $g{'dispserv'}, @@ -81,7 +81,7 @@ while(<$sock>) { my ($device,$color,$line1) = split /\|/; my ($l1col) = ($line1 =~ /^(\w+)/); - do_log("DEBUG SNMP: $device has hobbit status $color ($l1col)",2) if $g{debug}; + do_log("DEBUG SNMP: $device has $g{'bbtype'} status $color ($l1col)",2) if $g{debug}; $g{'hobbit_color'}{$device} = $color ne "blue" && $color || $l1col; } } @@ -97,7 +97,7 @@ # server thinks that it isnt reachable if(defined $g{'hobbit_color'}{$device} and $g{'hobbit_color'}{$device} ne 'green') { - do_log("$device has a non-green hobbit status, skipping SNMP.", 2); + do_log("$device has a non-green $g{'bbtype'} status, skipping SNMP.", 2); next QUERYHASH; } Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2011-01-13 12:04:27 UTC (rev 189) +++ trunk/modules/dm_tests.pm 2011-01-14 13:32:06 UTC (rev 190) @@ -1693,8 +1693,9 @@ # Do we have a hobbit color, and if so, is it green? elsif(defined $g{'hobbit_color'}{$device} and $g{'hobbit_color'}{$device} ne 'green') { + my $bbname = ucfirst $g{'bbtype'}; return "status $bb_host.$test clear $now" . - "\n\nHobbit reports this device is unreachable.\n" . + "\n\n$bbname reports this device is unreachable.\n" . "Suspending this test until reachability is restored\n\n" . "Devmon version $g{'version'} running on $g{'nodename'}\n"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |