Commit aa5c166a authored by ueli heuer's avatar ueli heuer 👾
Browse files

Add support for module with only one return value

Switch to Net::SNMP libs
parent f1af0bd3
......@@ -23,7 +23,8 @@ use DVG_config;
use DVG_tool;
#use strict;
use SNMP_util "0.86";
#use SNMP_util "0.86";
use Net::SNMP::Util;
use RRDs;
use vars qw($db);
......@@ -31,7 +32,7 @@ $db = db_connect('dvgdb','RW'); # connect RW to the database
DVG_tool::init($db);
my $BIN = get_bindir();
$SNMP_Session::suppress_warnings = 2 ; # we do not want any SNMP errormessages
#$SNMP_Session::suppress_warnings = 2 ; # we do not want any SNMP errormessages
# {{{ sub update_rrd ($@)
sub update_rrd ($@) {
......@@ -63,6 +64,15 @@ sub get_values ($$$@) {
@values = `$torun`;
} elsif ( $type eq 'module' ) {
($module, @param) = @parameter;
if ($module =~ /,/) {
($module,$param0) = split(/,/,$module,2);
if ($param0 =~ /^\"/) {
$param0 =~ s/^\"//;
}
}
if (defined($param0)) {
@param = $param0;
}
$param = sprintf('"%s"',join ('","',@param));
$mod_var = "${module}_mod";
if (! ${$mod_var} ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment