2014-01-15 Sergio Martin <sergio.martin@artica.es>
* pandora_revent: Update unix agent pandora_revent script to be compatible with api function of last version. Incident #347 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9323 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a48c0f4211
commit
172008bac3
|
@ -1,3 +1,8 @@
|
|||
2014-01-15 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* pandora_revent: Update unix agent pandora_revent script
|
||||
to be compatible with api function of last version. Incident #347
|
||||
|
||||
2013-11-12 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* pandora_agent: Completely integrated plug-ins with modules.
|
||||
|
|
|
@ -41,11 +41,9 @@ Where options:\n
|
|||
Optional parameters:
|
||||
|
||||
[-agent <id_agent>] : Agent ID
|
||||
[-agent_name <agent>] : Set agent by name (Exact match!)
|
||||
[-user <id_user>] : User comment (use in combination with -comment option)
|
||||
[-status <status>] : 0 New, 1 Validated, 2 In process
|
||||
[-am <id_agent_module>] : ID Agent Module linked to event
|
||||
[-module_name <module>] : Name of the module linked to the event (You need <id_agent> or <agent_name>)
|
||||
[-alert <id_alert_am>] : ID Alert Module linked to event
|
||||
[-criticity <criticity>] : 0 Maintance, 1 Informative, 2 Normal,
|
||||
3 Warning, 4 Crit, 5 Minor, 6 Major
|
||||
|
@ -53,7 +51,6 @@ Optional parameters:
|
|||
[-comment <user_comment>] : Free text for comment
|
||||
[-tag <tags>] : Tag (must exist in the system to be imported)
|
||||
[-source <source>] : (By default 'Pandora')
|
||||
[-extra <id_extra>]
|
||||
[-c_instructions <critical_instructions>]
|
||||
[-w_instructions <warning_instructions>]
|
||||
[-u_instructions <unknown_instructions>]
|
||||
|
@ -67,7 +64,7 @@ Optional parameters:
|
|||
print "\t$0 -p http://192.168.70.160/pandora_console/include/api.php -u pot12,admin,pandora \
|
||||
\t-create_event -name \"Sample event executed from commandline\" -group 2 -type \"system\" -agent 2 \
|
||||
\t-user \"admin\" -status 0 -am 0 -alert 9 -criticity 3 -comment \"User comments\" -tag \"tags\" \
|
||||
\t-source \"Commandline\" -extra 3 -c_instructions \"Critical instructions\" \
|
||||
\t-source \"Commandline\" -c_instructions \"Critical instructions\" \
|
||||
\t-w_instructions \"Warning instructions\" -u_instructions \"Unknown instructions\" -owner \"other\" ";
|
||||
|
||||
print "\n\nOptions to validate event: \n\n\t";
|
||||
|
@ -180,7 +177,6 @@ sub tool_api_main () {
|
|||
help_screen ();
|
||||
} else {
|
||||
$id_group = $ARGV[8];
|
||||
$data_event = $id_group;
|
||||
}
|
||||
|
||||
#~ id group (required)
|
||||
|
@ -189,9 +185,9 @@ sub tool_api_main () {
|
|||
help_screen ();
|
||||
} else {
|
||||
$event_type = $ARGV[10];
|
||||
$data_event .= ",".$event_type;
|
||||
}
|
||||
|
||||
# -agent_name, -module_name and -extra are not supported by api. Maybe in the future
|
||||
my $i = 0;
|
||||
foreach (@ARGV) {
|
||||
my $line = $_;
|
||||
|
@ -245,8 +241,8 @@ sub tool_api_main () {
|
|||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$data_event .= ",".$id_agent.",".$agent_name.",".$id_user.",".$status.",".$id_agent_module.",".$module_name.",".$id_alert_am.",".$criticity.",".$user_comment.",".$tags.",".$source.",".$id_extra.",".$critical_instructions.",".$warning_instructions.",".$unknown_instructions.",".$owner_user;
|
||||
|
||||
$data_event .= $event_name.",".$id_group.",".$id_agent.",".$status.",".$id_user.",".$event_type.",".$criticity.",".$id_agent_module.",".$id_alert_am.",".$critical_instructions.",".$warning_instructions.",".$unknown_instructions.",".$user_comment.",".$owner_user.",".$source.",".$tags.",";
|
||||
$call_api = $api_path.'?op=set&op2=create_event&id='.$event_name.'&other='.$data_event.'&other_mode=url_encode_separator_,&apipass='.$api_pass.'&user='.$db_user.'&pass='.$db_pass;
|
||||
|
||||
} elsif ($ARGV[4] eq '-validate_event') {
|
||||
|
|
Loading…
Reference in New Issue