The Pandora FMS CLI (Command-Line Interface) is used for making calls in command line on the file:
/usr/share/pandora_server/util/pandora_manage.pl
This method is specially useful to integrate applications of thirds parts with Pandora FMS through automated tasks. Basically, it consists on one call with the parameters formated to do and action such as the creation an elimination of one agent, one module or one user, among other things.
Community version:
The CLI is a file in Perl language, to call CLI:
perl pandora_manage.pl <pandora_server.conf path > <option > <option parameters > [ optional parameters ]
With backslash \
as a line connector:
perl pandora_manage.pl \ <pandora_server.conf path > \ <option > \ <option parameters > \ [ optional parameters ]
Enterprise version:
If you are an Enterprise customer, you will need to use the binary executable instead of the .pl
, since there are some enterprise features that may not work properly with the .pl
. Just run pandora_manage
to get started.
pandora_manage <pandora_server.conf path> <option> <option parameters> [ optional parameters ]
With backslash \
as a line connector:
pandora_manage \ <pandora_server.conf path> \ <option> \ <option parameters> \ [ optional parameters ]
All examples shown here, unless implicitly stated otherwise, refer to the Enterprise version ( pandora_manage
).
'My Agent
'.[ERROR] Error:
message will be displayed followed by a description of the error. In the case of optional parameters, if there are several and you need to specify only the second and/or third and/or etcetera, use two single quotation marks together to indicate the empty optional parameters.use_alias
parameter at the end of the command line.To obtain general help with the Pandora FMS CLI use:
pandora_manage --h
To obtain help about one specific option just write option without parameters; for example for create an user:
pandora_manage /etc/pandora/pandora_server.conf --create_user
Mandatory parameters:
Optional parameters:
Created by < server_name >
.Description:
An agent with the name, the operating system, the group and the server specified will be created. Optionally, it will be possible to give it an address ( IP addres or name), a description and an interval in seconds (by default 300).
The parameter < alias as name > is set to 1
by default and, with that value, the alias will be the same as the agent name. If you want the name to be generated randomly this parameter must be set to 0
. If any of the first three optional parameters are to be omitted, use single quotation marks together for each omission.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --create_agent \ 'My agent' AIX Databases Central-Server \ 192.168.12.123 'Agent description' '' 0
Mandatory parameters:
Optional parameters:
use_alias
Description: A single given < field > of an existent agent will be updated. The possible fields are the following:
agent_name
address
description
group_name
interval
os_name
disabled
( 0
for activate it, 1
for inactivate it).parent_name
cascade_protection
( 0
for inactivate it, 1
for activate it).icon_path
update_gis_data
( 0
for inactivate it, 1
for activate it).custom_id
To identify the agent by its alias instead of its name use use_alias
just at the end.
Examples (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --update_agent \ 'My Agent' agent_name 'Agent 2'
pandora_manage /etc/pandora/pandora_server.conf --update_agent \ 'My Agent' description 'New note' \ use_alias
Version NG 758 or later.
Parameters: <id_agent> <type_field> <field_to_change> <new_value>
id_agent
→ agent identifier.field_to_change
→ name of the field to be updated.new_value
→ the value of the field to be updated.Description: updates the custom fields of an agent.
The answers of which they are composed are:
new_value
of a combo does not match the ones you have preset.X
field with the agent id Y
.Examples (see call and syntax):
TEXT TYPE:
pandora_manage /etc/pandora/pandora_server.conf --agent_update_custom_fields 1 0 'Serial number' 'john'
COMBO TYPE:
pandora_manage /etc/pandora/pandora_server.conf --agent_update_custom_fields 1 1 'Names' 'john'
Mandatory parameter:
Optional parameter:
use_alias
Description:
The agent(s) will be deleted by passing its name or alias as a parameter.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf \ --delete_agent 'My Agent' \ use_alias
Manadory parameter:
Description:
Disable all agents from an entire group. The agents of the group considered as parameter will be disabled with the execution of this option.
If you pass All
as group, all agents from all groups will be disabled.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --disable_group Firewalls
Mandatory parameter:
Description:
The agents of the group considered as parameter will be disabled with the execution of this option. If you pass 'All
' as group all agents from all groups will be enabled.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --enable_group firewalls
Mandatory parameters:
Optional paramaters:
applications
application_osx
application_osx_terminal
bricks
chart_organisation
clock
computer
database
database_gear
docker
drive_network
email
eye
firewall
heart
house
images
lightning
lock
network
plugin
printer
server_database
transmit
vmware
without_group
world
Description:
A new group will be created if it doesn't exist and optionally, can be assigned a parent group, a icon (the icon name without extension, choose one from list above) and description. The parent group by default is 'All
' and the default icon is empty string (without icon).
If you need to add a description:
All
as fill parameter.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --create_group \ 'New group name' \ Web computer 'New description.'
Mandatory parameter:
Description:
Delete an agent group.
Every agent belongs to indicated group will be deleted too.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf –-delete_group 'Group name'
Mandatory parameters:
Optional parameters:
applications
application_osx
application_osx_terminal
bricks
chart_organisation
clock
computer
database
database_gear
docker
drive_network
email
eye
firewall
heart
house
images
lightning
lock
network
plugin
printer
server_database
transmit
vmware
without_group
world
Description: A group is modified by its numerical identifier. Parameters that can be modified:
You must type exactly same existing parameters for only modify description field.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf –update_group 18 \ 'Group name' 'Web' 'transmit' 'Description'
Mandatory parameter:
Description:
Stop a planned downtime. If the downtime is finished, a message will be showed. Returning messages:
[ERROR] Planned_downtime < downtime_name > cannot be stopped
.[INFO] Planned_downtime < downtime_name > is already stopped
.[INFO] Stopping planned downtime < downtime_name >
Example (see call and syntax):
pandora_manage.pl /etc/pandora/pandora_server.conf --stop_downtime 'Downtime name'
Required parameter:
Optional parameter:
use_agent_alias
To identify the agent by its alias instead of its name, use use_agent_alias
right at the end.
Description: Get the status of a given agent by its name or alias.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --get_agent_status 'agent name'
Required parameter:
Optional parameter:
use_agent_alias
To identify the agent by its alias instead of its name, use use_agent_alias
right at the end.
Description: Get the group of a given agent by its name or alias.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --get_agent_group 'agent_name'
Required parameter:
Optional parameter:
use_agent_alias
To identify the agent by its alias instead of its name, use use_agent_alias
right at the end.
Description: Get the identification group of a given agent by its name or alias.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --get_agent_group_id 'agent name'
Required parameter:
Optional parameter:
use_agent_alias
To identify the agent by its alias instead of its name, use use_agent_alias
right at the end.
Description: Get the modules (identifications and names, separated by a comma) of a given agent by its name or alias.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --get_agent_modules 'agent name'
Required parameter: None. To get help for such a command you can use (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --get_agents '' '' '' '' '' '' '' ''
You will get the following response indicating that it exceeds the number of parameters:
[ERROR] Parameters error: 8 received | 0-7 necessary. Pandora FMS CLI 7.0NG.764 Build 220930 Copyright (c) 2013-2021 Artica ST This program is Free Software, licensed under the terms of GPL License v2 You can download latest versions and documentation at http://www.pandorafms.org [*] Pandora FMS Enterprise module loaded. Available options for --get_agents: --get_agents [<group_name> <os_name> <status> <max_modules> <filter_substring> <policy_name> <use_alias>] : Get list of agents with optative filter parameters.
Optional parameters: Allow filtering the list of agents in a serialized format where the order matters, use two single quotes to skip parameter(s). They are numbered here for better control and visualization:
critical
, warning
, unknown
, normal
.use_agent_alias
).use_agent_alias
Description: Get all agents (without parameters) or agents according to a filter.
Examples (see call and syntax):
Network
group:pandora_manage /etc/pandora/pandora_server.conf --get_agents 'Network' '' '' '' '' ''
Linux
as operating system:pandora_manage /etc/pandora/pandora_server.conf --get_agents '' 'Linux' '' '' '' ''
normal
:pandora_manage /etc/pandora/pandora_server.conf --get_agents '' '' 'normal' '' '' ''
pandora_manage /etc/pandora/pandora_server.conf --get_agents '' '' '' '0' '' ''
Servers
group:pandora_manage /etc/pandora/pandora_server.conf --get_agents 'Servers' '' '' '0' '' ''
test
in their alias:pandora_manage /etc/pandora/pandora_server.conf --get_agents '' '' '' '' 'test' '' use_agent_alias
Parameters: <agent_alias> [ strict
]
Description: List id and alias of agents matching given alias. Using strict
limits search only to exact alias.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_agents_id_name_by_alias 'station'
(>=5.0)
Parameters: <agent_name> <use_agent_alias>
Description: The conf file of one agent will be deleted
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_conf_file 'Agent name'
(>=5.0)
Parameters: [<agent_name> <use_agent_alias>]
Description: The conf file of one or all agents (without parameters) will be cleaned (All modules, policies, file collections and comments will be deleted).
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --clean_conf_file 'Agent name'
Parameters: None.
Description:
server_ip
server_path
temporary
logfile
[WARN] Can't open file < path_file >
.[WARN] File not exist < path_file >
.[INFO] No bad files found
Examples:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_bad_conf_files
Example output:
(>=7.21) only for metaconsole
Parameters: [id of the agent to migrate][name of the source node][name of the destination node][optional parameter by default this 0 will migrate the data of both the history and the db itself if it is at 1 it will only migrate those of the db itself]
Description: Add an agent to the migration queue to move from node to another node this is for the metaconsole only. To do it correctly, you will need to fill in the API configuration parameters in pandora_server.conf.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --migration_agent_queue 1 nodo1 nodo2 0
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
(>=7.21) only for metaconsole Parametrizes: [id of the agent to check]
Description: it will return true or false depending on whether the agent entered exists in the agent migration table
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --migration_agent 1
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <downtime_name> <description> <date_from> <date_to> <id_group> <monday (0|1)> <tuesday (0|1)><wednesday (0|1)> <thursday (0|1)> <friday (0|1)> <saturday (0|1)> <sunday (0|1)> <periodically_time_from HH:MM:SS><periodically_time_to HH:MM:SS> <periodically_day_from> <periodically_day_to><type_downtime> <type_execution> <type_periodicity> <id_user>
Description: Created Planned downtime.
pandora_server.conf
.MM/DD/YYYY
(Month/Day/Year) for this call to work properly.Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_downtime Testing Testing 05/07/2022 06/07/2022 0 1 1 1 1 1 1 1 17:07:00 18:08:00 1 31 quiet periodically weekly 7
Mandatory parameters:
Description:
Records will be added to a scheduled stop with the submitted data. Write the list of agent identifiers and the list of module names without leaving spaces between the commas that separate the components of both lists. If a module name contains spaces, enclose the module name in two single quotes. If two or more agents are passed, it is assumed by default that you want to add common modules, otherwise it will display a warning message.
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --add_item_downtime 1 1 Status,'Available Memory'
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Mandatory parameters:
Optional parameters:
quiet
disable_agents
disable_agents_alert
once
periodically
weekly
monthly
Description:
List all matches of planned downtime. See Scheduled downtimes options.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --get_all_planned_downtimes ''
Mandatory parameters:
Optional parameters:
quiet
disable_agents
disable_agents_alert
once
periodically
weekly
monthly
Description:
List all of items that matches planned downtime name. See Scheduled downtimes options.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --get_planned_downtimes_items 'Name downtime'
Mandatory parameter:
Description:
Delete a planned downtime especified by ID. Some return messages:
This planned downtime is deleted
Problems with this planned downtime
The scheduled downtime is still being executed
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --set_planned_downtimes_deleted 7
Required parameters:
Optional parameter:
1
for enable agent, 0
for disabled.Description: Disable an agent and, if it has remote configuration, set to standby mode.
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Example (see call and syntax):
perl pandora_manage.pl /etc/pandora/pandora_server.conf --set_disabled_and_standby 2 0 1
pandora_manage /etc/pandora/pandora_server.conf --set_disabled_and_standby 2 0 0
pandora_manage /etc/pandora/pandora_server.conf --set_disabled_and_standby 2 1 1
pandora_manage /etc/pandora/pandora_server.conf --set_disabled_and_standby 2 1 0
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <id_agent>
Description: Synchronizes module counts and alerts for a given agent. If you want to synchronize with all agents, the first parameter must be “All”.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --reset_agent_counts "All"
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Mandatory parameters:
Optional parameters:
None.
Description: Updates an agent's GIS data.
Examples (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --insert_gis_data 1 2 3 4
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Mandatory parameters:
Optional parameters:
Description: Gets an agent's GIS data.
Examples (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --get_gis_agent 1
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Mandatory parameters:
Optional parameters:
Description: Add or change operating system (and obsolescence) to an agent.
Examples (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --cli_agent_set_os 7 3 'Ubuntu 16.04'
Required parameters:
Optional parameters:
use_agent_alias
Description: A module kind data will be created in an agent with the module name, kind of module and name of the agent where it will be created. Optionally it will be possible to give a description, the module group, etc.
The module definition file will contain some like this:
module_begin module_name My module module_type generic_data module_exec cat /proc/meminfo | grep MemFree | awk '{ print $2 }' module_end
The default values are 0
for the minimum and maximum, history_data and post_process; 300
for the interval.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --create_data_module 'My module' generic_data 'My agent' 'Module description' 'General' 1 3 0 300 0 0 0 0 1 /home/user/definition_file 'warning text' 'critical text'
If you introduce a different name or kind between the parameters and the file definition, the fixed on the file will have priority.
Parameters: <module_name> <module_kind> <agent_name> [<description> <module_group> <min> <max>[<post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> <history_data> <retries> <requests> <agent_browser_id> <auth_server> <auth_realm> <fichero_definicion> <proxy_url> <proxy_auth_login> <proxy_auth_password> <warning_str> <critical_str> <enable_unknown_events> <ff_threshold> <each_ff> <ff_threshold_normal> <ff_threshold_warning> <ff_threshold_critical> <ff_timeout> <ff_timeout> <warning_inverse> <critical_inverse> <critical_instructions> <warning_instructions> <unknown_instructions>] <use_agent_alias>
Description: A web data module will be created in an agent with the module name, kind of module and name of the agent where it will be created. Optionally it will be possible to give a description, the module group, min and max values, a post_process value, an interval in seconds, min and max warning values, min and max critical values, a history data value and one module definition file among others.
The module definition file will contain some like this:
task_begin get http://pandorafms.com task_end
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_web_module 'nodule_name' web_data 'pandorafms' 'module_description' 'General' 0 100 0 300 0 0 0 0 1 0 1 'Pandora FMS' auto public /home/user/ficherodefinicion 'http://proxy.url' 'proxy_login' 'proxy_password' 1 10 10 10 10 10 10 10 10 1 1 'critical_instructions' 'warning_instructions' 'unknown_instructions'
Parameters: <module_name> <module_kind> <agent_name> <module_address> [<module_port> <description> <module_group> <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> <history_data> <ff_threshold> <warning_str> <critical_str> <enable_unknown_events> <each_ff> <ff_threshold_normal> <ff_treshold_warning> <ff_threshold_critical> <critical_instructions> <warning_instructions> <unknown_instructions>] <use_agent_alias>
Description:
A network module will be created in an agent with the module name, kind of module, name of the agent where it will be created and the module address specified. Optionaly, it will be possible to give it a port, a description, values min and max, a post_process value, an interval in seconds, a warning min and max values, critical min and max values and a history data value.
The default values are 0 for the min and max, history_data and post_process an another 300 for the interval.
the port is optional, so the modules kind ICMP don't need it. In the rest of kinds, it is necessary to specify one module.
Notes:
The next parameters are only for the Pandora version 5 and next versions:
The next parameters are only for the Pandora version 5.1 and next versions:
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_network_module 'My module' remote_tcp 'My agent' 192.168.12.123 8080 'Module description' 'General' 1 3 0 300 0 0 0 0 1 'string for warning' 'string for critical'
Parameters: <network_component_name> <network_component_group> <network_component_type> [<description> <module_interval> <max_value> <min_value> <snmp_community> <id_module_group> <max_timeout> <history_data> <min_warning> <max_warning> <str_warning> <min_critical> <max_critical> <str_critical> <min_ff_event> <post_process> <disabled_types_event> <each_ff> <min_ff_event_normal> <min_ff_event_warning> <min_ff_event_critical>]
Description:
A network component will be created. Optionaly, it will be possible to give it a port, a description, values min and max, a post_process value, an interval in seconds, a warning min and max values, critical min and max values and a history data value.
The default values are 0 for the min and max, history_data and post_process an another 300 for the interval.
the port is optional, so the modules kind ICMP don't need it. In the rest of kinds, it is necessary to specify one module.
Notes:
The next parameters are only for the Pandora version 5 and next versions:
The next parameters are only for the Pandora version 5.1 and next versions:
Example:
perl /tmp/pandorafms/pandora_server/util/pandora_manage.pl /etc/pandora/pandora_server.conf --create_network_component "example_name" 2 7
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <module_name> <module_type> <agent_name> <module_address> <module_port> <version> [<community> <oid> <description> <module_group> <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> <history_data> <snmp3_priv_method> <snmp3_priv_pass> <snmp3_sec_level> <snmp3_auth_method> <snmp3_auth_user> <snmp3_auth_pass> <ff_threshold> <warning_str> <critical_str> <unknown_events> <each_ff> <ff_threshold_normal> <ff_threshold_warning> <ff_threshold_critical> <timeout> <retries> <use_alias>]
Description:A module kind snmp will be created in an agent with the module name, module kind, name of the agent where it will be created, the module address, the associated port and the SNMP version especified. Optionally it will be given a community, am OID, a description, the module group, min and max values, a post_process value, an interval in seconds, min and max values, critical min and max values, an history data value, and the snmp3 values like methods, passwords, etc.
The default values are 0 for the min and max, history_data and post_process and 300 for the interval.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_snmp_module 'My module' remote_snmp_inc 'My agent' 192.168.12.123 8080 1 mycommunity myoid 'Module description'
Parameters: <module_name> <module_kind> <agent_name> <module_address> <module_port> <plugin_name> <user> <password> <parameters> [<description> <module_group> <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> <history_data> <ff_threshold> <warning_str> <critical_str> <enable_unknown_events> <each_ff> <ff_threshold_normal> <ff_treshold_warning> <ff_threshold_critical> <critical_instructions> <warning_instructions> <unknown_instructions>] <use_agent_alias>
Description: A module kind plugin will be created in an agent with the module name, module kind, name of the agent where it will be created, the module address, the associated port and the corresponding plugin name. Optionally it will be possible to give it a description, the module group, min and max values, a post_process value, an interval in seconds, values warning min and max, critical values min and max and a history data value.
The values by default are 0 for min and max, history_data and post_process and 300 for the interval.
Notes:
The next parameters are only for the Pandora version 5 and next versions:
The next parameters are only for the Pandora version 5.1 and next versions:
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_plugin_module 'My module' generic_data 'My agent' 192.168.12.123 8080 myplugin myuser mypass 'param1 param2 param3' 'Module description' 'General' 1 3 0 300 0 0 0 0 1 'string for warning' 'string for critical'
Parameters: [<nombre del grupo de módulo>]
Description: Displays the available module groups. We can filter by adding the name of the group or part of it.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_module_group "grupo de módulos"
Parameters: <module_group_name>
Description: A module group will be created with the module_group_name
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_module_group 'My module group'
Parameters: <server_name_1|server_name_2|…server_name_n> [<return_type>]
Description: The groups of modules of the goal will be synchronized with the nodes that have been specified in the first parameter, separated with “|”. Optionally you can indicate in the second parameter the format in which the data will be returned (csv or json). By default they will come in csv format.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --module_group_synch "server_name1|server_name2|server_name3" "json"
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <module_name> <synthetic_type> <agent_name> <opts> <use_agent_alias>
Where <synthetic_type> can be “arithmetic” or “average”.
Examples
pandora_manage /etc/pandora/pandora_server.conf --create_synthetic example_module arithmetic example_agent <opts> pandora_manage /etc/pandora/pandora_server.conf --create_synthetic example_module average example_agent <opts>
Let's explain all the posible parameters that can be used on the <opts»
Examples
pandora_manage /etc/pandora/pandora_server.conf --create_synthetic example_module arithmetic example_agent my_agent,+,my_module my_agent2,-,my_module2 pandora_manage /etc/pandora/pandora_server.conf --create_synthetic example_module arithmetic example_agent my_agent,+,my_module *,10 pandora_manage /etc/pandora/pandora_server.conf --create_synthetic example_module average example_agent my_agent,x,my_module my_agent,x,my_module2
On the first example, we will create in the agent example_agent an arithmetic type of module named example_module. Its content will be the result of the operation: my_module - my_module2. On the second example, we will create in the agent example_agent an arithmetic type of module named example_module. Its content will be the result of the operation: my_module * 10. On the third example, we will create in the agent example_agent an average type of module named example_module. Its content will be the average value betwee my_module and my_module2.
The first operator that is used, on the previous case between my_agent and my_module (+), is ignored and doesn't affect to the result of the operations, but it is needed due to the internal structure of the tool. It's very important to keep into account that the arithmetic operation will be done with the next (in this case, the second) operator, on the current example, between my_agent2 and my_module2, or right before the value 10 (in this case, operators “-” or “*”). The possible operators are:
Note:
Available in Pandora 5.1 SP4 and above
Example:
pandora_manage /etc/pandora/pandora_server.conf –create_synthetic memory_sum arithmetic nodo51sp3 production1,+,AvailableMemory production2,+,AvailableMemory
pandora_manage /etc/pandora/pandora_server.conf --create_synthetic traffic_difference arithmetic nodo51sp3 nodo51sp3,+,InputTraffic nodo51sp3,-,OutputTraffic
Mandatory parameters:
Optional parameter:
use_alias
Description: A module will be removed from an agent by passing the name of both as a parameter. In case this module is in a local agent, it will also be deleted from the configuration file if the Enterprise version is available. From version 771 on wards, the descendants of the deleted module are deleted recursively.
Examples (see call and syntax):
pandora_manage.pl /etc/pandora/pandora_server.conf --delete_module 'My module' 'My agent'
Parameters: <server_name> <agent_name> <module_name> <module_type> <module_new_data> [<datehour>] <use_agent_alias>
Description: It'll be send data to an agent module giving it as parameter the server name, the agent, the module name, the type of module amd the new data to be inserted. Optionally, it'll be possible to send the date-hour that will be as that of the data sending with 24 hours format: 'YYY-MM-DD HH:mm'. In the case of not sending this parameter, the current data will be shown.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --data_module Servidor-General 'My agent' 'My modulo' 'generic_data' 1 '2010-05-31 15:53'
(>=5.0)
Parameters: <agent_name> <module_name> <interval> [<csv_separator>] <use_agent_alias>
Description: Will be returned the data of a module as 'timestamp data' in CSV format of the last X seconds (interval) using as default separator ';'
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_module_data 'agent name' 'module name' 86400 ':'
Parameters: <agent_id> <module_name>
Description: The id of a module of an agent is returned.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_module_id 4 'host alive'
Parameters: <agentmodule_id>
Description: The value of the field Custom ID of a specific module of an agent will be returned.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_module_custom_id 4
Parameters: <agentmodule_id> [<custom_id>]
Description: The value of the field Custom ID of a specific module of an agent will be inserted. If it is left blank it will eliminate the content that would have previously left the field empty.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --set_module_custom_id 4 '21'
Parameters: <module_name> <agent_name> | -a <agent_name> | -g <group_name> <use_agent_alias>
Description: All data associated to a module will be deleted from the historical data in case of having as parameter -m and the name of this one and its agent name; from the agent modules if as parameter the option '-a' is given, and the agent or modules name of all agents from a group, if as parameter the option '-g' and the group name is given.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf –delete_data -a 'My agent'
In this example all historic data will be deleted from all modules that belongs to the 'My agent' agent.
Parameters: <module_name> <agent_name> <field_to_update> <new_value> <use_agent_alias>
Description: A given field of an existent data module will be updated. The module type will be detected to allow update the specific fields for each type.
The possible fields are the following:
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --update_module 'Module name' 'Agent name' description 'New description'
Parameters: <agent_name> <module_name> <tag_name>
Description: Add a tag to the given module.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --add_tag_to_module 'Agent name' 'Module name' 'Tag name'
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
(>=5.0)
Parameters: <module_name>
Description: Get the agent and current data of all the modules with a given name.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_agents_module_current_data 'Module name'
(>=5.0)
Parameters: <agent_name> <component_name> <use_agent_alias>
Description: Create a new network module in the specified agent from a network component.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_network_module_from_component 'Agent name'
(>=5.1)
Parameters: <agent_name> <component_name> <use_agent_alias>
Description: Create a new data module in the specified agent from a local component.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_data_module_from_local_component 'Agent name' 'My local component'
(>=5.1)
Parameters: <component_name> [<description> <id_os> <os_version> <id_network_component_group> <type> <min> <max> <module_interval> <id_module_group> <history_data> <min_warning> <max_warning> <str_warning> <min_critical> <max_critical> <str_critical> <min_ff_event> <post_process> <unit> <wizard_level> <critical_instructions> <warning_instructions> <unknown_instructions> <critical_inverse> <warning_inverse> <id_category> <disabled_types_event> <tags> <min_ff_event_normal> <min_ff_event_warning> <min_ff_event_critical> <each_ff> <ff_timeout>]
Description: Create a new local component.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_local_component 'New local component' 'module_begin\nmodule_name name\nmodule_type generic_data\nmodule_exec exec\nmodule_end'
Parameters: [<id_template> <id_agent>]
Description: Tis module templates are an agrupation that contenais network modules. This templates can be applied directly to agents, without having to include each module onw by one.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --apply_module_template 1 1
Parameters: <template_name> <module_name> <agent_name> <use_agent_alias>
Description: A template will be assigned to an agent module giving it the template name, the module and the agent as parameters.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_template_module template001 'My module' 'My agent'
Parameters: <template_name> <module_name> <agent_name> <use_agent_alias>
Description: it'll be unassigned a module template of one agent giving it the template name, the module and the agent as parameters.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_template_module plantilla001 'Mi modulo' 'Mi agente'
Parameters: <action_name> <template_name> <module_name> <agent_name> [<fires_min> <fires_max>] <use_agent_alias>
Description: It'll be added an action to an alert giving as parameter the name of the action and that of the template, module and agent that composes the alert. It'll be also possible giving it in an optional way the values of scaling fires_min and fires_max ( by default 0).
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_template_action action012 template001 'My module' 'My agent' 0 4
Parameters: <action_name> <template_name> <module_name> <agent_name> <use_agent_alias>
Description: It'll be added an action to an alert giving as parameters the names of the action, template, module and agent that composes the alert.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_template_action action012 template001 'My module' 'My agent'
Parameters: No
Description: All alerts will be disabled with the execution of this option.If when it's executed we have any alert disabled and we activate all again, this one will be also enabled.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --disable_alerts
Parameters: No
Description: All the alerts will be activated with the execution of this option. If when it's executed we had any alert enabled and we disabled all again, this one will be also disabled.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --enable_alerts
Parameters: <template_name> <condition_type_serialized> <time_from> <time_to> [<description> <group_name> <field1> <field2> <field3> <priority> <default_action> <days> <time_threshold> <min_alerts> <max_alerts> <alert_recovery> <field2_recovery> <field3_recovery> <condition_type_separator>]
Description: An alert template will be created.
The field <condition_type_serialized> is the type options of the template serialized with the separator ';' by default. It's possible change the separator with the parameter <condition_type_separator> to avoid conflicts some options if it could contain the default character.
The possibilities are the following:
NOTE: In this examples is used the default separator ';' and the field matches_value is a binary value to set if the alert will be fired when the value match or when the value not match with the conditions.
The field <days> is seven binary characters that specify the days of the week when the alert will be activated. i.e.: 0000011 to activate the alert only Saturday and Sunday.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf.2011-10-25 --create_alert_template 'template name' "max_min@1@3@5" 09:00 18:00 "Email will be sended when the value is in the interval 3-5, between 9AM and 6PM, and only the Mondays. Separator is forced to @" "Unknown" "[email protected]" "subject" "message" 3 "Mail to XXX" 1000000 38600 1 2 0 // // @
(>=5.0)
Parameters: <template_name>
Description: An alert template will be deleted if exists.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_alert_template 'Template name'
(>=5.0)
Parameters: <template_name> <field_to_update> <new_value>
Description: A given field of an existent alert template will be updated. The possible fields are the following: name, description, type, matches_value, value, min_value, max_value, time_threshold(0-1), time_from, time_to, monday(0-1), tuesday(0-1), wednesday(0-1), thursday(0-1), friday(0-1), saturday(0-1), sunday(0-1), min_alerts, max_alerts, recovery_notify(0-1), field1, field2, field3, recovery_field2, recovery_field3, priority(0-4), default_action, group_name.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --update_alert_template 'Template name' priority 4
(>=5.0)
Parameters: [<action_name> <separator> <return_type>]
Description:Returns all action alerts. Optionally you can filter the result by name. Optionally in the second parameter you can specify the separator of the results and in the third parameter the format of the returned list (csv, json, string).
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_alert_actions 'Action 1' ';' 'json'
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
(>=5.0)
This feature is in Metaconsole.
Parameters: [<server_name> <action_name> <separator> <return_type>]
Description: returns all alert actions of the meta console. Optionally you can filter the result by the name of the node or by the name of the action. Optionally in the second parameter you can specify the results separator and in the third parameter the format of the returned list (csv, json, string).
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_alert_actions_meta // 'Action 1' ';' 'json'
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
(>=5.0)
Parameters: <name> <command> [<group|name> <description> <internal> <field_description> <field_value>]
Description: A command will be created with the specified name and command data. Optionally you can specify:
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_alert_command 'PRUEBA' 'command' 'All' 'Desc' '1' '["des1","des2","des3","","des5","","","","",""]' '["val1","val2","val3","val4","","","","","",""]'
(>=5.0)
Parameters: [<name|<command> <group name> <description> <internal>]
Description: Allows you to view all alerts. Optionally you can filter the result by: name, command, group, description or if it is internal (1-0). In the case of the name, command and description it is not necessary to enter the exact data.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_alert_commands "command_name"
Parameters: <template_name> <agent_id> <module_id> [ use_alias
]
Description: Validate an alert given a template name, an agent ID and a module ID. Instead use only an agent ID you may use name agent with last parameter use_alias
(maybe for validate multiple alerts).
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --validate_alert 7 10 15
(>=5.0)
Parameters: None
Description: Validate all the alerts.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --validate_all_alerts
(>=5.1)
Parameters: <special_day> <same_day> <description> <group_name>
Description: Create a special day. The possible same_days are monday, tuesday, wednesday, thursday, friday, saturday and sunday.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_special_day 2014-05-03 sunday Desc All
(>=5.1)
Parameters: <special_day>
Description: Delete specified special day.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_special_day 2014-05-03
Parameters: <value>
Description: Enable (1
) or disable (0
) event storm protection.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --set_event_storm_protection 1
(>=5.1)
Parameters: <special_day> <field_to_change> <new_value>
Description: Update specific field of a special day with new value. The possible fields are same_day, description and group_name. When same_day is set, possible new_values are monday, tuesday, wednesday, thursday, friday, saturday and sunday.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --update_special_day 2014-05-03 same_day monday
NG 766 version or later: This function also works in Metaconsole.
Required parameters:
Optional parameters:
Description:
A user will be created with the user ID (which will also be the user name) and the password received. In addition a binary value ( < is_admin > 0
false or 1
true) will be received specifying whether the user will be an superadmin or not. Optionally a comment about the created user can be added.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --create_user user9500 'user 9500' 0 'This user has the password "user 9500"'
NG 766 or later: This function also works in Metaconsole.
Required parameter:
Description:
An user will be eliminated giving its name as parameter.
Example (see call and syntax):
pandora_manage.pl /etc/pandora/pandora_server.conf --delete_user user02
NG 766 or later: This function also works in Metaconsole.
Required parameters:
Description:
A given field of an existent user will be updated. The possible fields are the following:
email
.phone
.language
, possible values:default
, English US.ca
, Catalan.en_GB
, English UK.es
, Spanish.fr
, French.ru
, Russian.ja
, Japanese.zh_CN
, Chinese.id_skin
(only works in Enterprise version) Change skin graphical for user.comments
.fullname
.password
.Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --update_user 'user 9500' password 'XYZ'
NG 766 or later: This function also works in Metaconsole.
Required parameter:
Description:
An existent user will be enabled. If it's already enabled, will showed only a message.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --enable_user 'user 9500'
NG 766 or later: This function also works in Metaconsole.
Required parameter:
Description:
An existent user will be disabled. If it's already disabled, will showed only a message.
Example (see call and syntax):
pandora_manage.pl /etc/pandora/pandora_server.conf --disable_user 'user 9500'
NG 766 or later: This function also works in Metaconsole.
Required parameters:
1
or 0
for otorgate or deny right, respectively. They are numbered so:Descripción:
A new profile will be created by passing the profile name and permissions as parameters. All fields are required.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --create_profile Profile01 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NG 766 or later: This function also works in Metaconsole.
Required parameters:
1
or 0
for otorgate or deny right, respectively. They are numbered so:Descripción:
A existent profile will be updated by passing the profile name and permissions as parameters. All fields are required.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --update_profile Profile01 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NG 766 or later: This function also works in Metaconsole.
Required parameters:
Description:
A profile will be added to an user giving it as parameter the names of user, profile an group on which they will have the privileges of this profile. You should specify the group All
if you want that the profile has validity on all groups.
Example (see call and syntax):
pandora_manage.pl /etc/pandora/pandora_server.conf --add_profile usuario002 'Group coordinator' All
Parameters: <user_id> <tag_name> <group_name> <profile_name>
Description: Add a tag to the given user profile.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --add_tag_to_user_profile '7' 'new tag' 'All' 'Profile for user 7'
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
NG 766 or later: This function also works in Metaconsole.
Required parameters:
Description:
An user profile will be deleted giving it as parameter the names of user, profile and group on which the profiles has the priviledges. If the profile to delete is associated to the All
group, we should specify as group All
.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --delete_profile user02 'Chief Operator' Applications
NG 766 or later: This function also works in Metaconsole.
Required parameters:
Optinal parameter:
Description:
Add a existing profile in group to a user. If the group is not provided, the grupo will be All
.
Example (see call and syntax):
pandora_manage.pl /etc/pandora/pandora_server.conf --add_profile_to_user 'user01' 'Chief Operator' 'Network'
Parameters: Nothing.
Description: The Enterprise mode ACL system will be disabled in the configuration with the execution of this option.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --disable_eacl
Parameters: Nothing.
Description: The Enterprise mode ACL system will be enabled in the configuration with the execution of this option.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --enable_eacl
Mandatory parameter: <id_user>
Description: The double authentication will be disabled for the specified user.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --disable_double_auth 'admin'
Mandatory parameters:
unknown
, alert_fired
, alert_recovered
, alert_ceased
, alert_manual_validation
, recon_host_detected
, system
, error
, new_agent
, going_up_warning
, going_up_critical
, going_down_normal
, going_down_warning
, going_down_critical
, going_up_normal
, configuration_change
.Optinal parameters:
0
if it isn't validated, 1
if is validated and 2
in process).0
(Maintenance), 1
(Informational), 2
(Normal), 3
(Warning), 4
(Critical), 5
(Minor) y 6
(Major).{“Location”: “Office”, “Priority”: 42}
.use_alias
. Se deben especificar dos comillas simples juntas, sin espacio entre ellas) si utiliza el siguiente parámetro a continuación.Description:
An event will be created with these data: the name and kind of the event, name of the module, agent and group associated.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --create_event \ 'Event CLI' \ system \ Firewalls \ 'My agent' 'My module' 0 4 Template004 \
Parameters: <agent_name> <module_name> <datehour_min> <datehour_max> <name_user> <criticity> <template_name> <use_agent_alias>
Description: All events will be validated considering a group of filters. The configurable filters are: the agent name, the module name, date-hour minimum and date-hour maximum, the user name, the severity and the name of the associated template.
It's possible to combine the parameters in several ways, leaving blank with empty inverted commas () the ones that you don't want to use and filling in the rest. Example: perl pandora_manage.pl /etc/pandora/pandora_server.conf –validate_event 'My agent' 'My module' '2010-06-02 22:02'
In this example will be validated all the events associated to the module 'Mi module' of the agent 'My agent' which data would be previous to 2 june 2010 not considering the rest of the filters. It would be also possible to filter the events between two dates filling both of them or the ones that have a data higher to an specific one, filling in only the date-hour minimum.
(>=5.0)
Parameters: <id_event>
Description: A event will be validated.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --validate_event_id 1894
In this example, will be validated the event whose identifier is 1894.
(>=5.0)
Parameters: <id_event>[<separator]
Description: Display info about a event given a id.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_event_info 1894
In this example, will be displayed info about the event whose identifier is 1894. The fields will be separated by |
Required parameters:
Description:
Add a comment to an event.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --add_event_comment 1234 admin TEXT
In this example, comment TEXT
by admin
will be added to the event whose identifier is 1234
.
Parameters: <id_event>
Description: Set event in progress.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --event_in_progress 123
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Required parameters:
Description:
It adds a custom identifier to an event.
Example (see call and syntax):
pandora_manage /etc/pandora/pandora_server.conf --update_event_custom_id '232' 'CLI test'
Parameters: <policy_name> <group> <description>
Description: A policy will be created with policy name, group and description. The description is not mandatory.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_policy 'My policy' 'My group' 'Description'
Parameters: <policy_name>
Description:A policy passed as parameter will be forcibly applied. Within the process of applying a policy is: the creation of the modules of the policy in all its associated agents, the creation of the alerts of the policy in the created modules, and the accomplishment of changes in the configuration file of the local agents that the policy may have to add the created modules and the collections associated to the policy.
As this command works through the API, it needs the following parameters:
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --apply_policy 'policy_id' 'agent_id' 'other1|other2'
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
(>=5.0)
Parameters: None
Description: Add to the application queue all the policies. The server is who watch the queue and apply the policies
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --apply_all_policies
(>=5.0)
Parameters: <agent_name> <policy_name> <use_agent_alias>
Description: An existent group will be added to an existent policy
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --add_agent_to_policy 'Agent name' 'Policy name'
Parameters: <policy_name> <collection_name>
Description: An existent collection will be added to an existent policy
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --add_collection_to_policy 'Policy name' 'Collection name'
Description: Recreate the files of a collection. Returns [INFO] Collection recreated successfully.
otherwise [ERROR] Collection not recreated.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --recreate_collection 7
Parameters: <policy_name> <component_name>
Description: A module will be created from a local component to a policy
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_policy_data_module_from_local_component 'Policy name' 'Component name'
Parameters: Nothing.
Description: All modules that doesn't belong to any policy will be deleted both from the database and the agent configuration file (if there is one).
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_not_policy_modules
Parameters: <id_policy> <id_agent>
Description:Removes an agent from a policy. It is necessary to specify the id of the policy and the id of the agent to be deleted.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --remove_agent_from_policy '11' '2'
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <policy_name>
Description: All the alerts from a policy passed by parameter will be flagged as disabled
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --disable_policy_alerts 'My policy'
(>=5.0)
Parameters: <policy_name> <module_name> <module_type> [<description> <module_group> <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> <history_data> <data_configuration> <warning_str> <critical_str> <enable_unknown_events> <ff_threshold> <each_ff> <ff_threshold_normal> <ff_threshold_warning> <ff_threshold_critical> <ff_timeout> <critical_instructions> <warning_instructions> <unknown_instructions>
Description: A policy data module will be created. The default values are the same of –create_data_module option
Notes:
The next parameters are only for the Pandora version 5.1 and next versions:
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_policy_data_module 'policy name' 'module name' generic_proc 'module description' 'group name' 0 100 0 300 30 60 61 100 0 "module_begin\nmodule_name modname\nmodule_end" 'string for warning' 'string for critical'
(>=7.0)
Parameters: <policy_name> <module_name> <module_type> [<description> <module_group> <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> <history_data> <retries> <requests> <agent_browser_id> <auth_server> <auth_realm> <configuration_data> <proxy_url> <proxy_auth_login> <proxy_auth_password> <warning_str> <critical_str> <enable_unknown_events> <ff_threshold> <each_ff> <ff_threshold_normal> <ff_threshold_warning> <ff_threshold_critical> <ff_timeout> <warning_inverse> <critical_inverse> <critical_instructions> <warning_instructions> <unknown_instructions>]
Description: A policy web module will be created. The default values are the same of –create_web_module option
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_policy_web_module 'policy_name' 'module_name' web_data 'module_description' 'General' 0 100 0 300 0 0 0 0 1 0 1 'Pandora FMS' auto public "module_begin\nmodule_name modname\nmodule_end" 'http://proxy.url' 'proxy_login' 'proxy_password' 1 10 10 10 10 10 10 10 10 1 1 'critical_instructions' 'warninng_instructions' 'unknown_instructions'
(>=5.0)
Parameters: <policy_name> <module_name> <module_type> [<module_port> <description> <module_group> <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> <history_data> <ff_threshold> <warning_str> <critical_str> <enable_unknown_events> <each_ff> <ff_threshold_normal> <ff_threshold_warning> <ff_threshold_critical> <critical_instructions> <warning_instructions> <unknown_instructions>]
Description: A policy network module will be created. The default values are the same of –create_network_module option
Notes:
The next parameters are only for the Pandora version 5.1 and next versions:
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_policy_network_module 'policy name' 'module name' remote_icmp_proc 22 'module description' 'group name' 0 100 0 300 30 60 61 100 0 0 'string for warning' 'string for critical'
(>=5.0)
Parameters: <policy_name> <module_name> <module_type> <module_port> <version> [<community> <oid> <description> <module_group> <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> <history_data> <snmp3_priv_method> <snmp3_priv_pass> <snmp3_sec_level> <snmp3_auth_method> <snmp3_auth_user> <snmp3_priv_pass> <ff_threshold> <warning_str> <critical_str> <enable_unknown_events> <each_ff> <ff_threshold_normal> <ff_threshold_warning> <ff_threshold_critical> <critical_instructions> <warning_instructions> <unknown_instructions>]
Description: A policy SNMP module will be created. The default values are the same of –create_snmp_module option
Notes:
The next parameters are only for the Pandora version 5.1 and next versions:
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_policy_snmp_module 'policy name' 'module name' remote_snmp_inc 8080 1 mycommunity myoid 'Module description'
(>=5.0)
Parameters: <policy_name> <module_name> <module_kind> <module_port> <plugin_name> <user> <password> <parameters> [<description> <module_group> <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> <history_data> <warning_str> <critical_str> <enable_unknown_events> <each_ff> <ff_threshold_normal> <ff_threshold_warning> <ff_threshold_critical> <critical_instructions> <warning_instructions> <unknown_instructions>]
Description: A policy plugin module will be created. The default values are the same of –create_plugin_module option
Notes:
The next parameters are only for the Pandora version 5.1 and next versions:
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_policy_plugin_module 'policy name' 'module name' generic_data 22 myplugin myuser mypass 'param1 param2 param3' 'Module description' 'General' 1 3 0 300 0 0 0 0 1 'string for warning' 'string for critical'
(>=5.0)
Parameters: <policy_name>
Description: Validate all the alerts of a given policy
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --validate_policy_alerts 'Policy name'
(>=5.0)
Parameters: <policy_name>
Description: Get the module list (id and name) of a given policy
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_policy_modules 'Policy name'
(>=5.0)
Parameters: [<agent_name> <use_agent_alias>]
Description: Get all the policies (without parameters) or the policies of a given agent (agent name as parameter)
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_policies 'Agent name'
(>=5.0)
Parameters: <filter_name> <group_name> <filter> <aggregate_by> <output_format>
Description: Create a new netflow filter.
The possible values of aggregate_by parameter are: dstip,dstport,none,proto,srcip,srcport The possible values of ouput_format parameter are: kilobytes,kilobytespersecond,megabytes,megabytespersecond
Example:
To create a netflow filter we execute the following option:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_netflow_filter "Filter name" Network "host 192.168.50.3 OR host 192.168.50.4 or HOST 192.168.50.6" dstport kilobytes
(>=5.0)
Parameters: <option_to_execute> <option_params>
Description: With this option is possible to execute any CLI option with macros from a CSV file. The number of macros will be the number of columns in the CSV file. Each macro will be named FIELD1 , FIELD2 , FIELD3 etc.
Example:
We are going to create users from a CSV file.
We need a CSV file like that:
User 1,Password 1,0 User 2,Password 2,0 User 3,Password 3,0 User Admin,Password Admin,1
The name of the file will be '/tmp/users_csv'
We are going to execute the option –create_user with the following options: <user_name> <user_password> <is_admin> <comments>
To do this, we execute the following option:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --exec_from_file /tmp/users_csv create_user __FIELD1__ __FIELD2__ __FIELD3__ 'User created with exec_from_file option from CLI'
NOTE: Commas into the CSV columns are not yet supported
Parameters: <name> <oid> <desc> <severity>
Name: As seen in the snmp trap console.
OID: SNMP trap main OID.
Severity: Numeric value, which have following values: Severity 0 (Maintenance), 1(Info) , 2 (Normal), 3 (Warning), 4 (Critical), 5 (Minor) and 6 (Major).
Sample:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_snmp_trap Cisco_FAN_Crash 1.3.3.3.2.12.3.3.4.1 "Something happen with the FAN inside the CISCO device, probably a failure" 3
Parameters: Nothing.
Starts the snmptrapd
process on the traps server. In case it is already started, it terminates the service (kill command) and runs it again, deleting all the traps located in the exchange log (by default /var/log/pandora/pandora_snmptrapd.log
).
Example:
pandora_manage /etc/pandora/pandora_server.conf --start_snmptrapd
Parameters: <name> <description> <user> <id_group> <width> <height> <events> <graph_type> <period> <modules> <separator>
Description: You can create a graph with these elements. Two or more modules must be separated with <separator> wich always must be specified, even for a single module. All parameters are required, but some of them can be empty by singles quotes. Their default values are:
550
.210
.86400
(seconds).0
.0
.0
.Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_custom_graph 'My graph' 'Created by CLI' 'admin' 0 '' '' 0 2 '' '1;2;5;30' ';'
Parameters: <id_graph> <name> <description> <user> <id_group> <width> <height> <events> <graph_type> <period>
Description: You can edit a graph with these values. All parameters are required, but some of them can be empty by singles quotes. Fields not specified keep their values.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --edit_custom_graph 12 '' 'edit graph by CLI' '' '' '' '' '' '' 25200
Parameters: <id_graph> <modules> <separator>
Description: These modules will be added to the graph. All parameters are required.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --add_modules_to_graph 2 '1015,1017' ','
Parameters: <id_graph> <modules> <separator>
Description: These modules will be removed to the graph. All parameters are required.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf –delete_modules_to_graph 2 '1015,1017' ','
Parameters: <cluster_name> <cluster_type> <description> <group_id>
Description: A cluster with the specified parameters and their associated elements will be created.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --new_cluster cluster1 AA description 12
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <json_data_base64:[{“id”:5,“id_agent”:2},{“id”:5,“id_agent”:3}]>
Description: A specific agent will be added to the specified cluster. It is absolutely necessary that JSONs are encoded on base 64.
Example :
perl pandora_manage.pl /etc/pandora/pandora_server.conf --add_cluster_agent W3siaWQiOjUsImlkX2FnZW50IjoyfSwKeyJpZCI6NSwiaWRfYWdlbnQiOjN9XQ ===
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters:
JSON data with this fields:
name
: (string value).id_cluster
: (numeric value).type
: AA
(means “Active/Active”).critical_limit
: (numeric value).warning_limit
: (numeric value).Example JSON:
[ { "name": "Swap_Used", "id_cluster": 5, "type": "AA", "critical_limit": 80, "warning_limit": 60 }, { "name": "TCP_Connections", "id_cluster": 5, "type": "AA", "critical_limit": 80, "warning_limit": 60 } ]
Description: A specific module will be added as an item to the specified cluster.
It is absolutely necessary that JSON data is encoded on base 64.
Example :
perl pandora_manage.pl /etc/pandora/pandora_server.conf --add_cluster_agent WwogIHsKICAgICJuYW1lIjogIlN3YXBfVXNlZCIsCiAgICAiaWRfY2x1c3RlciI6IDUsCiAgICAidHlwZSI6ICJBQSIsCiAgICAiY3JpdGljYWxfbGltaXQiOiA4MCwKICAgICJ3YXJuaW5nX2xpbWl0IjogNjAKICB9LAogIHsKICAgICJuYW1lIjogIlRDUF9Db25uZWN0aW9ucyIsCiAgICAiaWRfY2x1c3RlciI6IDUsCiAgICAidHlwZSI6ICJBQSIsCiAgICAiY3JpdGljYWxfbGltaXQiOiA4MCwKICAgICJ3YXJuaW5nX2xpbWl0IjogNjAKICB9Cl0=
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters:
JSON data with this fields:
name
: (string value).id_cluster
: (numeric value).type
: AP
(means “Active/Pasive”).critical_limit
: (numeric value).warning_limit
: (numeric value).Example JSON:
[ { "name": "DiskUsed_/proc/kcore", "id_cluster": 5, "type": "AP", "is_critical": 1 }, { "name": "DiskUsed_/proc/sched_debug", "id_cluster": 5, "type": "AP", "is_critical": 1 } ]
Description: A specific module will be added as an item to the specified cluster.
It is absolutely necessary that JSON data is encoded on base 64.
Example :
perl pandora_manage.pl /etc/pandora/pandora_server.conf --add_cluster_item WwogIHsKICAgICJuYW1lIjogIkRpc2tVc2VkXy9wcm9jL2tjb3JlIiwKICAgICJpZF9jbHVzdGVyIjogNSwKICAgICJ0eXBlIjogIkFQIiwKICAgICJpc19jcml0aWNhbCI6IDEKICB9LAogIHsKICAgICJuYW1lIjogIkRpc2tVc2VkXy9wcm9jL3NjaGVkX2RlYnVnIiwKICAgICJpZF9jbHVzdGVyIjogNSwKICAgICJ0eXBlIjogIkFQIiwKICAgICJpc19jcml0aWNhbCI6IDEKICB9Cl0=
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <id_cluster>
Description: Getting cluster status.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_cluster_status 7
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <cluster_id>
Description: A cluster will be deleted.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_cluster 1
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <agent_id> <cluster_id>
Description: An agent added to a cluster will be disassociated
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_cluster_agent 1 1
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <item_id>
Description: A cluster item will be deleted
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_cluster_item 1
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.
Parameters: <name> <background> <width> <height> <group> <mode> [<position_to_locate_elemens|<background_color> <elements>]]
Description: A visual console will be created with the specified parameters and their associated elements. It is absolutely necessary that the JSONs go in single quotes because if they don't, there could be errors in the shell from which the script is launched.
“Interesting data:” The mode can adopt the values'static_objects' and'auto_creation', in the first way the elements will be created without taking into account the position where to place the elements, but the position described in the elements json itself will be used. However, if the mode is 'auto_creation' a coordinate tapestry ('position_to_locate_elements' field with the format described in the example below) must be set and the algorithm will automatically establish the position and size of each of the elements.
Example (auto_creation):
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_visual_console 'test console' 'mapamundo.jpg' 1024 768 12 'auto_creation' '{"pos1x":0,"pos1y":60,"pos2x":800,"pos2y":600}' '#FFF' '[{"image": "_engine","height": 0,"width": 0,"label": "","type": 0,"period": 300,"id_agent": 1,"id_agente_modulo": 0,"id_group": 0,"id_layout_linked": 0,"parent_item": 0,"enable_link": 1,"id_metaconsole": 0,"id_custom_graph": 0,"border_width": 0,"border_color": "","fill_color": "","type_graph": "area","label_position": "down"},{"image": "_printer","height": 0,"width": 0,"label": "","type": 0,"period": 300,"id_agent": 2,"id_agente_modulo": 0,"id_group": 0,"id_layout_linked": 0,"parent_item": 0,"enable_link": 1,"id_metaconsole": 0,"id_custom_graph": 0,"border_width": 0,"border_color": "","fill_color": "","type_graph": "area","label_position": "down"}]'
Example (static_objects):
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_visual_console 'test console' 'mapamundo.jpg' 1024 768 12 'static_objects' "" '#FFF' '[{"image": "_engine","pos_x":100,"pos_y":100,"height": 0,"width": 0,"label": "","type": 0,"period": 300,"id_agent": 1,"id_agente_modulo": 0,"id_group": 0,"id_layout_linked": 0,"parent_item": 0,"enable_link": 1,"id_metaconsole": 0,"id_custom_graph": 0,"border_width": 0,"border_color": "","fill_color": "","type_graph": "area","label_position": "down"},{"image": "_printer","pos_x":400,"pos_y":100,"height": 0,"width": 0,"label": "","type": 0,"period": 300,"id_agent": 2,"id_agente_modulo": 0,"id_group": 0,"id_layout_linked": 0,"parent_item": 0,"enable_link": 1,"id_metaconsole": 0,"id_custom_graph": 0,"border_width": 0,"border_color": "","fill_color": "","type_graph": "area","label_position": "down"}]'
Parameters: <id> [<name> <background> <width> <height> <group> <mode> <position_to_locate_elemens> <background_color> <elements>]
Description: A visual console with the specified parameters and its associated elements will be edited. It is absolutely necessary that the JSONs go between single quotes since if it didn't occur it could cause errors in the shell from where the script is launched.
Example (auto_creation):
perl pandora_manage.pl /etc/pandora/pandora_server.conf --edit_visual_console 1 'test console edited' 'auto_creation' {"pos1x":0,"pos1y":60,"pos2x":800,"pos2y":600} '[{"id":103,"image": "_engine","height": 180,"width": 200,"label": "","type": 0,"period": 300,"id_agent": 3,"id_agente_modulo": 0,"id_group": 0,"id_layout_linked": 0,"parent_item": 0,"enable_link": 1,"id_metaconsole": 0,"id_custom_graph": 0,"border_width": 0,"border_color": "","fill_color": "","type_graph": "area","label_position": "down"},{"pos_x":400,"pos_y":100,"image": "_printer","height": 0,"width": 0,"label": "","type": 0,"period": 300,"id_agent": 4,"id_agente_modulo": 0,"id_group": 0,"id_layout_linked": 0,"parent_item": 0,"enable_link": 1,"id_metaconsole": 0,"id_custom_graph": 0,"border_width": 0,"border_color": "","fill_color": "","type_graph": "area","label_position": "down"}]'
Example (static_objects):
perl pandora_manage.pl /etc/pandora/pandora_server.conf --edit_visual_console 1 'test console edited' 'static_objects' '[{"id":103,"image": "_engine","height": 180,"width": 200,"label": "","type": 0,"period": 300,"id_agent": 3,"id_agente_modulo": 0,"id_group": 0,"id_layout_linked": 0,"parent_item": 0,"enable_link": 1,"id_metaconsole": 0,"id_custom_graph": 0,"border_width": 0,"border_color": "","fill_color": "","type_graph": "area","label_position": "down"},{"pos_x":400,"pos_y":100,"image": "_printer","height": 0,"width": 0,"label": "","type": 0,"period": 300,"id_agent": 4,"id_agente_modulo": 0,"id_group": 0,"id_layout_linked": 0,"parent_item": 0,"enable_link": 1,"id_metaconsole": 0,"id_custom_graph": 0,"border_width": 0,"border_color": "","fill_color": "","type_graph": "area","label_position": "down"}]'
Parameters: <id>
Description: The specified visual console and its associated elements will be removed.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_visual_console 1
Parameters: <id> <mode> <id_mode>
Description: Items associated with a visual console will be removed by following a filter. The available modes are “type”, “image”, “id_agent”, “id_agente_modulo”, “id_group” and “type_graph” where its identifier must be specified, which may be the type ID, the image name, the agent ID, the module ID, the group ID or the type of graphic. (area, line…).
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_visual_console_objects 1 'id_agent' 1
Parameters: <id> <times> [<prefix]
Description: The indicated visual console will be duplicated as many times as desired.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --duplicate_visual_console 1 10 'test console 2'
Parameters: <id> [<path> <with_element_id>]
Description: Exports to json a visual console and its elements being able to specify the path where to save the file and if you want to include the id of the associated elements to facilitate a later edition.
Interesting data: The field “with_element_id” can return 1 and 0, which mean with or without ID respectively.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --export_json_visual_console 1 '/tmp' 1
Parameters: <agent_name> [
use_alias
] .
Description: Return the id of the node that manages the agent.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --locate_agent NAS
Parameters: <tag_name> <tag_description> [ <tag_url> ] [ <tag_email> ]
Description: Create a new tag. Tag name and tag description are obligatory.
Example:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --create_tag 'New tag name' 'Your description'
For it to be carried out correctly, the API configuration parameters will need to be filled in pandora_server.conf
(configuration file elements) : console_api_pass
, console_pass
, console_user
y console_api_url
.