2013-09-24 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/WMIServer.pm: Some HTML entities were not being decoded. * lib/PandoraFMS/Core.pm: Set the severity or alert recovery events to NORMAL. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8802 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
097cff97bb
commit
c3b0c19136
|
@ -1,3 +1,11 @@
|
||||||
|
2013-09-24 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* lib/PandoraFMS/WMIServer.pm: Some HTML entities were not being
|
||||||
|
decoded.
|
||||||
|
|
||||||
|
* lib/PandoraFMS/Core.pm: Set the severity or alert recovery events to
|
||||||
|
NORMAL.
|
||||||
|
|
||||||
2013-09-22 Junichi Satoh <junichi@rworks.jp>
|
2013-09-22 Junichi Satoh <junichi@rworks.jp>
|
||||||
|
|
||||||
* bin/tentacle_server: Upgraded to 0.4.0. (Imported from trunk of
|
* bin/tentacle_server: Upgraded to 0.4.0. (Imported from trunk of
|
||||||
|
|
|
@ -690,11 +690,11 @@ sub pandora_execute_alert ($$$$$$$$;$) {
|
||||||
# Generate an event only if an event has not already been generated by an alert action
|
# Generate an event only if an event has not already been generated by an alert action
|
||||||
if ($event_generated == 0) {
|
if ($event_generated == 0) {
|
||||||
|
|
||||||
#If we've spotted an alert recovered, we set the new event's severity to 0, otherwise the original value is maintained.
|
#If we've spotted an alert recovered, we set the new event's severity to 2 (NORMAL), otherwise the original value is maintained.
|
||||||
my ($text, $event, $severity) = ($alert_mode == 0) ? ('recovered', 'alert_recovered', 0) : ('fired', 'alert_fired', $alert->{'priority'});
|
my ($text, $event, $severity) = ($alert_mode == 0) ? ('recovered', 'alert_recovered', 2) : ('fired', 'alert_fired', $alert->{'priority'});
|
||||||
|
|
||||||
pandora_event ($pa_config, "Alert $text (" . safe_output($alert->{'name'}) . ") " . (defined ($module) ? 'assigned to ('. safe_output($module->{'nombre'}) . ")" : ""),
|
pandora_event ($pa_config, "Alert $text (" . safe_output($alert->{'name'}) . ") " . (defined ($module) ? 'assigned to ('. safe_output($module->{'nombre'}) . ")" : ""),
|
||||||
(defined ($agent) ? $agent->{'id_grupo'} : 0), (defined ($agent) ? $agent->{'id_agente'} : 0), $alert->{'priority'}, (defined ($alert->{'id_template_module'}) ? $alert->{'id_template_module'} : 0),
|
(defined ($agent) ? $agent->{'id_grupo'} : 0), (defined ($agent) ? $agent->{'id_agente'} : 0), $severity, (defined ($alert->{'id_template_module'}) ? $alert->{'id_template_module'} : 0),
|
||||||
(defined ($alert->{'id_agent_module'}) ? $alert->{'id_agent_module'} : 0), $event, 0, $dbh, 'Pandora', '', '', '', '', $critical_instructions, $warning_instructions, $unknown_instructions);
|
(defined ($alert->{'id_agent_module'}) ? $alert->{'id_agent_module'} : 0), $event, 0, $dbh, 'Pandora', '', '', '', '', $critical_instructions, $warning_instructions, $unknown_instructions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,10 +159,11 @@ sub data_consumer ($$) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# WMI query
|
# WMI query
|
||||||
my $wmi_query = decode_entities($module->{'snmp_oid'});
|
my $wmi_query = $module->{'snmp_oid'};
|
||||||
$wmi_query =~ s/\"/\'/g;
|
$wmi_query =~ s/\"/\'/g;
|
||||||
|
|
||||||
$wmi_command .= ' //' . $module->{'ip_target'} . ' "' . $wmi_query . '"';
|
$wmi_command .= ' //' . $module->{'ip_target'} . ' "' . $wmi_query . '"';
|
||||||
|
$wmi_command = safe_output ($wmi_command);
|
||||||
logger ($pa_config, "Executing AM # $module_id WMI command '$wmi_command'", 9);
|
logger ($pa_config, "Executing AM # $module_id WMI command '$wmi_command'", 9);
|
||||||
|
|
||||||
# Execute command
|
# Execute command
|
||||||
|
@ -192,7 +193,7 @@ sub data_consumer ($$) {
|
||||||
my @row = split(/\|/, $output[2]);
|
my @row = split(/\|/, $output[2]);
|
||||||
|
|
||||||
# Get the specified column
|
# Get the specified column
|
||||||
$module_data = $row[$module->{'tcp_port'}] if defined ($row[$module->{'tcp_port'}]);
|
$module_data = $row[$module->{'tcp_port'}] if (defined ($module->{'tcp_port'}) && defined ($row[$module->{'tcp_port'}]));
|
||||||
if ($module_data =~ m/^ERROR/) {
|
if ($module_data =~ m/^ERROR/) {
|
||||||
pandora_update_module_on_error ($pa_config, $module, $dbh);
|
pandora_update_module_on_error ($pa_config, $module, $dbh);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue