From: <buc...@us...> - 2008-12-31 12:58:15
|
Revision: 106 http://devmon.svn.sourceforge.net/devmon/?rev=106&view=rev Author: buchanmilne Date: 2008-12-31 12:58:08 +0000 (Wed, 31 Dec 2008) Log Message: ----------- Ensure repeaters created by CHAIN transform are tagged as such (so they can be primary OID) Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2008-12-31 12:56:15 UTC (rev 105) +++ trunk/modules/dm_tests.pm 2008-12-31 12:58:08 UTC (rev 106) @@ -1589,6 +1589,7 @@ # Apply thresholds apply_thresh_rep($oids, $thr, $oid); + $oid_h->{'repeat'} = 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 13:08:25
|
Revision: 112 http://devmon.svn.sourceforge.net/devmon/?rev=112&view=rev Author: buchanmilne Date: 2009-01-09 13:08:17 +0000 (Fri, 09 Jan 2009) Log Message: ----------- Strip spaces off names of repeaters before creating rrd section of message Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2009-01-05 16:20:08 UTC (rev 111) +++ trunk/modules/dm_tests.pm 2009-01-09 13:08:17 UTC (rev 112) @@ -2017,6 +2017,7 @@ for my $leaf (@{$rrd{$name}{'leaves'}}) { my $pri_val = $oids->{$pri}{'val'}{$leaf}; + $pri_val =~ s/\s*//g; $temp_data = ''; for my $oid (@{$rrd{$name}{'oids'}}) { 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:27:37
|
Revision: 147 http://devmon.svn.sourceforge.net/devmon/?rev=147&view=rev Author: dbaldwin Date: 2009-09-11 07:27:31 +0000 (Fri, 11 Sep 2009) Log Message: ----------- dm_tests.pm - fixes for TRANSFORM dependencies undefined and multiple RRD data items Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2009-09-11 07:15:51 UTC (rev 146) +++ trunk/modules/dm_tests.pm 2009-09-11 07:27:31 UTC (rev 147) @@ -94,11 +94,19 @@ $g{'hobbit_color'}{$device} eq 'green') { # First transform any data and do threshold evaluations - for my $oid (keys %$oids) { + my @translist = keys %$oids; + my %skiplist = (); + for my $oid (@translist) { # Only transform if we dont already have values for this oid next if !$oids->{$oid}{'transform'} or defined $oids->{$oid}{'val'}; - transform($device, $oids, $oid, $thr); + # Only transform if we have dependent value, otherwise push onto end of queue (not a perfect solution, but better than before) + if(ref $oids->{$oid}{trans_data} eq "HASH" && ! defined $oids->{$oids->{$oid}{trans_data}{dep_oid}}{val}) { + do_log("Skipping oid $oid until ".$oids->{$oid}{trans_data}{dep_oid}." defined for $device") if $g{debug}; + push @translist,($oid) unless $skiplist{$oid}++; + } else { + transform($device, $oids, $oid, $thr); + } } } @@ -1898,7 +1906,8 @@ $rrd{$name}{'pri'} = $oid if $rrd{$name}{'pri'} eq 'pri'; if ($rrd{$name}{'all'} or $alarm) { - push @{$rrd{$name}{'leaves'}}, $leaf; + # add to list, but check we're not pushing multiple times + push @{$rrd{$name}{'leaves'}}, $leaf unless grep {$_ eq $leaf} @{$rrd{$name}{'leaves'}}; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dba...@us...> - 2009-09-23 04:53:57
|
Revision: 153 http://devmon.svn.sourceforge.net/devmon/?rev=153&view=rev Author: dbaldwin Date: 2009-09-23 04:53:49 +0000 (Wed, 23 Sep 2009) Log Message: ----------- Handle leaf data in tables correctly in dm_tests.pm Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2009-09-23 01:39:50 UTC (rev 152) +++ trunk/modules/dm_tests.pm 2009-09-23 04:53:49 UTC (rev 153) @@ -1874,8 +1874,8 @@ my $oid_h = \%{$oids->{$oid}}; # Get our oid vars - my $val = $oid_h->{'val'}{$leaf}; - my $color = $oid_h->{'color'}{$leaf}; + my $val = $oid_h->{'repeat'} ? $oid_h->{'val'}{$leaf} : $oid_h->{'val'}; + my $color = $oid_h->{'repeat'} ? $oid_h->{'color'}{$leaf} : $oid_h->{'color'}; if (!defined $val) { do_log("Undefined value for $oid in test $test on $device, ignoring row for $pri_val") if $g{'debug'}; next T_LEAF; @@ -1981,7 +1981,7 @@ # Otherwise just display the oid val else { - my $substr = $oids->{$root}{'val'}{$leaf}; + my $substr = $oids->{$root}{'repeat'} ? $oids->{$root}{'val'}{$leaf} : $oids->{$root}{'val'}; $substr = 'Undefined' if !defined $substr; $row_data =~ s/\{$root}/$substr/; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2009-10-26 12:00:18
|
Revision: 155 http://devmon.svn.sourceforge.net/devmon/?rev=155&view=rev Author: buchanmilne Date: 2009-10-26 11:59:58 +0000 (Mon, 26 Oct 2009) Log Message: ----------- Use table header tags instead of table data tags for column headings (Tracker ID #2592460, Richard Finegold) Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2009-09-25 04:33:30 UTC (rev 154) +++ trunk/modules/dm_tests.pm 2009-10-26 11:59:58 UTC (rev 155) @@ -1792,8 +1792,8 @@ $line =~ s/\|/ /g; } else { - $line =~ s/\|/<\/td><td>/g; - $table .= "<tr><td>$line</td></tr>\n"; + $line =~ s/\|/<\/th><th>/g; + $table .= "<tr><th>$line</th></tr>\n"; } next MSG_LINE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2010-03-16 16:11:44
|
Revision: 182 http://devmon.svn.sourceforge.net/devmon/?rev=182&view=rev Author: buchanmilne Date: 2010-03-16 16:11:34 +0000 (Tue, 16 Mar 2010) Log Message: ----------- Fix dependency validation in chain transform Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2010-03-16 09:12:21 UTC (rev 181) +++ trunk/modules/dm_tests.pm 2010-03-16 16:11:34 UTC (rev 182) @@ -1528,8 +1528,7 @@ my ($src_oid, $trg_oid) = $oid_h->{'trans_data'} =~ /\{(.+?)}/g; # 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+$') + validate_deps($device, $oids, $oid, [$src_oid], '^\.?(\d+\.)*\d+$') or return; my $src_h = \%{$oids->{$src_oid}}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2011-01-13 12:04:34
|
Revision: 189 http://devmon.svn.sourceforge.net/devmon/?rev=189&view=rev Author: buchanmilne Date: 2011-01-13 12:04:27 +0000 (Thu, 13 Jan 2011) Log Message: ----------- Dont log "No SNMP data found" messages for hosts which we did not poll due to being unreachable according to hobbit/xymon Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2011-01-11 13:41:47 UTC (rev 188) +++ trunk/modules/dm_tests.pm 2011-01-13 12:04:27 UTC (rev 189) @@ -176,9 +176,12 @@ $oids->{$oid}{'transform'} = 0; $oids->{$oid}{'repeat'} = $repeat; - do_log("No SNMP data found for $oid on $device", 0) and next - if !defined $num or !defined $snmp->{$num} - or !defined $snmp->{$num}{'val'}; + if (!defined $num or !defined $snmp->{$num} + or !defined $snmp->{$num}{'val'} ) + { + do_log("No SNMP data found for $oid on $device", 0) if ($g{'color'}{$device} eq 'green'); + next + } # If this is a repeater, iterate through its leaves and assign values if($repeat) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2011-01-14 14:00:21
|
Revision: 191 http://devmon.svn.sourceforge.net/devmon/?rev=191&view=rev Author: buchanmilne Date: 2011-01-14 14:00:15 +0000 (Fri, 14 Jan 2011) Log Message: ----------- Fix "No SNMP data" avoidance Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2011-01-14 13:32:06 UTC (rev 190) +++ trunk/modules/dm_tests.pm 2011-01-14 14:00:15 UTC (rev 191) @@ -179,7 +179,7 @@ if (!defined $num or !defined $snmp->{$num} or !defined $snmp->{$num}{'val'} ) { - do_log("No SNMP data found for $oid on $device", 0) if ($g{'color'}{$device} eq 'green'); + do_log("No SNMP data found for $oid on $device", 0) if ($g{'hobbit_color'}{$device} eq 'green'); next } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2011-01-21 12:46:33
|
Revision: 192 http://devmon.svn.sourceforge.net/devmon/?rev=192&view=rev Author: buchanmilne Date: 2011-01-21 12:46:27 +0000 (Fri, 21 Jan 2011) Log Message: ----------- Log logic processing for each test on each device with debugging and verbosity 2, to assist with tracking down 'Missing msg data'. However, a more efficient solution is required. Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2011-01-14 14:00:15 UTC (rev 191) +++ trunk/modules/dm_tests.pm 2011-01-21 12:46:27 UTC (rev 192) @@ -72,6 +72,7 @@ # Separate tests, perform individual test logic for my $test (split /,/, $tests) { + do_log("... for test $test on device $device ($vendor-$model)",2) if $g{debug}; # Make sure test template exists do_log("Could not find test template for '$test' on $device", 0) @@ -2281,7 +2282,7 @@ } if(!defined $val) { - do_log("Missing msg data for $dep_oid on leaf $leaf", 0); + do_log("Missing msg data for $dep_oid on leaf $leaf", 1); $val = 'Undefined'; } } @@ -2300,7 +2301,7 @@ $val = $oid_h->{'val'}; } if(!defined $val) { - do_log("Missing msg data for $dep_oid", 0); + do_log("Missing msg data for $dep_oid", 1); $val = 'Undefined'; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dba...@us...> - 2011-03-17 03:59:04
|
Revision: 215 http://devmon.svn.sourceforge.net/devmon/?rev=215&view=rev Author: dbaldwin Date: 2011-03-17 03:58:58 +0000 (Thu, 17 Mar 2011) Log Message: ----------- clean up quoting of curly braces in s// Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2011-01-25 13:54:36 UTC (rev 214) +++ trunk/modules/dm_tests.pm 2011-03-17 03:58:58 UTC (rev 215) @@ -473,7 +473,7 @@ my @repeaters; for my $dep_oid (@dep_oids) { push @repeaters, $dep_oid and next if $oids->{$dep_oid}{'repeat'}; - $expr =~ s/\{$dep_oid}/$oids->{$dep_oid}{'val'}/g; + $expr =~ s/\{$dep_oid\}/$oids->{$dep_oid}{'val'}/g; } # Handle repeater-type oids @@ -482,7 +482,7 @@ # Sure, we could just do a regsub for every dep_oid on every leaf, but # thats pretty expensive CPU-wise for (my $i = 0; $i <= $#repeaters; $i++) { - $expr =~ s/\{$repeaters[$i]}/\$dep_val[$i]/g; + $expr =~ s/\{$repeaters[$i]\}/\$dep_val[$i]/g; } for my $leaf (keys %{$oids->{$oid_h->{'pri_oid'}}{'val'}}) { @@ -1454,7 +1454,7 @@ my @repeaters; for my $dep_oid (@dep_oids) { push @repeaters, $dep_oid and next if $oids->{$dep_oid}{'repeat'}; - $expr =~ s/\{$dep_oid}/$oids->{$dep_oid}{'val'}/g; + $expr =~ s/\{$dep_oid\}/$oids->{$dep_oid}{'val'}/g; } # See if we are a repeating variable type datum @@ -1463,7 +1463,7 @@ # Map the names of our repeater oids to a position on a placeholder array for (my $i = 0; $i <= $#repeaters; $i++) { - $expr =~ s/\{$repeaters[$i]}/\$dep_val[$i]/g; + $expr =~ s/\{$repeaters[$i]\}/\$dep_val[$i]/g; } for my $leaf (keys %{$oids->{$oid_h->{'pri_oid'}}{'val'}}) { @@ -1932,7 +1932,7 @@ if($flag eq 'color') { # Honor the 'alarm' exceptions - $row_data =~ s/\{$root}/&$color /; + $row_data =~ s/\{$root\}/&$color /; # If this test has a worse color, use it for the global color $worst_color = $color if !defined $worst_color or @@ -1943,13 +1943,13 @@ elsif ($flag eq 'msg') { my $substr = $oid_h->{'msg'}{$leaf}; $substr = 'Undefined' if !defined $substr; - $row_data =~ s/\{$root}/$substr/; + $row_data =~ s/\{$root\}/$substr/; } # This flag only causes errors (with the color) to be displayed # Will also modify global color type elsif ($flag eq 'errors') { - $row_data =~ s/\{$root}//; + $row_data =~ s/\{$root\}//; next if $color eq 'green'; @@ -1974,7 +1974,7 @@ $oids->{$oid}{'thresh'}{$th_col}{'val'}; $thresh = 'Undefined' if !defined $thresh; - $row_data =~ s/\{$root}/$thresh/; + $row_data =~ s/\{$root\}/$thresh/; } # Uknown flag @@ -1987,7 +1987,7 @@ else { my $substr = $oids->{$root}{'repeat'} ? $oids->{$root}{'val'}{$leaf} : $oids->{$root}{'val'}; $substr = 'Undefined' if !defined $substr; - $row_data =~ s/\{$root}/$substr/; + $row_data =~ s/\{$root\}/$substr/; } } @@ -2090,20 +2090,20 @@ # If this test has a worse color, use it for the global color $worst_color = $color if !defined $worst_color or $colors{$worst_color} < $colors{$color}; - $line =~ s/\{$root}/\&$color /; + $line =~ s/\{$root\}/\&$color /; } elsif ($flag eq 'msg') { my $data = $oid_h->{'msg'}; $data = "Undefined" if !defined $data; $data = parse_deps($oids, $data, undef); - $line =~ s/\{$root}/$data/; + $line =~ s/\{$root\}/$data/; } # This flag only causes errors (with the color) to be displayed # Can also modifies global color elsif ($flag eq 'errors') { - $line =~ s/\{$root}/#ERRORONLY#/; + $line =~ s/\{$root\}/#ERRORONLY#/; # Skip this value if it is green next if !defined $color or $color eq 'green'; @@ -2128,7 +2128,7 @@ $oids->{$oid}{'thresh'}{$th_col}{'val'}; $thresh = 'Undefined' if !defined $thresh; - $line =~ s/\{$root}/$thresh/; + $line =~ s/\{$root\}/$thresh/; } # Unknown flag @@ -2142,7 +2142,7 @@ my $val = $oid_h->{'val'}; $val = "Unknown" if !defined $val; - $line =~ s/\{$root}/$val/; + $line =~ s/\{$root\}/$val/; } } @@ -2306,7 +2306,7 @@ } } - $msg =~ s/\{$dep_oid}/$val/g; + $msg =~ s/\{$dep_oid\}/$val/g; } return $msg; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dba...@us...> - 2011-03-17 05:07:38
|
Revision: 216 http://devmon.svn.sourceforge.net/devmon/?rev=216&view=rev Author: dbaldwin Date: 2011-03-17 05:07:31 +0000 (Thu, 17 Mar 2011) Log Message: ----------- allow multiplication without space surrounding - e.g. {oid1}x{oid2} Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2011-03-17 03:58:58 UTC (rev 215) +++ trunk/modules/dm_tests.pm 2011-03-17 05:07:31 UTC (rev 216) @@ -458,7 +458,7 @@ my $print_mask = '%.' . $precision . 'f'; # Convert our math symbols to their perl equivalents - $expr =~ s/ x / \* /g; # Multiplication + $expr =~ s/\bx\b/\*/g; # Multiplication $expr =~ s/\^/**/g; # Exponentiation # Extract all our our parent oids from the expression, first This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dba...@us...> - 2011-03-18 00:17:11
|
Revision: 218 http://devmon.svn.sourceforge.net/devmon/?rev=218&view=rev Author: dbaldwin Date: 2011-03-18 00:17:03 +0000 (Fri, 18 Mar 2011) Log Message: ----------- revert to whitespace surrounded x substitution - too hard to handle cases such as {oid}x3 since numbers dont match \b Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2011-03-18 00:04:05 UTC (rev 217) +++ trunk/modules/dm_tests.pm 2011-03-18 00:17:03 UTC (rev 218) @@ -458,7 +458,7 @@ my $print_mask = '%.' . $precision . 'f'; # Convert our math symbols to their perl equivalents - $expr =~ s/\bx\b/\*/g; # Multiplication + $expr =~ s/\sx\s/ \* /g; # Multiplication $expr =~ s/\^/**/g; # Exponentiation # Extract all our our parent oids from the expression, first This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dba...@us...> - 2011-03-22 07:58:28
|
Revision: 221 http://devmon.svn.sourceforge.net/devmon/?rev=221&view=rev Author: dbaldwin Date: 2011-03-22 07:58:22 +0000 (Tue, 22 Mar 2011) Log Message: ----------- clean up matching brace patterns in regexps Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2011-03-18 01:22:42 UTC (rev 220) +++ trunk/modules/dm_tests.pm 2011-03-22 07:58:22 UTC (rev 221) @@ -462,7 +462,7 @@ $expr =~ s/\^/**/g; # Exponentiation # Extract all our our parent oids from the expression, first - my @dep_oids = $expr =~ /\{(.+?)}/g; + my @dep_oids = $expr =~ /\{(.+?)\}/g; # Validate our dependencies validate_deps($device, $oids, $oid, \@dep_oids, '^[-+]?\d+(\.\d+)?$') @@ -601,7 +601,7 @@ my $oid_h = \%{$oids->{$oid}}; # Extract all our our parent oids from the expression, first - my @dep_oids = $oid_h->{'trans_data'} =~ /\{(.+?)}/g; + my @dep_oids = $oid_h->{'trans_data'} =~ /\{(.+?)\}/g; # Validate our dependencies validate_deps($device, $oids, $oid, \@dep_oids, '^[-+]?\d+(\.\d+)?$') @@ -689,7 +689,7 @@ my $oid_h = \%{$oids->{$oid}}; # Extract all our our parent oids from the expression, first - my @dep_oids = $oid_h->{'trans_data'} =~ /\{(.+?)}/g; + my @dep_oids = $oid_h->{'trans_data'} =~ /\{(.+?)\}/g; # Validate our dependencies validate_deps($device, $oids, $oid, \@dep_oids, '^[-+]?\d+(\.\d+)?$') @@ -879,7 +879,7 @@ my $oid_h = \%{$oids->{$oid}}; # Extract all our our parent oids from the expression, first - my @dep_oids = $oid_h->{'trans_data'} =~ /\{(.+?)}/g; + my @dep_oids = $oid_h->{'trans_data'} =~ /\{(.+?)\}/g; # Validate our dependencies validate_deps($device, $oids, $oid, \@dep_oids) @@ -947,7 +947,7 @@ my $oid_h = \%{$oids->{$oid}}; # Extract all our our parent oids from the expression, first - my @dep_oids = $oid_h->{'trans_data'} =~ /\{(.+?)}/g; + my @dep_oids = $oid_h->{'trans_data'} =~ /\{(.+?)\}/g; # Validate our dependencies validate_deps($device, $oids, $oid, \@dep_oids) or return; @@ -1441,7 +1441,7 @@ if $trans_data =~ /^\{\s*(\S+?)\s*\}\s*(\/.+\/.*\/)\s*$/; # Extract all our our parent oids from the expression, first - my @dep_oids = $trans_data =~ /\{(.+?)}/g; + my @dep_oids = $trans_data =~ /\{(.+?)\}/g; # Validate our dependencies validate_deps($device, $oids, $oid, \@dep_oids) or return; @@ -1529,7 +1529,7 @@ my $oid_h = \%{$oids->{$oid}}; # Extract all our our parent oids from the expression, first - my ($src_oid, $trg_oid) = $oid_h->{'trans_data'} =~ /\{(.+?)}/g; + my ($src_oid, $trg_oid) = $oid_h->{'trans_data'} =~ /\{(.+?)\}/g; # Validate our dependencies, have to do them seperately validate_deps($device, $oids, $oid, [$src_oid], '^\.?(\d+\.)*\d+$') @@ -1618,7 +1618,7 @@ my $oid_h = \%{$oids->{$oid}}; # Extract our parent oids from the expression, first - my ($src_oid) = $oid_h->{'trans_data'} =~ /\{(.+?)}/g; + my ($src_oid) = $oid_h->{'trans_data'} =~ /\{(.+?)\}/g; validate_deps($device, $oids, $oid, [$src_oid], '.+') ; # Validate our dependencies, have to do them seperately @@ -1784,7 +1784,7 @@ # If we have seen a TABLE: placeholder, do table logic if(defined $table) { # First check and see if this is our table header - if($line !~ /\{(.+?)}/) { + if($line !~ /\{(.+?)\}/) { # Format the line accordingly if(defined $t_opts{'nonhtml'}) { @@ -1811,7 +1811,7 @@ else {$line =~ s/\|/<\/td><td>/g} # Make the first oid (from left to right) the primary one - my $pri = $1 if $line =~ /\{(.+?)}/; + my $pri = $1 if $line =~ /\{(.+?)\}/; if(!defined $pri) { do_log("No primary OID found for $test test for $device", 0); $msg .= "&yellow No primary OID found.\n"; @@ -1870,7 +1870,7 @@ $alarm = 0 if defined $na_val and $pri_val =~ /^($na_val)$/; # Now go through all the oids in our table row and replace them - for my $root ($row_data =~ /\{(.+?)}/g) { + for my $root ($row_data =~ /\{(.+?)\}/g) { # Chop off any flags and store them for later my $oid = $root; @@ -2067,7 +2067,7 @@ # Not table data, so it should be a non-repeater type variable else { - for my $root ($line =~ /\{(.+?)}/g) { + for my $root ($line =~ /\{(.+?)\}/g) { # Chop off any flags and store them for later my $oid = $root; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2013-01-02 15:55:38
|
Revision: 240 http://devmon.svn.sourceforge.net/devmon/?rev=240&view=rev Author: buchanmilne Date: 2013-01-02 15:55:32 +0000 (Wed, 02 Jan 2013) Log Message: ----------- Revert unintended changes to trans_index in r238 (thanks to Wim Nelis for spotting them) Revision Links: -------------- http://devmon.svn.sourceforge.net/devmon/?rev=238&view=rev Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2012-12-27 18:01:12 UTC (rev 239) +++ trunk/modules/dm_tests.pm 2013-01-02 15:55:32 UTC (rev 240) @@ -1621,9 +1621,6 @@ 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 @@ -1648,24 +1645,6 @@ # 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}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2013-01-03 14:44:47
|
Revision: 241 http://devmon.svn.sourceforge.net/devmon/?rev=241&view=rev Author: buchanmilne Date: 2013-01-03 14:44:41 +0000 (Thu, 03 Jan 2013) Log Message: ----------- Fix parsing of option=value table options (reported by Wim Nelis) Use first value for border,pad options, instead of the arry (Wim Nelis) Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2013-01-02 15:55:32 UTC (rev 240) +++ trunk/modules/dm_tests.pm 2013-01-03 14:44:41 UTC (rev 241) @@ -1802,6 +1802,7 @@ if(defined $opts) { for my $optval (split /\s*,\s*/, $opts) { my ($opt,$val) = ($1,$2) if $optval =~ /(\w+)(?:\((.+)\))?/; + ($opt,$val) = ($1,$2) if $optval =~ /^(\w+)=(\d+)$/; $val = 1 if !defined $val; push @{$t_opts{$opt}}, $val; @@ -1813,8 +1814,8 @@ $table = ''; } else { - my $border = (defined $t_opts{'border'}) ? $t_opts{'border'} : 1; - my $pad = (defined $t_opts{'pad'}) ? $t_opts{'pad'} : 5; + my $border = (defined $t_opts{'border'}) ? $t_opts{'border'}[0] : 1; + my $pad = (defined $t_opts{'pad'}) ? $t_opts{'pad'}[0] : 5; $table = "<table border=$border cellpadding=$pad>\n"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2015-06-02 14:46:01
|
Revision: 248 http://sourceforge.net/p/devmon/code/248 Author: buchanmilne Date: 2015-06-02 14:46:00 +0000 (Tue, 02 Jun 2015) Log Message: ----------- Some fixes for MATCH operator Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2015-03-13 16:50:33 UTC (rev 247) +++ trunk/modules/dm_tests.pm 2015-06-02 14:46:00 UTC (rev 248) @@ -1766,17 +1766,17 @@ $oid_h->{'error'}{$leaf} = 1; next; } - do_log("$val matched $expr, assigning new $idx from old row $leaf",0) if $g{'debug'} and $res; + do_log("$val matched $expr, assigning new row $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; + $oid_h->{'val'}{$idx} = 'Target val missing - index'; + $oid_h->{'time'}{$idx} = time; + $oid_h->{'color'}{$idx} = 'yellow'; + $oid_h->{'error'}{$idx} = 1; next; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2015-06-02 14:59:23
|
Revision: 249 http://sourceforge.net/p/devmon/code/249 Author: buchanmilne Date: 2015-06-02 14:59:22 +0000 (Tue, 02 Jun 2015) Log Message: ----------- Merge patch from Wim Nelis (ticket #18) Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2015-06-02 14:46:00 UTC (rev 248) +++ trunk/modules/dm_tests.pm 2015-06-02 14:59:22 UTC (rev 249) @@ -1990,12 +1990,12 @@ my $a_val = $dev->{'except'}{$test}{$pri}{'alarm'} || $dev->{'except'}{'all'}{$pri}{'alarm'} || $tmpl->{'oids'}{$pri}{'except'}{'alarm'}; - $alarm = ($pri_val =~ /^($a_val)$/) ? 1 : 0 if defined $a_val; + $alarm = ($pri_val =~ /^(?:$a_val)$/) ? 1 : 0 if defined $a_val; my $na_val = $dev->{'except'}{$test}{$pri}{'noalarm'} || $dev->{'except'}{'all'}{$pri}{'noalarm'} || $tmpl->{'oids'}{$pri}{'except'}{'noalarm'}; - $alarm = 0 if defined $na_val and $pri_val =~ /^($na_val)$/; + $alarm = 0 if defined $na_val and $pri_val =~ /^(?:$na_val)$/; # Now go through all the oids in our table row and replace them for my $root ($row_data =~ /\{(.+?)\}/g) { @@ -2023,8 +2023,8 @@ my $only = $dev->{'except'}{$test}{$oid}{'only'} || $dev->{'except'}{'all'}{$oid}{'only'} || $tmpl->{'oids'}{$oid}{'except'}{'only'}; - next T_LEAF if defined $ignore and $val =~ /^($ignore)$/; - next T_LEAF if defined $only and $val !~ /^($only)$/; + next T_LEAF if defined $ignore and $val =~ /^(?:$ignore)$/; + next T_LEAF if defined $only and $val !~ /^(?:$only)$/; # If we arent alarming on a value, its green by default @@ -2347,28 +2347,28 @@ if(defined $dev->{'except'}{$test}{$oid}{'noalarm'}) { my $match = $dev->{'except'}{$test}{$oid}{'noalarm'}; - return 1 if $val =~ /^($match)$/; + return 1 if $val =~ /^(?:$match)$/; } elsif(defined $dev->{'except'}{'all'}{$oid}{'noalarm'}) { my $match = $dev->{'except'}{'all'}{$oid}{'noalarm'}; - return 1 if $val =~ /^($match)$/; + return 1 if $val =~ /^(?:$match)$/; } elsif(defined $tmpl->{'oids'}{$oid}{'except'}{'noalarm'}) { my $match = $tmpl->{'oids'}{$oid}{'except'}{'noalarm'}; - return 1 if $val =~ /^($match)$/; + return 1 if $val =~ /^(?:$match)$/; } if(defined $dev->{'except'}{$test}{$oid}{'alarm'}) { my $match = $dev->{'except'}{$test}{$oid}{'alarm'}; - return 1 if $val !~ /^($match)$/; + return 1 if $val !~ /^(?:$match)$/; } elsif(defined $dev->{'except'}{'all'}{$oid}{'alarm'}) { my $match = $dev->{'except'}{'all'}{$oid}{'alarm'}; - return 1 if $val !~ /^($match)$/; + return 1 if $val !~ /^(?:$match)$/; } elsif(defined $tmpl->{'oids'}{$oid}{'except'}{'alarm'}) { my $match = $tmpl->{'oids'}{$oid}{'except'}{'alarm'}; - return 1 if $val !~ /^($match)$/; + return 1 if $val !~ /^(?:$match)$/; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2015-06-02 15:13:51
|
Revision: 250 http://sourceforge.net/p/devmon/code/250 Author: buchanmilne Date: 2015-06-02 15:13:49 +0000 (Tue, 02 Jun 2015) Log Message: ----------- Keep sending RRD data for rows that don't alarm, if you don't want RRDs, ignore the row Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2015-06-02 14:59:22 UTC (rev 249) +++ trunk/modules/dm_tests.pm 2015-06-02 15:13:49 UTC (rev 250) @@ -2037,10 +2037,13 @@ for my $name (keys %rrd) { $rrd{$name}{'pri'} = $oid if $rrd{$name}{'pri'} eq 'pri'; - if ($rrd{$name}{'all'} or $alarm) { + # This condition looks incorrect. We should not remove rrds if alerting + # is disabled for this leaf. If the user doesnt want a graph, they probably + # dont want this leaf in the table, they should set 'ignore' instead of 'noalarm' + #if ($rrd{$name}{'all'} or $alarm) { # add to list, but check we're not pushing multiple times push @{$rrd{$name}{'leaves'}}, $leaf unless grep {$_ eq $leaf} @{$rrd{$name}{'leaves'}}; - } + #} } # If this is our primary oid, and we are have an alarm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <buc...@us...> - 2015-06-02 15:28:38
|
Revision: 251 http://sourceforge.net/p/devmon/code/251 Author: buchanmilne Date: 2015-06-02 15:28:36 +0000 (Tue, 02 Jun 2015) Log Message: ----------- Dont add ignored repeaters to the 'Alarming on' message Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2015-06-02 15:13:49 UTC (rev 250) +++ trunk/modules/dm_tests.pm 2015-06-02 15:28:36 UTC (rev 251) @@ -1983,6 +1983,7 @@ T_LEAF: for my $leaf (@table_leaves) { my $row_data = $line; + my $alarm_int; # Do some alarm logic my $pri_val = $oids->{$pri}{'val'}{$leaf}; @@ -2047,12 +2048,10 @@ } # If this is our primary oid, and we are have an alarm - # variable defined, add this to our alarm header if we are - # alarming on it; Wrap our header at 60 chars - if(!defined $t_opts{'noalarmsmsg'} and $alarm) { - $alarm_ints =~ s/(.{60,}),$/$1)\nAlarming on (/; - $alarm_ints .= "$val,"; - } + # variable defined, save it so we can add it later + $alarm_int = $val; + # + # } # See if we have a valid flag, if so, replace the @@ -2122,6 +2121,12 @@ } } + # add the primary repeater to our alarm header if we are + # alarming on it; Wrap our header at 60 chars + if(!defined $t_opts{'noalarmsmsg'} and $alarm) { + $alarm_ints =~ s/(.{60,}),$/$1)\nAlarming on (/; + $alarm_ints .= "$alarm_int,"; + } # Finished with this row (signified by the primary leaf id) if(defined $t_opts{'nonhtml'} || defined $t_opts{'plain'}) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |