Fixed small bug in the new SNMP function (purge all NULL results, etc)

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@65 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
raulmateos 2006-06-29 22:04:17 +00:00
parent 002e112c63
commit a2cf1920b4
1 changed files with 18 additions and 18 deletions

View File

@ -3,7 +3,7 @@
# Pandora Network Server
##################################################################################
# Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
# Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L
# Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -113,10 +113,7 @@ sub pandora_network_subsystem {
# ejecuto el modulo, le doy 15 sec y contino.
# si ejecuta bien, grabo datos y estado
# siguiente elemento
# Calculate ID Agent from a select where module_type (id_tipo_modulo) > 4 (network modules)
# Check for MASTER SERVERS only: check another agents if their servers are gone
$server_id = dame_server_id($pa_config, $pa_config->{'servername'}, $dbh);
$buffer = "";
@ -141,7 +138,6 @@ sub pandora_network_subsystem {
}
$exec_sql2->finish();
}
# First: Checkout for enabled agents owned by this server
$query_sql2 = "select * from tagente where ( disabled = 0 and id_server = $server_id ) ".$buffer;
$exec_sql2 = $dbh->prepare($query_sql2);
@ -249,8 +245,12 @@ sub pandora_query_snmp {
# Pass the VarList to getnext building an array of the output
my @OIDINFO = $SESSION->getnext($OIDLIST);
$output = $OIDINFO[0];
if ((!defined($output)) || ($output eq "")){
$_[4]="1";
} else {
$_[4]="0";
}
}
# Too much DEBUG for me :-)
# logger($pa_config, "SNMP RESULT $snmp_oid $snmp_target - > $output \n",10);
return $output;