2012-02-10 Vanessa Gil <vanessa.gil@artica.es>
* util/pandora_manage.pl: Added new Event validate given id. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5545 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e137ad8ba3
commit
3ffab90a42
|
@ -1,3 +1,7 @@
|
||||||
|
2012-02-10 Vanessa Gil <vanessa.gil@artica.es>
|
||||||
|
|
||||||
|
* util/pandora_manage.pl: Added new Event validate given id.
|
||||||
|
|
||||||
2012-02-07 Ramon Novoa <rnovoa@artica.es>
|
2012-02-07 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Core.pm: Added new SNMP alert fields and macros.
|
* lib/PandoraFMS/Core.pm: Added new SNMP alert fields and macros.
|
||||||
|
|
|
@ -131,6 +131,7 @@ sub help_screen{
|
||||||
print "EVENTS:\n\n" unless $param ne '';
|
print "EVENTS:\n\n" unless $param ne '';
|
||||||
help_screen_line('--create_event', '<event> <event_type> <agent_name> <module_name> <group_name> [<event_status> <severity> <template_name>]', 'Add event');
|
help_screen_line('--create_event', '<event> <event_type> <agent_name> <module_name> <group_name> [<event_status> <severity> <template_name>]', 'Add event');
|
||||||
help_screen_line('--validate_event', '<agent_name> <module_name> <datetime_min> <datetime_max> <user_name> <criticity> <template_name>', 'Validate events');
|
help_screen_line('--validate_event', '<agent_name> <module_name> <datetime_min> <datetime_max> <user_name> <criticity> <template_name>', 'Validate events');
|
||||||
|
help_screen_line('--validate_event_id', '<event_id>', 'Validate event given a event id');
|
||||||
print "INCIDENTS:\n\n" unless $param ne '';
|
print "INCIDENTS:\n\n" unless $param ne '';
|
||||||
help_screen_line('--create_incident', '<title> <description> <origin> <status> <priority 0 for Informative, 1 for Low, 2 for Medium, 3 for Serious, 4 for Very serious or 5 for Maintenance> <group> [<owner>]', 'Create incidents');
|
help_screen_line('--create_incident', '<title> <description> <origin> <status> <priority 0 for Informative, 1 for Low, 2 for Medium, 3 for Serious, 4 for Very serious or 5 for Maintenance> <group> [<owner>]', 'Create incidents');
|
||||||
print "POLICIES:\n\n" unless $param ne '';
|
print "POLICIES:\n\n" unless $param ne '';
|
||||||
|
@ -424,6 +425,21 @@ sub pandora_validate_event_filter ($$$$$$$$$) {
|
||||||
db_do ($dbh, "UPDATE tevento SET estado = 1 WHERE estado = 0".$filter);
|
db_do ($dbh, "UPDATE tevento SET estado = 1 WHERE estado = 0".$filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# Validate event given a event id
|
||||||
|
##########################################################################
|
||||||
|
sub pandora_validate_event_id ($$$) {
|
||||||
|
my ($pa_config, $id_event, $dbh) = @_;
|
||||||
|
my $filter = '';
|
||||||
|
|
||||||
|
if ($id_event ne ''){
|
||||||
|
$filter .= " AND id_evento = $id_event";
|
||||||
|
}
|
||||||
|
|
||||||
|
logger($pa_config, "Validating events", 10);
|
||||||
|
db_do ($dbh, "UPDATE tevento SET estado = 1 WHERE estado = 0".$filter);
|
||||||
|
}
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
## Update a user from hash
|
## Update a user from hash
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
@ -2334,6 +2350,21 @@ sub cli_validate_event() {
|
||||||
print "[INFO] Validating event for agent '$agent_name'\n\n";
|
print "[INFO] Validating event for agent '$agent_name'\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Validate event.
|
||||||
|
# Related option: --validate_event_id
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
sub cli_validate_event_id() {
|
||||||
|
my $id_event = @ARGV[2];
|
||||||
|
|
||||||
|
print "[INFO] Validating event '$id_event'\n\n";
|
||||||
|
|
||||||
|
my $result = pandora_validate_event_id ($conf, $id_event, $dbh);
|
||||||
|
exist_check($result,'event',$id_event);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Create incident.
|
# Create incident.
|
||||||
# Related option: --create_incident
|
# Related option: --create_incident
|
||||||
|
@ -3149,6 +3180,10 @@ sub pandora_manage_main ($$$) {
|
||||||
param_check($ltotal, 7, 6);
|
param_check($ltotal, 7, 6);
|
||||||
cli_validate_event();
|
cli_validate_event();
|
||||||
}
|
}
|
||||||
|
elsif ($param eq '--validate_event_id') {
|
||||||
|
param_check($ltotal, 1);
|
||||||
|
cli_validate_event_id();
|
||||||
|
}
|
||||||
elsif ($param eq '--create_incident') {
|
elsif ($param eq '--create_incident') {
|
||||||
param_check($ltotal, 7, 1);
|
param_check($ltotal, 7, 1);
|
||||||
cli_create_incident();
|
cli_create_incident();
|
||||||
|
|
Loading…
Reference in New Issue