From: <buc...@us...> - 2009-01-23 09:15:06
|
Revision: 121 http://devmon.svn.sourceforge.net/devmon/?rev=121&view=rev Author: buchanmilne Date: 2009-01-23 09:15:00 +0000 (Fri, 23 Jan 2009) Log Message: ----------- Add new STATUS: key for message file, which allows extending the first line of the status message Modified Paths: -------------- trunk/docs/TEMPLATES trunk/modules/dm_tests.pm Modified: trunk/docs/TEMPLATES =================================================================== --- trunk/docs/TEMPLATES 2009-01-22 18:09:01 UTC (rev 120) +++ trunk/docs/TEMPLATES 2009-01-23 09:15:00 UTC (rev 121) @@ -960,6 +960,14 @@ TABLE: alarmsonbottom,border=0,pad=10 + The STATUS: key allows you to extend the first line of the status + message that Devmon sends to BB/Hobbit. For example, if you need + to get data to a Hobbit rrd collector module that evaluates data + in the first line of the message (such as the Hobbit la collector + which expects "up: <time>, %d users, %d procs load=%d.%d" you can + use this key as follows to get a load average graph: + + STATUS: up: load={laLoadFloat2} ---------------------------------- -- Done! Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2009-01-22 18:09:01 UTC (rev 120) +++ trunk/modules/dm_tests.pm 2009-01-23 09:15:00 UTC (rev 121) @@ -1696,6 +1696,7 @@ my $errors = ''; my $worst_color = 'green'; my $table = undef; + my $extrastatus = ''; my (%t_opts,%rrd); # Go through message template line by line @@ -2135,7 +2136,12 @@ # Avoid blank error lines $line = ($line eq '#ERRORONLY#') ? '' : "$line\n"; - $msg .= $line; + if ($line =~ /^STATUS:(.*)$/) { + # + $extrastatus = $1; + } else { + $msg .= $line; + } } } @@ -2145,7 +2151,7 @@ # Now add our header so bb/hobbit can determine the page color $msg = "status $bb_host.$test $worst_color $now" . - "\n\n$msg"; + "$extrastatus\n\n$msg"; # Add our oh-so-stylish devmon footer $msg .= "\n\nDevmon version $g{'version'} " . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |