2011-08-18 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/NetworkServer.pm,
	  lib/PandoraFMS/Core.pm: Fixed some warnings on undefined values.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4770 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2011-08-18 15:40:51 +00:00
parent 0659a92368
commit cab15228e8
3 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2011-08-18 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/Core.pm: Fixed some warnings on undefined values.
2011-08-17 Sancho Lerena <slerena@artica.es>
* SNMPServer.pm: Custom value and custom type are not used anymore.

View File

@ -166,7 +166,7 @@ our @EXPORT = qw(
pandora_server_statistics
pandora_self_monitoring
pandora_process_policy_queue
get_agent_from_addr
get_agent_from_addr
@ServerTypes
);
@ -2433,8 +2433,11 @@ sub pandora_self_monitoring ($$) {
$xml_output .=" </module>";
my $load_average = load_average();
my $free_mem = free_mem();;
$load_average = '' unless defined ($load_average);
my $free_mem = free_mem();
$free_mem = '' unless defined ($load_average);
my $free_disk_spool = disk_free ($pa_config->{"incomingdir"});
$free_disk_spool = '' unless defined ($free_disk_spool);
my $my_data_server = get_db_value ($dbh, "SELECT id_server FROM tserver WHERE server_type = 0 AND name = '".$pa_config->{"servername"}."'");
# Number of unknown agents

View File

@ -329,9 +329,8 @@ sub pandora_query_snmp ($$$) {
# SNMP v1, v2 and v2c call
if ($snmp_version ne '3'){
$output = pandora_snmp_get_command ($snmpget_cmd, $snmp_version, $snmp_retries, $snmp_timeout, $snmp_community, $snmp_target, $snmp_oid, "", "");
if ($output ne ""){
$output = pandora_snmp_get_command ($snmpget_cmd, $snmp_version, $snmp_retries, $snmp_timeout, $snmp_community, $snmp_target, $snmp_oid, "", "");
if (defined ($output) && $output ne ""){
$module_result = 0;
$module_data = $output;
}
@ -352,10 +351,9 @@ sub pandora_query_snmp ($$$) {
$snmp3_extra = " -a $snmp3_auth_method -u $snmp3_auth_user -A $snmp3_auth_pass -x $snmp3_privacy_method -X $snmp3_privacy_pass ";
}
$snmp3_execution = pandora_snmp_get_command ($snmpget_cmd, $snmp_version, $snmp_retries, $snmp_timeout, $snmp_community, $snmp_target, $snmp_oid, $snmp3_security_level, $snmp3_extra);
$snmp3_execution = pandora_snmp_get_command ($snmpget_cmd, $snmp_version, $snmp_retries, $snmp_timeout, $snmp_community, $snmp_target, $snmp_oid, $snmp3_security_level, $snmp3_extra);
$output = `$snmp3_execution`;
if ($output ne ""){
if (defined ($output) && $output ne ""){
$module_result = 0;
$module_data = $output;
}