2009-10-20 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/SNMPServer.pm: Save as much information as possible if the trap could not be properly parsed. * lib/PandoraFMS/Core.pm: Changed the name of the alert name macro to avoid conflicts with other macros. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2037 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
f3b40ded71
commit
782413610d
|
@ -1,3 +1,11 @@
|
|||
2009-10-20 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/SNMPServer.pm: Save as much information as possible if
|
||||
the trap could not be properly parsed.
|
||||
|
||||
* lib/PandoraFMS/Core.pm: Changed the name of the alert name macro to
|
||||
avoid conflicts with other macros.
|
||||
|
||||
2009-10-20 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* tools.pm, core.pm: Float data with "," will be replace this
|
||||
|
|
|
@ -437,7 +437,7 @@ sub pandora_execute_action ($$$$$$$$) {
|
|||
_address_ => (defined ($agent)) ? $agent->{'direccion'} : '',
|
||||
_timestamp_ => strftime ("%Y-%m-%d %H:%M:%S", localtime()),
|
||||
_data_ => $data,
|
||||
_alert_ => $alert->{'name'},
|
||||
_alert_name_ => $alert->{'name'},
|
||||
_alert_description_ => $alert->{'description'},
|
||||
_alert_threshold_ => $alert->{'time_threshold'},
|
||||
_alert_times_fired_ => $alert->{'times_fired'},
|
||||
|
|
|
@ -130,19 +130,13 @@ sub pandora_snmptrapd {
|
|||
my $timestamp = $date . ' ' . $time;
|
||||
$value = limpia_cadena ($value);
|
||||
|
||||
my ($custom_oid, $custom_type, $custom_value) = ('', '', $type_desc);
|
||||
my ($custom_oid, $custom_type, $custom_value) = ('', '', '');
|
||||
($custom_oid, $custom_type, $custom_value) = ($1, $2, limpia_cadena ($3)) if ($data =~ m/([0-9\.]*)\s\=\s([A-Za-z0-9]*)\:\s(.+)/);
|
||||
|
||||
# Custom OID
|
||||
if ($type eq '6') {
|
||||
|
||||
#String data
|
||||
next if ($data =~ m/STRING/) && ($data !~ m/([0-9\.]*)\s\=\s([A-Za-z0-9]*)\:\s\"(.+)\"/);
|
||||
|
||||
next if ($data !~ m/([0-9\.]*)\s\=\s([A-Za-z0-9]*)\:\s(.+)/);
|
||||
|
||||
($custom_oid, $custom_type, $custom_value) = ($1, $2, $3);
|
||||
$custom_value = limpia_cadena ($custom_value);
|
||||
}
|
||||
# Try to save as much information as possible if the trap could not be parsed
|
||||
$oid = $type_desc if ($oid eq '' || $oid eq '.');
|
||||
$custom_value = $type_desc if ($custom_oid eq '' || $custom_oid eq '.');
|
||||
$custom_value = $data if ($custom_value eq '');
|
||||
|
||||
# Insert the trap into the DB
|
||||
if (! defined(enterprise_hook ('snmp_insert_trap', [$pa_config, $source, $oid, $type, $value, $custom_oid, $custom_value, $custom_type, $timestamp, $dbh]))) {
|
||||
|
|
Loading…
Reference in New Issue