From: <buc...@us...> - 2008-12-06 12:22:17
|
Revision: 94 http://devmon.svn.sourceforge.net/devmon/?rev=94&view=rev Author: buchanmilne Date: 2008-12-06 11:33:51 +0000 (Sat, 06 Dec 2008) Log Message: ----------- Move version to main script Modified Paths: -------------- trunk/devmon trunk/modules/dm_config.pm Modified: trunk/devmon =================================================================== --- trunk/devmon 2008-12-06 08:52:22 UTC (rev 93) +++ trunk/devmon 2008-12-06 11:33:51 UTC (rev 94) @@ -1,5 +1,5 @@ #!/usr/bin/perl -w - +our $VERSION = '0.3.0'; # Devmon: An SNMP data collecteor & page generator for the BigBrother & # Hobbit network monitoring systems # Copyright (C) 2005-2006 Eric Schwimmer @@ -23,7 +23,7 @@ use dm_msg; # Do start-up housekeeping - initialize(); + initialize($VERSION); # Enter main loop do_log("Entering poll loop", 0); Modified: trunk/modules/dm_config.pm =================================================================== --- trunk/modules/dm_config.pm 2008-12-06 08:52:22 UTC (rev 93) +++ trunk/modules/dm_config.pm 2008-12-06 11:33:51 UTC (rev 94) @@ -35,7 +35,7 @@ %g = ( # General variables - 'version' => '0.3.0-rc1', + 'version' => $_[0], # set in main script now 'homedir' => $FindBin::Bin, 'configfile' => "$FindBin::Bin/devmon.cfg", 'dbfile' => "$FindBin::Bin/hosts.db", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2008-12-07 19:58:44
|
Revision: 95 http://devmon.svn.sourceforge.net/devmon/?rev=95&view=rev Author: buchanmilne Date: 2008-12-07 19:58:38 +0000 (Sun, 07 Dec 2008) Log Message: ----------- Add svn keywords to files that should have them Modified Paths: -------------- trunk/README trunk/devmon trunk/docs/GRAPHING trunk/docs/INSTALLATION trunk/docs/MULTINODE trunk/docs/TEMPLATES trunk/docs/USING trunk/docs/using.html trunk/extras/devmon-rrd.pl trunk/modules/dm_config.pm trunk/modules/dm_msg.pm trunk/modules/dm_snmp.pm trunk/modules/dm_templates.pm trunk/modules/dm_tests.pm Property Changed: ---------------- trunk/devmon trunk/docs/COPYING trunk/docs/GRAPHING trunk/docs/INSTALLATION trunk/docs/MULTINODE trunk/docs/TEMPLATES trunk/docs/USING trunk/docs/using.html trunk/extras/devmon-rrd.pl trunk/extras/do_devmon.c trunk/modules/dm_config.pm trunk/modules/dm_msg.pm trunk/modules/dm_snmp.pm trunk/modules/dm_templates.pm trunk/modules/dm_tests.pm Modified: trunk/README =================================================================== --- trunk/README 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/README 2008-12-07 19:58:38 UTC (rev 95) @@ -126,3 +126,4 @@ Devmon on a 386 with 8MB of memory. +$Id$ Modified: trunk/devmon =================================================================== --- trunk/devmon 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/devmon 2008-12-07 19:58:38 UTC (rev 95) @@ -4,6 +4,10 @@ # Hobbit network monitoring systems # Copyright (C) 2005-2006 Eric Schwimmer # +# $URL$ +# $Revision +# $Id$ +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or Property changes on: trunk/devmon ___________________________________________________________________ Added: svn:keywords + URL Revision Id Property changes on: trunk/docs/COPYING ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/docs/GRAPHING =================================================================== --- trunk/docs/GRAPHING 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/docs/GRAPHING 2008-12-07 19:58:38 UTC (rev 95) @@ -119,3 +119,5 @@ Finally, you need a graph definition for connects, such as the one shipped in extras/devmon-graph.cfg ---------------------------------- + +$Id$ Property changes on: trunk/docs/GRAPHING ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/docs/INSTALLATION =================================================================== --- trunk/docs/INSTALLATION 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/docs/INSTALLATION 2008-12-07 19:58:38 UTC (rev 95) @@ -283,4 +283,4 @@ For ideas on advanced multi-node cluster set up, please consult the docs/MULTINODE file. - +$Id$ Property changes on: trunk/docs/INSTALLATION ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/docs/MULTINODE =================================================================== --- trunk/docs/MULTINODE 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/docs/MULTINODE 2008-12-07 19:58:38 UTC (rev 95) @@ -156,3 +156,5 @@ but hopefully this little bit of information is enough to get you on the right track. For more information on MySQL and MySQL clustering, please visit the MySQL website, http://www.mysql.com. + +$Id$ Property changes on: trunk/docs/MULTINODE ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/docs/TEMPLATES =================================================================== --- trunk/docs/TEMPLATES 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/docs/TEMPLATES 2008-12-07 19:58:38 UTC (rev 95) @@ -987,3 +987,4 @@ all your machines can take up to twice the interval of your polling cycle, so be patient! +$Id$ Property changes on: trunk/docs/TEMPLATES ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/docs/USING =================================================================== --- trunk/docs/USING 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/docs/USING 2008-12-07 19:58:38 UTC (rev 95) @@ -357,3 +357,5 @@ For more in-depth information on templates, please see the docs/TEMPLATES file. + +$Id$ Property changes on: trunk/docs/USING ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/docs/using.html =================================================================== --- trunk/docs/using.html 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/docs/using.html 2008-12-07 19:58:38 UTC (rev 95) @@ -375,6 +375,6 @@ For more in-depth information on templates, please see the docs/TEMPLATES file. </pre> - +$Id$ </body> </html> Property changes on: trunk/docs/using.html ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/extras/devmon-rrd.pl =================================================================== --- trunk/extras/devmon-rrd.pl 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/extras/devmon-rrd.pl 2008-12-07 19:58:38 UTC (rev 95) @@ -1,4 +1,7 @@ #!/usr/bin/perl -w +# $URL$ +# $Revision +# $Id$ # See http://me.kaya.fr/howto_devmon_hobbit.txt use strict; Property changes on: trunk/extras/devmon-rrd.pl ___________________________________________________________________ Added: svn:keywords + URL Revision Id Property changes on: trunk/extras/do_devmon.c ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/modules/dm_config.pm =================================================================== --- trunk/modules/dm_config.pm 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/modules/dm_config.pm 2008-12-07 19:58:38 UTC (rev 95) @@ -10,6 +10,10 @@ # Copyright (C) 2005-2006 Eric Schwimmer # Copyright (C) 2007 Francois Lacroix # +# $URL$ +# $Revision +# $Id$ +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or Property changes on: trunk/modules/dm_config.pm ___________________________________________________________________ Added: svn:keywords + URL Revision Id Modified: trunk/modules/dm_msg.pm =================================================================== --- trunk/modules/dm_msg.pm 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/modules/dm_msg.pm 2008-12-07 19:58:38 UTC (rev 95) @@ -7,6 +7,10 @@ # Hobbit network monitoring systems # Copyright (C) 2005-2006 Eric Schwimmer # +# $URL$ +# $Revision +# $Id$ +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or Property changes on: trunk/modules/dm_msg.pm ___________________________________________________________________ Added: svn:keywords + URL Revision Id Modified: trunk/modules/dm_snmp.pm =================================================================== --- trunk/modules/dm_snmp.pm 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/modules/dm_snmp.pm 2008-12-07 19:58:38 UTC (rev 95) @@ -8,6 +8,10 @@ # Copyright (C) 2005-2006 Eric Schwimmer # Copyright (C) 2007 Francois Lacroix # +# $URL$ +# $Revision +# $Id$ +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or Property changes on: trunk/modules/dm_snmp.pm ___________________________________________________________________ Added: svn:keywords + URL Revision Id Modified: trunk/modules/dm_templates.pm =================================================================== --- trunk/modules/dm_templates.pm 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/modules/dm_templates.pm 2008-12-07 19:58:38 UTC (rev 95) @@ -9,6 +9,10 @@ # Copyright (C) 2005-2006 Eric Schwimmer # Copyright (C) 2007 Francois Lacroix # +# $URL$ +# $Revision +# $Id$ +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or Property changes on: trunk/modules/dm_templates.pm ___________________________________________________________________ Added: svn:keywords + URL Revision Id Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2008-12-06 11:33:51 UTC (rev 94) +++ trunk/modules/dm_tests.pm 2008-12-07 19:58:38 UTC (rev 95) @@ -8,6 +8,10 @@ # Copyright (C) 2005-2006 Eric Schwimmer # Copyright (C) 2007 Francois Lacroix # +# $URL$ +# $Revision +# $Id$ +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or Property changes on: trunk/modules/dm_tests.pm ___________________________________________________________________ Added: svn:keywords + URL Revision Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2008-12-31 12:56:20
|
Revision: 105 http://devmon.svn.sourceforge.net/devmon/?rev=105&view=rev Author: buchanmilne Date: 2008-12-31 12:56:15 +0000 (Wed, 31 Dec 2008) Log Message: ----------- Add INDEX transform Modified Paths: -------------- trunk/docs/TEMPLATES trunk/modules/dm_templates.pm trunk/modules/dm_tests.pm Modified: trunk/docs/TEMPLATES =================================================================== --- trunk/docs/TEMPLATES 2008-12-08 22:04:34 UTC (rev 104) +++ trunk/docs/TEMPLATES 2008-12-31 12:56:15 UTC (rev 105) @@ -396,6 +396,29 @@ seconds provided as input to the transform. + 'INDEX' transform: + This transform allows you to access the index part of a + numerical OID in a repeater OID. + + For example, in the cdpCache table for the Cisco CDP MIB, + walking the cdpCacheDevicePort OID will return values such as: + + CISCO-CDP-MIB::cdpCacheDevicePort.4.3 = STRING: GigabitEthernet4/41 + CISCO-CDP-MIB::cdpCacheDevicePort.9.1 = STRING: GigabitEthernet2/16 + CISCO-CDP-MIB::cdpCacheDevicePort.12.14 = STRING: Serial2/2 + + The value is the interface on the remote side, and there is no + OID for the interface on the local side. To get the interface + on the local side, you must use the last value in the index + (e.g. 3 for GigabitEthernet4/41) and look in the ifTable: + + IF-MIB::ifName.3 = STRING: Fa0/0 + + The index transform allows you to get the index value (4.3 + in this case) as an OID value. Any operations you need to + do on the index value should be possible with existing + transforms. + 'MATH' transform: The MATH transform performs a mathematical expression defined Modified: trunk/modules/dm_templates.pm =================================================================== --- trunk/modules/dm_templates.pm 2008-12-08 22:04:34 UTC (rev 104) +++ trunk/modules/dm_templates.pm 2008-12-31 12:56:15 UTC (rev 105) @@ -651,6 +651,14 @@ last CASE; }; + $func_type eq 'index' and do { + $temp =~ s/\s*\{\s*\S+?\s*\}|\s*,\s*//g; + do_log("INDEX transform uses only a single oid at " . + "$trans_file, line $l_num", 0) + and next LINE if $temp ne ''; + last CASE; + }; + do_log("Unknown function '$func_type' at $trans_file, line $l_num", 0); next LINE; } Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2008-12-08 22:04:34 UTC (rev 104) +++ trunk/modules/dm_tests.pm 2008-12-31 12:56:15 UTC (rev 105) @@ -1593,8 +1593,67 @@ } + # Return index values ###################################################### + # In some cases, the index value in a repeating OID is useful data to have + # Examples of this are the index in the cdp table, which refer to the + # ifIndex (the only way to get the near side interface name), another + # example is some load balancer MIBs which include vserver/real server + # detail only in the index + # This is more or less the inverse of the chain operator + sub trans_index { + my ($device, $oids, $oid, $thr) = @_; + my $oid_h = \%{$oids->{$oid}}; + # Extract our parent oids from the expression, first + my ($src_oid) = $oid_h->{'trans_data'} =~ /\{(.+?)}/g; + validate_deps($device, $oids, $oid, [$src_oid], '.+') ; + # Validate our dependencies, have to do them seperately + # validate_deps($device, $oids, 'tmp', [$trg_oid]) or return; + # validate_deps($device, $oids, $oid, [$src_oid], '^\.?(\d+\.)?\d+$') + # or return; + do_log("Transforming $src_oid to $oid via index transform",0) if $g{'debug'}; + + my $src_h = \%{$oids->{$src_oid}}; + + # This transform should probably only work for repeater sources + if(!$src_h->{'repeat'}) { + do_log("Trying to index a non-repeater source on $device ($@)", 0); + return; + } + + else { + # Tag the target as a repeater + $oid_h->{'repeat'} = 2; + for my $leaf (keys %{$src_h->{'val'}}) { + + # Skip if our source oid is freaky-deaky + next if $oid_h->{'error'}{$leaf}; + + # Our oid sub leaf + # my $oid_idx = $src_h->{'val'}{$leaf}; + + if(!defined $leaf) { + $oid_h->{'val'}{$leaf} = 'Target val missing - index'; + $oid_h->{'time'}{$leaf} = time; + $oid_h->{'color'}{$leaf} = 'yellow'; + $oid_h->{'error'}{$leaf} = 1; + next; + } + + $oid_h->{'val'}{$leaf} = $leaf; + $oid_h->{'time'}{$leaf} = $src_h->{'time'}{$leaf}; + $oid_h->{'color'}{$leaf} = $src_h->{'color'}{$leaf}; + $oid_h->{'error'}{$leaf} = $src_h->{'error'}{$leaf}; + } + + # Apply thresholds + apply_thresh_rep($oids, $thr, $oid); + } + + } + + # Create our outbound message ############################################## sub render_msg { my ($device, $tmpl, $test, $oids) = @_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2009-01-23 15:36:51
|
Revision: 123 http://devmon.svn.sourceforge.net/devmon/?rev=123&view=rev Author: buchanmilne Date: 2009-01-23 15:36:41 +0000 (Fri, 23 Jan 2009) Log Message: ----------- Version 0.3.1-beta1 Modified Paths: -------------- trunk/CHANGELOG trunk/devmon Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2009-01-23 10:16:06 UTC (rev 122) +++ trunk/CHANGELOG 2009-01-23 15:36:41 UTC (rev 123) @@ -2,6 +2,41 @@ Devmon changelog. Contributors of specific features/patches are listed in parenthesis next to the respective entry. +Devmon v0.3.1-beta1 :: Released 2009-01-23 + Changes since 0.3.0 + - Fix loading non-standard ports from the config file + - Fix segfault in hobbitd_rrd caused by do_devmon.c and data with spaces in + repeater names + - Fix multiple custom threshholds and exceptions on the same test + - Send messages to BB/Hobbit/Xymon in debug mode (--debug) + For the previous behaviour (messages printed to stdout in debug + and not sent to BB/Hobbit/Xymon), use '--debug -p' + - Improve error handling, by opening log file immediately after forking, and + returning non-zero exit codes when exiting due to error (e.g. log_fatal) + - Fix thresh usage in options example in "USING" documentation + - Add INDEX transform + - Ensure repeaters created by CHAIN transform are tagged as such (so they can + be primary OID) + - Close and re-open log files on HUP + - Init script changes + -Merge Mandriva init script changes: + -run as non-root (optional, set RUNASUSER= in /etc/sysconfig/devmon) + -use reload (or readbbhosts) argument to run --readbbhosts + -fix return codes + -Use better killproc (internal_killproc) on platforms without a killproc that + takes a pid file option (makes stopping devmon more reliable) + -Add a rotate function/argument + - Strip spaces off names of repeaters before creating rrd section of message + - Set a timeout on the socket to hobbit (hardcoded to 10s for now) + - Use Hobbit/BB environment variables if present + - Adjust init script to run devmon under Hobbit or BB environment + - Honour Hobbit BBLOCATION / NET tag + - Handle line continuations in bb-hosts file (W.J.M. Nelis) + - Support BBDATEFORMAT (should provide better dates in Hobbit/BB status messages + by default if BBDATEFORMAT is set in hobbitserver.cfg) (W.J.M Nelis) + - Add new STATUS: key for message file, which allows extending the first + line of the status message + - Filters in hobbitdboard are regex's, anchor the conn text (Simeon Berkley) Devmon v0.3.0 :: Released 2008-04-03 Changes since 0.3.0-rc1 Modified: trunk/devmon =================================================================== --- trunk/devmon 2009-01-23 10:16:06 UTC (rev 122) +++ trunk/devmon 2009-01-23 15:36:41 UTC (rev 123) @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -our $VERSION = '0.3.0'; +our $VERSION = '0.3.1-beta1'; # Devmon: An SNMP data collecteor & page generator for the BigBrother & # Hobbit network monitoring systems # Copyright (C) 2005-2006 Eric Schwimmer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dba...@us...> - 2009-09-11 07:15:59
|
Revision: 146 http://devmon.svn.sourceforge.net/devmon/?rev=146&view=rev Author: dbaldwin Date: 2009-09-11 07:15:51 +0000 (Fri, 11 Sep 2009) Log Message: ----------- dm_templates.pm - add more MATH operators (fix ^) and add to TEMPLATES doc Modified Paths: -------------- trunk/docs/TEMPLATES trunk/modules/dm_templates.pm Modified: trunk/docs/TEMPLATES =================================================================== --- trunk/docs/TEMPLATES 2009-09-11 07:06:33 UTC (rev 145) +++ trunk/docs/TEMPLATES 2009-09-11 07:15:51 UTC (rev 146) @@ -429,6 +429,10 @@ 'x' (Multiplication) '/' (Division) '^' (Exponentiation) + '%' (Modulo or Remainder) + '&' (bitwise AND) + '|' (bitwise OR) + ' . ' (string concatenation - note white space each side) '(' and ')' (Expression nesting) This transform is not whitespace sensitive, so both: Modified: trunk/modules/dm_templates.pm =================================================================== --- trunk/modules/dm_templates.pm 2009-09-11 07:06:33 UTC (rev 145) +++ trunk/modules/dm_templates.pm 2009-09-11 07:15:51 UTC (rev 146) @@ -534,7 +534,7 @@ $func_type eq 'math' and do { $temp =~ s/:\s*\d+\s*$//; - $temp =~ s/\{\s*\S+?\s*\}|\s|x|\+|\/|-|^|\d+(\.\d*)?|\(|\)\s*//g; + $temp =~ s/\{\s*\S+?\s*\}|\s|\s\.\s|x|\+|\/|-|\^|%|\||&|\d+(\.\d*)?|\(|\)\s*//g; do_log("MATH transform uses only math/numeric symbols and an " . "optional precision number at $trans_file, line $l_num", 0) and next LINE if $temp ne ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <buc...@us...> - 2011-01-22 21:24:52
|
Revision: 195 http://devmon.svn.sourceforge.net/devmon/?rev=195&view=rev Author: buchanmilne Date: 2011-01-22 21:24:45 +0000 (Sat, 22 Jan 2011) Log Message: ----------- Only respect ' x ' as multiplication, not 'x', otherwise oids with x in the name get mangled Modified Paths: -------------- trunk/docs/TEMPLATES trunk/modules/dm_tests.pm trunk/templates/netapp-misc/volume/transforms Modified: trunk/docs/TEMPLATES =================================================================== --- trunk/docs/TEMPLATES 2011-01-21 14:58:23 UTC (rev 194) +++ trunk/docs/TEMPLATES 2011-01-22 21:24:45 UTC (rev 195) @@ -440,12 +440,20 @@ ' . ' (string concatenation - note white space each side) '(' and ')' (Expression nesting) - This transform is not whitespace sensitive, so both: + This transform is not whitespace sensitive, except in the case of x, so both: {sysUpTime} / 100 and {sysUpTime}/100 ...would be accepted, and are functionally equivalent. + + However: + {ifInOps} x 8 + will work, while: + {ifInOps}x8 + will not. This is to avoid problems with oid names containing the character + 'x'. + The mathematical expressions you can perform can be quite complex, such as: ((({sysUpTime}/100) ^ 2 ) x 15) + 10 Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2011-01-21 14:58:23 UTC (rev 194) +++ trunk/modules/dm_tests.pm 2011-01-22 21:24:45 UTC (rev 195) @@ -458,7 +458,7 @@ my $print_mask = '%.' . $precision . 'f'; # Convert our math symbols to their perl equivalents - $expr =~ s/x/\*/g; # Multiplication + $expr =~ s/ x / \* /g; # Multiplication $expr =~ s/\^/**/g; # Exponentiation # Extract all our our parent oids from the expression, first Modified: trunk/templates/netapp-misc/volume/transforms =================================================================== --- trunk/templates/netapp-misc/volume/transforms 2011-01-21 14:58:23 UTC (rev 194) +++ trunk/templates/netapp-misc/volume/transforms 2011-01-22 21:24:45 UTC (rev 195) @@ -1,3 +1,3 @@ -dfPercent : MATH : {dfKBytesUsed}/{dfKBytesTotal}x100 +dfPercent : MATH : {dfKBytesUsed}/{dfKBytesTotal} x 100 dfGBytesTotal : MATH : {dfKBytesTotal} / 1048576 dfGBytesUsed : MATH : {dfKBytesUsed} / 1048576 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2011-04-04 11:26:08
|
Revision: 228 http://devmon.svn.sourceforge.net/devmon/?rev=228&view=rev Author: buchanmilne Date: 2011-04-04 11:26:02 +0000 (Mon, 04 Apr 2011) Log Message: ----------- Allow '*' as multiplication operator Modified Paths: -------------- trunk/docs/TEMPLATES trunk/modules/dm_templates.pm Modified: trunk/docs/TEMPLATES =================================================================== --- trunk/docs/TEMPLATES 2011-04-04 10:59:18 UTC (rev 227) +++ trunk/docs/TEMPLATES 2011-04-04 11:26:02 UTC (rev 228) @@ -431,7 +431,8 @@ operators: '+' (Addition) '-' (Subtraction) - ' x ' (Multiplication - note white space on each side) + '*' (Muliplication) + ' x ' (Multiplication - note white space on each side) (deprecated) '/' (Division) '^' (Exponentiation) '%' (Modulo or Remainder) @@ -440,7 +441,7 @@ ' . ' (string concatenation - note white space each side) '(' and ')' (Expression nesting) - This transform is not whitespace sensitive, except in the case of ' x ' and ' . ' , so both: + This transform is not whitespace sensitive, except in the case of ' x ' and ' . ' , so both: {sysUpTime} / 100 and {sysUpTime}/100 @@ -452,7 +453,8 @@ will work, while: {ifInOps}x8 will not. This is to avoid problems with oid names containing the character - 'x'. + 'x'. New templates should rather use the '*' operator to avoid problems, e.g.: + {ifInOps}*8 The mathematical expressions you can perform can be quite complex, such as: Modified: trunk/modules/dm_templates.pm =================================================================== --- trunk/modules/dm_templates.pm 2011-04-04 10:59:18 UTC (rev 227) +++ trunk/modules/dm_templates.pm 2011-04-04 11:26:02 UTC (rev 228) @@ -544,7 +544,7 @@ $func_type eq 'math' and do { $temp =~ s/:\s*\d+\s*$//; - $temp =~ s/\{\s*\S+?\s*\}|\s\.\s|\sx\s|\+|\/|-|\^|%|\||&|\d+(\.\d*)?|\(|\)\s*//g; + $temp =~ s/\{\s*\S+?\s*\}|\s\.\s|\sx\s|\*|\+|\/|-|\^|%|\||&|\d+(\.\d*)?|\(|\)\s*//g; do_log("MATH transform uses only math/numeric symbols and an " . "optional precision number at $trans_file, line $l_num", 0) and next LINE if $temp !~ /^\s*$/; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2012-12-21 08:55:26
|
Revision: 238 http://devmon.svn.sourceforge.net/devmon/?rev=238&view=rev Author: buchanmilne Date: 2012-12-21 08:55:17 +0000 (Fri, 21 Dec 2012) Log Message: ----------- Add new MATCH transform Modified Paths: -------------- trunk/docs/TEMPLATES trunk/modules/dm_templates.pm trunk/modules/dm_tests.pm Modified: trunk/docs/TEMPLATES =================================================================== --- trunk/docs/TEMPLATES 2012-12-21 06:45:18 UTC (rev 237) +++ trunk/docs/TEMPLATES 2012-12-21 08:55:17 UTC (rev 238) @@ -423,7 +423,53 @@ do on the index value should be possible with existing transforms. + 'MATCH' transform: + In some badly designed MIBs multiple types of information are + presented in a single table with two columns (branches), often + in just a name, value format. This transform makes it possible + to split such a combined table out into separate tables, or to + reformat the table so that it has multiple columns. + + For example, the MIB for the TRIDIUM building management system + has a table with outputName and outputValue, data returned looks + as follows: + + TRIDIUM-MIB::outputName.1 = STRING: "I_Inc4_Freq" + TRIDIUM-MIB::outputName.2 = STRING: "I_Inc4_VaN" + TRIDIUM-MIB::outputName.3 = STRING: "I_Inc4_VbN" + TRIDIUM-MIB::outputName.4 = STRING: "I_Inc4_VcN" + ... + TRIDIUM-MIB::outputValue.1 = STRING: "50.06" + TRIDIUM-MIB::outputValue.2 = STRING: "232.91" + TRIDIUM-MIB::outputValue.3 = STRING: "233.39" + TRIDIUM-MIB::outputValue.4 = STRING: "233.98" + + To split the frequences out as a separate repeater, use: + outputFreqRow : MATCH : {outputName} /.*_Freq$/ + outputVaRow : MATCH : {outputName} /.*_VaN$/ + ... + + outputFreqRow will now contain the indexes of outputName that matched + the regular expression, e.g. 1,5,9 etc. , outputVaRow will contain + 2,6,10. To construct a table, use the chain transform to create + repeaters using the matched indexes: + outputFreq : CHAIN : {outputFreqRow} {outputValue} + outputVa : CHAIN : {outputVaRow} {outputValue} + ... + + To create the primary repeater for a table, we do the same on outputName: + IncomerRowName : CHAIN : {outputFreqRow} {outputName} + + In this case, it is preferable to clean up the outputFreq for display: + IncomerName : REGSUB : {IncomerRowName} /(.*)_Freq/$1/ + + A table created as follows: + Incomer|Frequency (Hz)|Voltage A|Voltage B|Voltage C + + Would now contain in its first row: + I_Inc4|50.06|232.91|233.39|233.98 + 'MATH' transform: The MATH transform performs a mathematical expression defined Modified: trunk/modules/dm_templates.pm =================================================================== --- trunk/modules/dm_templates.pm 2012-12-21 06:45:18 UTC (rev 237) +++ trunk/modules/dm_templates.pm 2012-12-21 08:55:17 UTC (rev 238) @@ -542,6 +542,14 @@ last CASE; }; + $func_type eq 'match' and do { + $temp =~ s/^\{\s*\S+?\s*\}\s*\/.+\/\s*$//g; + do_log("MATCH transform should be a perl regex match at " . + "$trans_file, line $l_num", 0) + and next LINE if $temp ne ''; + last CASE; + }; + $func_type eq 'math' and do { $temp =~ s/:\s*\d+\s*$//; $temp =~ s/\{\s*\S+?\s*\}|\s\.\s|\s+x\s+|\*|\+|\/|-|\^|%|\||&|\d+(\.\d*)?|\(|\)//g; Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2012-12-21 06:45:18 UTC (rev 237) +++ trunk/modules/dm_tests.pm 2012-12-21 08:55:17 UTC (rev 238) @@ -1619,6 +1619,9 @@ my $oid_h = \%{$oids->{$oid}}; # Extract our parent oids from the expression, first my ($src_oid) = $oid_h->{'trans_data'} =~ /\{(.+?)\}/g; + my ($oidregex) = $oid_h->{'trans_data'} =~ s/\{(.+?)\}//g; + $oidregex =~ s/^\s*//; + $oidregex =~ s/\s*$//; validate_deps($device, $oids, $oid, [$src_oid], '.+') ; # Validate our dependencies, have to do them seperately @@ -1643,6 +1646,24 @@ # Skip if our source oid is freaky-deaky next if $oid_h->{'error'}{$leaf}; + # If we had a regex, skip this index if the value doesnt match + if ( $oidregex ne '' ) { + my $res; + my $val = $src_h->{'val'}{$leaf}; + do_log("Testing value $val from against $oidregex",0) if $g{'debug'}; + my $result = eval "\$res = \$val =~ m$oidregex"; + if($@) { + do_log("Failed eval for REGSUB transform on leaf $leaf of " . + "$oid on $device ($@)", 0); + $oid_h->{'val'}{$leaf} = 'Failed eval'; + $oid_h->{'time'}{$leaf} = time; + $oid_h->{'color'}{$leaf} = 'yellow'; + $oid_h->{'error'}{$leaf} = 1; + next; + } + next if $res; + } + # Our oid sub leaf # my $oid_idx = $src_h->{'val'}{$leaf}; @@ -1666,7 +1687,85 @@ } + # Extract names and values from simple tables ############################# + # Some MIBs just return a table of names and values, with rows that have + # different data, types, meanings, units etc. + # This operator allows the creation of new columns for rows where the name + # column matches the provided regex + sub trans_match { + my ($device, $oids, $oid, $thr) = @_; + my $oid_h = \%{$oids->{$oid}}; + # Extract our parent oids from the expression, first + my $trans_data = $oid_h->{'trans_data'}; + my ($src_oid, $expr) = ($1,$2) + if $trans_data =~ /^\{\s*(\S+?)\s*\}\s*(\/.+\/)\s*$/; + validate_deps($device, $oids, $oid, [$src_oid], '.+') ; + + # Validate our dependencies, have to do them seperately + # validate_deps($device, $oids, 'tmp', [$trg_oid]) or return; + # validate_deps($device, $oids, $oid, [$src_oid], '^\.?(\d+\.)?\d+$') + # or return; + do_log("Transforming $src_oid to $oid via match transform matching $expr",0) if $g{'debug'}; + + my $src_h = \%{$oids->{$src_oid}}; + + # This transform should probably only work for repeater sources + if(!$src_h->{'repeat'}) { + do_log("Trying to index a non-repeater source on $device ($@)", 0); + return; + } + + else { + # Tag the target as a repeater + $oid_h->{'repeat'} = 2; + my $idx = 0; + for my $leaf (sort { $a<=>$b} keys %{$src_h->{'val'}}) { + + # Skip if our source oid is freaky-deaky + next if $oid_h->{'error'}{$leaf}; + + my $res; + my $val = $src_h->{'val'}{$leaf}; + #do_log("Testing value $val from against $expr",0) if $g{'debug'}; + my $result = eval "\$res = \$val =~ m$expr"; + if($@) { + do_log("Failed eval for EXTRACT transform on leaf $leaf of " . + "$oid on $device ($@)", 0); + $oid_h->{'val'}{$leaf} = 'Failed eval'; + $oid_h->{'time'}{$leaf} = time; + $oid_h->{'color'}{$leaf} = 'yellow'; + $oid_h->{'error'}{$leaf} = 1; + next; + } + do_log("$val matched $expr, assigning new $idx from old row $leaf",0) if $g{'debug'} and $res; + next unless $res; + + # Our oid sub leaf + # my $oid_idx = $src_h->{'val'}{$leaf}; + + if(!defined $leaf) { + $oid_h->{'val'}{$leaf} = 'Target val missing - index'; + $oid_h->{'time'}{$leaf} = time; + $oid_h->{'color'}{$leaf} = 'yellow'; + $oid_h->{'error'}{$leaf} = 1; + next; + } + + $oid_h->{'val'}{$idx} = $leaf; + $oid_h->{'time'}{$idx} = $src_h->{'time'}{$leaf}; + $oid_h->{'color'}{$idx} = $src_h->{'color'}{$leaf}; + $oid_h->{'error'}{$idx} = $src_h->{'error'}{$leaf}; + $idx++; + } + + # Apply thresholds + apply_thresh_rep($oids, $thr, $oid); + } + + } + + # Create our outbound message ############################################## sub render_msg { my ($device, $tmpl, $test, $oids) = @_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2016-03-11 11:45:46
|
Revision: 254 http://sourceforge.net/p/devmon/code/254 Author: buchanmilne Date: 2016-03-11 11:45:44 +0000 (Fri, 11 Mar 2016) Log Message: ----------- Support Xymon 4.3 by default without requiring compat variables Modified Paths: -------------- trunk/extras/devmon.initd.redhat trunk/modules/dm_config.pm Modified: trunk/extras/devmon.initd.redhat =================================================================== --- trunk/extras/devmon.initd.redhat 2016-01-08 10:18:59 UTC (rev 253) +++ trunk/extras/devmon.initd.redhat 2016-03-11 11:45:44 UTC (rev 254) @@ -26,7 +26,11 @@ [ -e /etc/sysconfig/devmon ] && . /etc/sysconfig/devmon prog="/usr/local/devmon/devmon" -if [ -e ~hobbit/client/bin/bbcmd ] +if [ -e ~xymon/server/bin/xymoncmd ] +then prog="~xymon/server/bin/xymoncmd $prog" +elif [ -e ~xymon/client/bin/xymoncmd ] +then prog="~xymon/client/bin/xymoncmd $prog" +elif [ -e ~hobbit/client/bin/bbcmd ] then prog="~hobbit/client/bin/bbcmd $prog" elif [ -e ~xymon/client/bin/bbcmd ] then prog="~xymon/client/bin/bbcmd $prog" Modified: trunk/modules/dm_config.pm =================================================================== --- trunk/modules/dm_config.pm 2016-01-08 10:18:59 UTC (rev 253) +++ trunk/modules/dm_config.pm 2016-03-11 11:45:44 UTC (rev 254) @@ -122,11 +122,11 @@ 'regex' => 'yes|no', 'set' => 0, 'case' => 0 }, - 'bbhosts' => { 'default' => (defined $ENV{'BBHOSTS'} and $ENV{'BBHOSTS'} ne '') ? $ENV{'BBHOSTS'} : '/home/hobbit/server/etc/bb-hosts', + 'bbhosts' => { 'default' => (defined $ENV{'HOSTSCFG'} and $ENV{'HOSTSCFG'} ne '') ? $ENV{'HOSTSCFG'} :(defined $ENV{'BBHOSTS'} and $ENV{'BBHOSTS'} ne '') ? $ENV{'BBHOSTS'} : '/home/hobbit/server/etc/bb-hosts', 'regex' => '.+', 'set' => 0, 'case' => 1 }, - 'bblocation' => { 'default' => (defined $ENV{'BBLOCATION'} and $ENV{'BBLOCATION'} ne '') ? $ENV{'BBLOCATION'} : '', + 'bblocation' => { 'default' => (defined $ENV{'XYMONNETWORK'} and $ENV{'XYMONNETWORK'} ne '') ? $ENV{'XYMONNETWORK'} : (defined $ENV{'BBLOCATION'} and $ENV{'BBLOCATION'} ne '') ? $ENV{'BBLOCATION'} : '', 'regex' => '\w+', 'set' => 0, 'case' => 1 }, @@ -174,15 +174,15 @@ 'regex' => 'bb|hobbit|xymon', 'set' => 0, 'case' => 0 }, - 'dispserv' => { 'default' => (defined $ENV{'BBDISP'} and $ENV{BBDISP} ne '') ? $ENV{'BBDISP'} : 'localhost', + 'dispserv' => { 'default' => (defined $ENV{'XYMSRV'} and $ENV{'XYMSRV'} ne '' ) ? $ENV{'XYMSRV'} : (defined $ENV{'BBDISP'} and $ENV{BBDISP} ne '') ? $ENV{'BBDISP'} : 'localhost', 'regex' => '\S+', 'set' => 0, 'case' => 0 }, - 'dispport' => { 'default' => (defined $ENV{'BBPORT'} and $ENV{'BBPORT'} ne '') ? $ENV{'BBPORT'} : 1984, + 'dispport' => { 'default' => (defined $ENV{'XYMONDPORT'} and $ENV{'XYMONDPORT'} ne '') ? $ENV{'XYMONDPORT'} : (defined $ENV{'BBPORT'} and $ENV{'BBPORT'} ne '') ? $ENV{'BBPORT'} : 1984, 'regex' => '\d+', 'set' => 0, 'case' => 0 }, - 'bbdateformat' => { 'default' => (defined $ENV{'BBDATEFORMAT'} and $ENV{'BBDATEFORMAT'} ne '') ? $ENV{'BBDATEFORMAT'} : '', + 'bbdateformat' => { 'default' => (defined $ENV{'XYMONDATEFORMAT'} and $ENV{'XYMONDATEFORMAT'} ne '') ? $ENV{'XYMONDATEFORMAT'} : (defined $ENV{'BBDATEFORMAT'} and $ENV{'BBDATEFORMAT'} ne '') ? $ENV{'BBDATEFORMAT'} : '', 'regex' => '.+', 'set' => 0, 'case' => 1 }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2009-01-09 15:42:48
|
Revision: 114 http://devmon.svn.sourceforge.net/devmon/?rev=114&view=rev Author: buchanmilne Date: 2009-01-09 15:42:43 +0000 (Fri, 09 Jan 2009) Log Message: ----------- Use Hobbit/BB environment variables if present Adjust init script to run devmon under Hobbit or BB environment Modified Paths: -------------- trunk/extras/devmon.initd.redhat trunk/modules/dm_config.pm Modified: trunk/extras/devmon.initd.redhat =================================================================== --- trunk/extras/devmon.initd.redhat 2009-01-09 14:34:00 UTC (rev 113) +++ trunk/extras/devmon.initd.redhat 2009-01-09 15:42:43 UTC (rev 114) @@ -18,6 +18,13 @@ [ -e /etc/sysconfig/devmon ] && . /etc/sysconfig/devmon prog="/usr/local/devmon/devmon" +if [ -e ~hobbit/client/bin/bbcmd ] +then prog="~hobbit/client/bin/bbcmd $prog" +elif [ -e ~xymon/client/bin/bbcmd ] +then prog="~xymon/client/bin/bbcmd $prog" +elif [ -e ~bb/etc/bbdef.sh ] +then . ~bb/etc/bbdef.sh +fi start() { echo -n $"Starting Devmon: " @@ -143,7 +150,7 @@ RETVAL=$? ;; reload|readbbhosts) - $prog --readbbhosts + sh -c "$prog $ARGS --readbbhosts" RETVAL=$? ;; rotate) Modified: trunk/modules/dm_config.pm =================================================================== --- trunk/modules/dm_config.pm 2009-01-09 14:34:00 UTC (rev 113) +++ trunk/modules/dm_config.pm 2009-01-09 15:42:43 UTC (rev 114) @@ -54,8 +54,9 @@ 'active' => '', 'pidfile' => '', 'logfile' => '', - 'bbosts' => '', + 'bbhosts' => '', 'bbtag' => '', + 'bblocation' => '', 'nodename' => '', 'log' => '', @@ -121,7 +122,7 @@ 'regex' => 'yes|no', 'set' => 0, 'case' => 0 }, - 'bbhosts' => { 'default' => '/home/hobbit/server/etc/bb-hosts', + 'bbhosts' => { 'default' => ($ENV{'BBHOSTS'} ne '') ? $ENV{'BBHOSTS'} : '/home/hobbit/server/etc/bb-hosts', 'regex' => '.+', 'set' => 0, 'case' => 1 }, @@ -169,11 +170,11 @@ 'regex' => 'bb|hobbit', 'set' => 0, 'case' => 0 }, - 'dispserv' => { 'default' => 'localhost', + 'dispserv' => { 'default' => ($ENV{BBDISP} ne '') ? $ENV{'BBDISP'} : 'localhost', 'regex' => '\S+', 'set' => 0, 'case' => 0 }, - 'dispport' => { 'default' => 1984, + 'dispport' => { 'default' => ($ENV{'BBPORT'} ne '') ? $ENV{'BBPORT'} : 1984, 'regex' => '\d+', 'set' => 0, 'case' => 0 }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2009-01-22 16:35:27
|
Revision: 118 http://devmon.svn.sourceforge.net/devmon/?rev=118&view=rev Author: buchanmilne Date: 2009-01-22 16:35:15 +0000 (Thu, 22 Jan 2009) Log Message: ----------- Support BBDATEFORMAT (should provide better dates in Hobbit/BB status messages by default), from W.J.M Nelis Modified Paths: -------------- trunk/devmon.cfg trunk/modules/dm_config.pm trunk/modules/dm_tests.pm Modified: trunk/devmon.cfg =================================================================== --- trunk/devmon.cfg 2009-01-22 16:11:37 UTC (rev 117) +++ trunk/devmon.cfg 2009-01-22 16:35:15 UTC (rev 118) @@ -101,6 +101,11 @@ # [DEFAULT: 1984 or BBPORT environment variable if set] #DISPPORT=1984 +# BBDATEFORMAT: This is the format string that devmon should use in +# date/time strings sent to Hobbit/BB in the status message. +# [DEFAULT: '', or the value of the BBDATEFORMAT enviroment variable if set] +#BBDATEFORMAT= + # MSGSIZE: Sets the max message size in bytes of the datagrams that Devmon # sends to the bb display server [DEFAULT: 8096] MSGSIZE=8096 Modified: trunk/modules/dm_config.pm =================================================================== --- trunk/modules/dm_config.pm 2009-01-22 16:11:37 UTC (rev 117) +++ trunk/modules/dm_config.pm 2009-01-22 16:35:15 UTC (rev 118) @@ -182,6 +182,10 @@ 'regex' => '\d+', 'set' => 0, 'case' => 0 }, + 'bbdateformat' => { 'default' => ($ENV{'BBDATEFORMAT'} ne '') ? $ENV{'BBDATEFORMAT'} : '', + 'regex' => '.+', + 'set' => 0, + 'case' => 1 }, 'msgsize' => { 'default' => 8096, 'regex' => '\d+', 'set' => 0, Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2009-01-22 16:11:37 UTC (rev 117) +++ trunk/modules/dm_tests.pm 2009-01-22 16:35:15 UTC (rev 118) @@ -23,6 +23,7 @@ use strict; use dm_config; use Math::BigInt::Calc; + use POSIX qw/ strftime / ; # Our global variable hash use vars qw(%g); @@ -1667,10 +1668,13 @@ do_log("DEBUG TEST: Rendering $test message for $device") if $g{'debug'}; + # Build readable timestamp + my $now= $g{'bbdateformat'} ? strftime($g{'bbdateformat'},localtime) : scalar(localtime) ; + # No message template? if(!defined $msg_template) { - return "status $bb_host.$test clear " . (scalar localtime) . + return "status $bb_host.$test clear $now" . "\n\nCould not locate template for this device.\n" . "Please check devmon logs.\n\n" . "Devmon version $g{'version'} running on $g{'nodename'}\n"; @@ -1679,7 +1683,7 @@ # 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') { - return "status $bb_host.$test clear " . (scalar localtime) . + return "status $bb_host.$test clear $now" . "\n\nHobbit reports this device is unreachable.\n" . "Suspending this test until reachability is restored\n\n" . "Devmon version $g{'version'} running on $g{'nodename'}\n"; @@ -2140,7 +2144,7 @@ $msg = join "\n", ($errors, $msg) if $errors ne ''; # Now add our header so bb/hobbit can determine the page color - $msg = "status $bb_host.$test $worst_color " . (scalar localtime) . + $msg = "status $bb_host.$test $worst_color $now" . "\n\n$msg"; # Add our oh-so-stylish devmon footer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <dba...@us...> - 2009-11-02 06:51:27
|
Revision: 158 http://devmon.svn.sourceforge.net/devmon/?rev=158&view=rev Author: dbaldwin Date: 2009-11-02 06:50:45 +0000 (Mon, 02 Nov 2009) Log Message: ----------- Add option on DEVMON tag line to specify custom IP address using ip() Very handy for devices with multiple interfaces which choose a different source IP address for their SNMP reply packets than the primary IP in bb-hosts definitions. e.g. (from bb-hosts file) 10.0.0.11 multihomehost # conn=worst,10.0.0.12 DEVMON:ip(10.0.0.12) Modified Paths: -------------- trunk/docs/USING trunk/modules/dm_config.pm Modified: trunk/docs/USING =================================================================== --- trunk/docs/USING 2009-10-27 07:32:42 UTC (rev 157) +++ trunk/docs/USING 2009-11-02 06:50:45 UTC (rev 158) @@ -45,6 +45,10 @@ other than the ones specified in the SNMPCIDS variable in the devmon.cfg file + ip() : Define a custom IP address for this device + (other than the primary address in bb-hosts - + useful for hosts with multiple interfaces) + port() : Define a custom UDP SNMP port for this device (other than the default port of 161) @@ -107,6 +111,18 @@ + ip() + + If, for some reason, the device you are attempting to poll does + not answer on the primary IP address in bb-hosts, you can define + a custom IP address to query the device with - for UDP protocols + like SNMP the source address in the reply packet may not match + the address in the bb-hosts file: + +10.0.0.10 multihomehost # conn=worst,10.0.0.11 DEVMON:ip(10.0.0.11) + + + port() If, for some reason, the device you are attempting to poll does Modified: trunk/modules/dm_config.pm =================================================================== --- trunk/modules/dm_config.pm 2009-10-27 07:32:42 UTC (rev 157) +++ trunk/modules/dm_config.pm 2009-11-02 06:50:45 UTC (rev 158) @@ -1329,6 +1329,11 @@ $bb_hosts{$host}{'cid'} = $1; $custom_cids = 1; } + + # See if we have a custom IP + if($options =~ s/(?:,|^)ip\((\d+\.\d+\.\d+\.\d+)\),?//) { + $ip = $1; + } # See if we have a custom port if($options =~ s/(?:,|^)port\((\d+?)\),?//) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2014-11-27 13:19:10
|
Revision: 246 http://sourceforge.net/p/devmon/code/246 Author: buchanmilne Date: 2014-11-27 13:19:01 +0000 (Thu, 27 Nov 2014) Log Message: ----------- Add a new 'PACK' transform, which does exactly the inverse of the UNPACK transform Modified Paths: -------------- trunk/docs/TEMPLATES trunk/modules/dm_templates.pm trunk/modules/dm_tests.pm Modified: trunk/docs/TEMPLATES =================================================================== --- trunk/docs/TEMPLATES 2014-11-27 12:53:57 UTC (rev 245) +++ trunk/docs/TEMPLATES 2014-11-27 13:19:01 UTC (rev 246) @@ -522,7 +522,11 @@ (i.e. 300549.3420). The default value is 2 precision characters. To remove the decimal characters alltogether, specify a value of 0. + 'UNPACK' transform: + The inverse of the 'PACK' transform. + Introduced in 0.3.1 + 'REGSUB' transform: One of the most powerful and complicated transforms, the regsub Modified: trunk/modules/dm_templates.pm =================================================================== --- trunk/modules/dm_templates.pm 2014-11-27 12:53:57 UTC (rev 245) +++ trunk/modules/dm_templates.pm 2014-11-27 13:19:01 UTC (rev 246) @@ -560,6 +560,26 @@ last CASE; }; + $func_type eq 'pack' and do { + $temp =~ s/^\s*\{\s*\S+?\s*\}\s+(\S+)(\s+.+)?//; + my $type = $1; + my $validChars = 'aAbBcCdDfFhHiIjJlLnNsSvVuUwxZ'; + do_log("PACK transform uses only a single oid,an encode type, " . + "and an optional seperator at $trans_file, line $l_num", 0) + and next LINE if $temp ne ''; + do_log("No encode type at $trans_file, line $l_num", 0) + and next LINE if !defined $type; + while($type =~ s/\((.+?)\)(\d+|\*)?//) { + my $bit = $1; + do_log("Bad encode type ($bit) at $trans_file, line $l_num", 0) + and next LINE if $bit !~ /^([$validChars](\d+|\*)?)+$/i; + } + do_log("Bad encode type ($type) at $trans_file, line $l_num", 0) + and next LINE if $type ne '' and + $type !~ /^([$validChars](\d+|\*)?)+$/i; + last CASE; + }; + $func_type eq 'regsub' and do { $temp =~ s/^\{\s*\S+?\s*\}\s*\/.+\/.*\/\s*$//g; do_log("REGSUB transform should be a perl regex substitution at " . Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2014-11-27 12:53:57 UTC (rev 245) +++ trunk/modules/dm_tests.pm 2014-11-27 13:19:01 UTC (rev 246) @@ -773,8 +773,55 @@ } + sub trans_pack { + my ($device, $oids, $oid, $thr) = @_; + my $oid_h = \%{$oids->{$oid}}; + my ($dep_oid, $type, $seperator) = ($1, $2, $3 || '') + if $oid_h->{'trans_data'} =~ /\{(.+)\}\s+(\S+)(?:\s+"(.+)")?/; + my $dep_oid_h = \%{$oids->{$dep_oid}}; + # Validate our dependencies + validate_deps($device, $oids, $oid, [$dep_oid]) or return; + + # See if we are a repeating variable type datum + # (such as that generated by snmpwalking a table) + if($oid_h->{'repeat'}) { + + # Unpack ze data + for my $leaf (keys %{$dep_oid_h->{'val'}}) { + # Skip if we got a dependency error for this leaf + next if $oid_h->{'error'}{$leaf}; + + my @packed = split $seperator, $dep_oid_h->{'val'}{$leaf}; + my $val = pack $type, @packed; + + do_log("Transformed $dep_oid_h->{'val'}{$leaf}, first val $packed[0], to $val via pack transform type $type, seperator $seperator ",0) if $g{'debug'}; + + $oid_h->{'val'}{$leaf} = $val; + $oid_h->{'time'}{$leaf} = time; + } + + # Apply thresholds + apply_thresh_rep($oids, $thr, $oid); + } + + # Otherwise we are a single entry datum + else { + my $packed = $dep_oid_h->{'val'}; + my @vars = pack $type, $packed; + + $oid_h->{'val'} = join $seperator, @vars; + $oid_h->{'time'} = time; + + # Apply thresholds + apply_thresh($oids, $thr, $oid); + } + + } + + + # Translate hex or octal data into decimal ################################## sub trans_unpack { my ($device, $oids, $oid, $thr) = @_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |