====== Pandora FMS Command Line Interface (CLI) ======
{{indexmenu_n>3}}
===== Pandora FMS CLI =====
The Pandora FMS CLI (Command-Line Interface) is used for making calls in command line on the file ''pandora_manage''.
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.
pandora_manage
With backslash ''\'' as a line connector:
pandora_manage \
\
==== Syntax ====
* All parameters, mandatory or optional, can be delimited with single quotes. This is especially useful when a parameter has one or more spaces.
* If you need to omit a parameter you can use two single quotes together. In case the parameter is strictly necessary a message like ''[ERROR] Error:'' will be displayed followed by a description of the parameter. This is also useful to indicate empty optional parameters.
* Some parameters are case sensitive, others are case insensitive. For example, [[#ks2_1|when creating an agent]] the name of the PFMS server must be strictly the same, however the name of the primary group to which the agent will belong can be in upper and/or lower case and if there is a match the group will be assigned.
* You can use the alias of an agent, instead of its name itself, by means of the ''use_alias'' parameter **at the end of the command line**.
==== Help ====
General help:
pandora_manage --h
To obtain help about one specific option just write option without parameters:
pandora_manage /etc/pandora/pandora_server.conf --create_user
===== Agents =====
==== create_agent ====
**Required parameters ([[#ks1_1|syntax]])**:
* < agent name > Returns error if the name exists (see < alias as name >).
* < operating system >
* < group name > Must match an existing OS (case insensitive) otherwise it will be registered without any group.
* < server name > Be case sensitive, otherwise the value of the field will be left null //without any warning//. **You must verify that the agent has been assigned to a server.**
**Optional parameters**:
* < IP address or URL >
* < description > If you omit the description ''Created by < server name >'' will be added (regardless of whether the specified server exists or not).
* < interval > In seconds, default value: 300 (see next point).
* < alias as name > The default value is ''1'' and with this value the agent alias will be the same as the agent name. If you want the name to be randomly generated, use ''0''.
**Description**:
An agent will be created with the specified name, operating system, group and server. Optionally, it can be given an address (IP address or name), a description and an interval in seconds.
If you are going to use a random agent name using ''0'' as the last parameter, the agent period must be specified, the recommended value being 300 seconds.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
An agent will be created with a random name and the alias ''My agent'' and with the recommended period of 300 seconds.
pandora_manage /etc/pandora/pandora_server.conf --create_agent \
'My agent' AIX Databases Central-Server \
192.168.12.123 'Agent description' '' 0
==== update_agent ====
**Required parameters ([[#ks1_1|syntax]])**:
* < name_of_agent >
* < field_to_change >
* < new_value >
**Optional parameters**:
* ''use_alias''
**Description**: An existing agent's < field_to_modify > will be updated. The available fields are the following:
* ''agent_name''
* ''address''
* ''description''
* ''group_name''
* ''interval''
* ''os_name''
* ''disabled'' ( ''0'' to activate it, ''1'' to inactivate it).
* ''parent_name''
* ''cascade_protection'' ( ''0'' to activate it, ''1'' to inactivate it).
* ''icon_path''
* ''update_gis_data'' ( ''0'' to activate it, ''1'' to inactivate it).
* ''custom_id''
To identify the agent by its alias instead of its name, use ''use_alias'' right at the end.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --update_agent \
'My Agent' agent_name 'Agent 2'
When changing an [[en:documentation:pandorafms:monitoring:01_intro_monitoring#ks2_2|agent's IP address]] note that this command allows repeating IP addresses.
pandora_manage /etc/pandora/pandora_server.conf --update_agent \
'My Agent' address 192.168.7.47
pandora_manage /etc/pandora/pandora_server.conf --update_agent \
'My Agent' description 'New note' \
use_alias
For the ''disabled'' option only ''0'' and ''1'' should be used, any other value will produce unpredictable search and/or display results in the Web Console.
pandora_manage /etc/pandora/pandora_server.conf --update_agent \
'My Agent' disabled 1 \
use_alias
For the ''cascade_protection'' option only ''0'' and ''1'' should be used, any other value will produce unpredictable search and/or display results in the Web Console.
pandora_manage /etc/pandora/pandora_server.conf --update_agent \
'My Agent' cascade_protection 1 \
use_alias
==== agent_update_custom_fields ====
**Required parameters ([[#ks1_1|syntax]])**:
* < id_agent > agent identifier.
* < field_type > field type which can be ''0'' if it is a text type or ''1'' if it is a combo box (select) type composed of several options. See section on answers.
* < field_to_change > name of the field to be updated.
* < valor_nuevo > the value of the field to be updated.
**Description**: updates the custom fields of an agent.
The answers of which they are composed are:
* **ERROR**:
* If the agent does not exist.
* If the field does not exist.
* In the event that the ''new_value'' of a combo does not match the ones you have preset.
* If you were unable to update the field.
* **INFO**:
* Updating the ''X'' field with the agent id ''Y''.
* Correctly updated.
**Examples (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
TEXT TYPE:
pandora_manage /etc/pandora/pandora_server.conf \
--agent_update_custom_fields \
1 0 'Serial number' 'THX-1138'
COMBO TYPE: you must have configured a custom field named ''Names'' with at least one item named ''John''.
pandora_manage /etc/pandora/pandora_server.conf \
--agent_update_custom_fields \
1 1 'Names' 'John'
==== delete_agent ====
**Required parameters ([[#ks1_1|syntax]])**:
* < agent_name >
**Optional parameter**:
* ''use_alias'' It should be noted that agent aliases can be repeated and several agents can be deleted with a single command.
**Description**:
The agent(s) will be deleted by passing its name or alias as a parameter.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf \
--delete_agent 'pandora.internals' \
use_alias
==== disable_group ====
**Manadory parameter**:
* < group_name >
**Description**:
Disable all agents from an entire group. The [[:en:documentation:pandorafms:management_and_operation:11_managing_and_administration#groups_in_pandora_fms|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 [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --disable_group Firewalls
{{ :wiki:pfms-pandora_manage_--disable_group-example_1.png }}
==== enable_group ====
**Required parameter**:
* < group_name >
**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 [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --enable_group firewalls
{{ :wiki:pfms-pandora_manage_--enable_group-example_1.png }}
==== create_group ====
**Required parameters**:
* < group_name >
**Optional paramaters**:
* < parent_group_name >
* < icon >
* ''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 >
**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:
* If you will not use parent group set ''All'' as fill parameter.
* If no icon is to be used, place an empty string (two single quotes together) as the filler parameter.
\\ **Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --create_group \
'New group name' \
Web computer 'New description.'
==== delete_group ====
**Required parameter**:
* < group_name >
**Description**:
Delete an agent group.
Every agent belongs to indicated group will be deleted too.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf –-delete_group 'Group name'
==== update_group ====
**Required parameters**:
* < group_id >
**Optional parameters**:
* < group_name_to_modify >
* < parent_group_name >
* < icon >
* ''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 >
**Description**: A group is modified by its numerical identifier. Parameters that can be modified:
* Name group.
* Name group parent
* Icon (only name, without extension, choose one from list above).
* Description.
* You can use the " [[#get_agent_group_id|get_agent_group_id]] " function to find the id of the group of any agent.
* At Web console go to menu **Profiles**→ **Manage agent groups** and take number id.
You must type exactly same existing parameters for only modify description field.
\\ **Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf –update_group 18 \
'Group name' 'Web' 'transmit' 'Description'
==== stop_downtime ====
**Required parameter**:
* < downtime_name >
**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 [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage.pl /etc/pandora/pandora_server.conf --stop_downtime 'Downtime name'
==== get_agent_status ====
**Required parameter**:
* < agent_name >
**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 [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --get_agent_status 'agent name'
==== get_agent_group ====
**Required parameter**:
* < agent_name >
**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 [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --get_agent_group 'agent_name'
==== get_agent_group_id ====
**Required parameter**:
* < agent_name >
**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 [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --get_agent_group_id 'agent name'
==== get_agent_modules ====
**Required parameter**:
* < agent_name >
**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 [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --get_agent_modules 'agent name'
==== get_agents ====
**Required parameter**: None. To get help for such a command you can use (see [[#ks1|call]] and [[#ks1_1|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 module loaded.
Available options for --get_agents:
--get_agents [] : 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:
- < [[:en:documentation:pandorafms:management_and_operation:11_managing_and_administration#group_creation|group_name]] >
- < [[:en:documentation:pandorafms:management_and_operation:12_console_setup#operating_systems|os_name]] >
- < status > Posible values: ''critical'', ''warning'', ''unknown'', ''normal''.
- < number_max_of_modules >
- < key_string > Allows filtering by agent name (or agent alias if you add at the end ''use_agent_alias'' ).
- < policy_name >
- ''use_agent_alias''
**Description**: Get all agents (without parameters) or agents according to a filter.
**Examples (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
* Get all agents in the ''Network'' group:
pandora_manage /etc/pandora/pandora_server.conf --get_agents 'Network' '' '' '' '' ''
* Get all the agents that have ''Linux'' as operating system:
pandora_manage /etc/pandora/pandora_server.conf --get_agents '' 'Linux' '' '' '' ''
* Obtain all agents whose status is ''normal'':
pandora_manage /etc/pandora/pandora_server.conf --get_agents '' '' 'normal' '' '' ''
* Obtain all agents with zero modules (no modules at all):
pandora_manage /etc/pandora/pandora_server.conf --get_agents '' '' '' '0' '' ''
* Get all agents with zero modules in the ''Servers'' group:
pandora_manage /etc/pandora/pandora_server.conf --get_agents 'Servers' '' '' '0' '' ''
* Get all agents that contain the word ''test'' in their alias:
pandora_manage /etc/pandora/pandora_server.conf --get_agents '' '' '' '' 'test' '' use_agent_alias
==== get_agents_id_name_by_alias ====
**Parameters**: [ ''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'
==== Delete_conf_file ====
(>=5.0)
**Parameters**:
**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'
==== Clean_conf_file ====
(>=5.0)
**Parameters**: []
**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'
==== get_bad_conf_files ====
**Parameters**: None.
**Description**:
- The misconfigured configuration files will be listed by searching the main //tokens//:
* ''server_ip''
* ''server_path''
* ''temporary''
* ''logfile''
- In case there are corrupt files that cannot be opened: ''[WARN] Can't open file < path_file >''.
- In case of not finding the file in the path: ''[WARN] File not exist < path_file >''.
- In case the configuration files are correct (according to the //tokens// of the first point): ''[INFO] No bad files found''
**Examples**:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --get_bad_conf_files
Example output:
{{ :wiki:pfms-open-perl_pandora_manage_pl-get_bad_conf_files.png }}
==== migration_agent_queue ====
(>=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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== migration_agent ====
(>=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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== create_downtime ====
**Parameters**:
**Description**: Created Planned downtime.
* You must have configured data API in ''pandora_server.conf''.
* The date format must be ''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
==== add_item_downtime ====
**Required parameters**:
* < id_parada_planificada >
* < id_agente1,id_agente2,id_agente3,…,id_agenteN >
* < nombre_módulo1,nombre_módulo2,nombre_módulo3,…,nombre_móduloN >
**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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
**Example (see [[#ks1|call]] and [[#ks1_1|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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== get_all_planned_downtimes ====
**Required parameters**:
* < name_to_search >
**Optional parameters**:
* < id_group >
* < type_downtime >
* ''quiet''
* ''disable_agents''
* ''disable_agents_alert''
* < type_execution >
* ''once''
* ''periodically''
* < type_periodicity >
* ''weekly''
* ''monthly''
**Description**:
List all matches of planned downtime. See [[:en:documentation:pandorafms:management_and_operation:11_managing_and_administration#scheduled_downtimes|Scheduled downtimes]] options.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --get_all_planned_downtimes ''
==== get_planned_downtimes_items ====
**Required parameters**:
* < name_to_search >
**Optional parameters**:
* < id_group >
* < type_downtime >
* ''quiet''
* ''disable_agents''
* ''disable_agents_alert''
* < type_execution >
* ''once''
* ''periodically''
* < type_periodicity >
* ''weekly''
* ''monthly''
**Description**:
List all of items that matches planned downtime name. See [[:en:documentation:pandorafms:management_and_operation:11_managing_and_administration#scheduled_downtimes|Scheduled downtimes]] options.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --get_planned_downtimes_items 'Name downtime'
==== set_planned_downtimes_deleted ====
**Required parameter**:
* < id_planned_downtime >
**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 [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --set_planned_downtimes_deleted 7
==== set_disabled_and_standby ====
Only for Command Center (Metaconsole) and Nodes.
\\ **Required parameters**:
* < id_agent >
* //For Command Center (Metaconsole)// < id_metaconsole >, //for nodes// put any value, is indifferent.
**Optional parameter**:
* < value> By default ''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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
* Example to enable an agent from the node:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --set_disabled_and_standby 2 0 1
* Example to disable an agent from the node:
pandora_manage /etc/pandora/pandora_server.conf --set_disabled_and_standby 2 0 0
* Example to enable an agent from the metaconsole:
pandora_manage /etc/pandora/pandora_server.conf --set_disabled_and_standby 2 1 1
* Example to disable an agent from the metaconsole:
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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== reset_agent_counts ====
**Parameters**:
**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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== insert_gis_data ====
**Required parameters**:
* < id_of_agent >
* < latitude >
* < longitude >
* < altitude >
**Optional parameters**:
*
None.
**Description**: Updates an [[:en:documentation:pandorafms:monitoring:20_gis|agent's GIS data]].
**Examples (see [[#ks1|call]] and [[#ks1_1|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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== get_gis_agent ====
**Required parameters**:
* < agent_id >
**Optional parameters**:
* None.
**Description**: Gets an [[:en:documentation:pandorafms:monitoring:20_gis|agent's GIS data]].
**Examples (see [[#ks1|call]] and [[#ks1_1|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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== agent_set_os ====
**Required parameters**:
* < agent_id >
* < operating_system_id >
* < operating_system_version >
**Optional parameters**:
* None.
**Description**: Add or change [[:en:documentation:pandorafms:management_and_operation:12_console_setup#operating_systems|operating system (and obsolescence)]] to an agent.
**Examples (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --agent_set_os 7 3 'Ubuntu 16.04'
===== Modules =====
==== create_data_module ====
**Required parameters**:
* < module_name >
* < module_type >
* < agent_name >
* < description > To omit this parameter, use '' "" ''.
* < module_group > To omit this parameter, use '' "" ''.
* < min > To omit this parameter, use '' "" ''.
* < max > To omit this parameter, use '' "" ''.
**Optional parameters**:
- < post_process >
- < interval >
- < warning_min >
- < warning_max >
- < critical_min >
- < critical_max >
- < history_data >
- < definition_file >
- < warning_string >
- < critical_string >
- < 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 >
- ''use_agent_alias'': For the agent search use the agent alias instead of the agent name.
- ''ignore_unknown'': Discards the unknown state calculation, so that the module will never change to that state and will always keep the last known state.
- < number_of_intervals_in_warning > Allows state scaling by specifying the maximum number of consecutive intervals in which the module remains in warning state. If this value is exceeded, the module will escalate to critical status.
**Description**: A module kind data will be created in an agent with the module name, kind of module and name of the agent (see option ''use_agent_alias'') where it will be created. Optionally it will be possible to give a description, the module group, etc.
The default values are ''0'' for the minimum and maximum values, history_data and post_process; ''300'' for interval.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
Simple example for state scaling:
pandora_manage /etc/pandora/pandora_server.conf --create_data_module data_module_test generic_data 3f9c41953a072afa229aa0a7fe3a6203a1ecf86b40b8a13d8a7d9916f0210bb1 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" 2001
Complex example, the module definition file will contain something like this:
module_begin
module_name My module
module_type generic_data
module_exec cat /proc/meminfo | grep MemFree | awk '{ print $2 }'
module_end
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.
==== create_web_module ====
**Required parameters**:
* < module_name >
* < module_kind >
* < agent_name >
**Optional parameters**:
- < 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 >
- < definition_file >
- < 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 >
- < ''use_agent_alias'' >: For the agent search use the agent alias instead of the agent name.
- < ''ignore_unknown'' >: Discards the unknown state calculation, so that the module will never change to that state and will always keep the last known state.
- < number_of_intervals_in_warning > Allows state scaling by specifying the maximum number of consecutive intervals in which the module remains in warning state. If this value is exceeded, the module will escalate to critical status.
**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 (see parameter ''use_agent_alias'') . 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.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
Simple example for state scaling:
pandora_manage /etc/pandora/pandora_server.conf --create_web_module web_module_test web_data 3f9c41953a072afa229aa0a7fe3a6203a1ecf86b40b8a13d8a7d9916f0210bb1 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" 2001
As a complex example, the module definition file will contain something like this:
task_begin
get http://pandorafms.com
task_end
pandora_manage /etc/pandora/pandora_server.conf --create_web_module 'module_name' web_data 'pandorafms' 'Module description' 'General' 0 100 0 300 0 0 0 0 1 0 1 'Pandora FMS' auto public /home/user/file_definition 'http://proxy.url' 'proxy_login' 'proxy_password' 1 10 10 10 10 10 10 10 10 1 1 'critical_instructions' 'warning_instructions' 'unknown_instructions'
==== create_network_module ====
**Required parameters**:
* < module_name >
* < module_type >
* < agent_name >
* < module_address >
**Optional parameters**:
* < module_port > numerical value between ''1'' and ''65535''.
* < 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 >
* < timeout >
* < retries >
* < critical_instructions >
* < warning_instructions >
* < unknown_instructions >
* < warning_inverse >
* < critical_inverse >
* ''use_agent_alias'' to search for the agent by its alias instead of its name.
* ''ignore_unknown'' Discards the unknown state calculation, so that the module will never change to that state and will always keep the last known state.
* < number_of_intervals_in_warning > Allows state scaling by specifying the maximum number of consecutive intervals in which the module remains in warning state. If this value is exceeded, the module will escalate to critical status.
**Description**: A network module will be created in an agent with the module name, module type, agent name where it will be created and the module address specified. Optionally, it can be given a port number, a description, minimum and maximum values, a post processing ' value, an interval in seconds, minimum and maximum warning values, minimum and maximum criticality values, and a historical data value.
The default values are ''0'' for minimum and maximum, ''history_data'' and ''post_process'' and ''300'' seconds for the interval.
The port number is optional, since ICMP type modules do not require it. For all other types, a module must be specified.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
Simple example for state scaling:
pandora_manage /etc/pandora/pandora_server.conf --create_network_module net_module_test remote_tcp 3f9c41953a072afa229aa0a7fe3a6203a1ecf86b40b8a13d8a7d9916f0210bb1 127.0.0.1 "1" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" 2001
Another example:
pandora_manage /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
==== Create_network_component ====
**Parameters**: []
**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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== create_snmp_module ====
**Required parameters**:
* < module_name >
* < module_type >
* < agent_name >
* < module_address >
* < module_port >
* < version >
**Optional parameters**:
* < 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'' to search for the agent by its alias instead of its name.
* ''ignore_unknown'' Discards the unknown state calculation, so that the module will never change to that state and will always keep the last known state.
* < critical_instructions >
* < warning_instructions >
* < unknown_instructions >
* < warning_inverse >
* < critical_inverse >
* < number_of_intervals_in_warning > Allows state scaling by specifying the maximum number of consecutive intervals in which the module remains in warning state. If this value is exceeded, the module will escalate to critical status.
**Description**: An SNMP type module will be created in an agent with the module name, module type, name of the agent where it will be created, the module address, the associated port and the SNMP version specified. Optionally, a community name, OID, description, module group, minimum and maximum values, post processing value, interval in seconds, minimum and maximum warning values, minimum and maximum criticality values, and SNMP 3 parameters such as methods, passwords, etc. can be provided.
The default values are ''0'' for minimum and maximum, ''history_data'' and ''post_process'' and 300 seconds for the interval.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
Simple example for state scaling:
pandora_manage /etc/pandora/pandora_server.conf --create_snmp_module snmp_module_test remote_snmp_inc 3f9c41953a072afa229aa0a7fe3a6203a1ecf86b40b8a13d8a7d9916f0210bb1 127.0.0.1 "1" "3" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" 2001
Another example:
pandora_manage /etc/pandora/pandora_server.conf --create_snmp_module 'My module' remote_snmp_inc 'My agent' 192.168.12.123 8080 1 my_comunnity my_oid 'Module description'
==== create_plugin_module ====
**Required parameters**:
* < module_name >
* < module_type >
* < agent_name >
* < module_address >
* < module_port > numerical value between ''1'' and ''65535''.
* < plugin_name >
* < user >
* < password >
* < parameters >
**Parámetros opcionales**:
* < 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 >
* < timeout >
* < critical_instructions >
* < warning_instructions >
* < unknown_instructions >
* < warning_inverse >
* < critical_inverse >
* ''use_agent_alias'' to search for the agent by its alias instead of its name.
* ''ignore_unknown'' Discards the unknown state calculation, so that the module will never change to that state and will always keep the last known state.
* < number_of_intervals_in_warning > Allows state scaling by specifying the maximum number of consecutive intervals in which the module remains in warning state. If this value is exceeded, the module will escalate to critical status.
**Description**: A module of type //plugin// will be created in an agent with the module name, module type, name of the agent where it will be created, the module address, the associated port and the corresponding plugin name. Optionally, a description, the module group, minimum and maximum values, a post processing value, an interval in seconds, minimum and maximum warning values, minimum and maximum criticality values, among other optional values, can be provided.
The default values are ''0'' for minimum and maximum, ''history_data'' and ''post_process'' and ''300'' for the interval.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
Simple example for state scaling:
pandora_manage /etc/pandora/pandora_server.conf --create_plugin_module plugin_module_test generic_data 3f9c41953a072afa229aa0a7fe3a6203a1ecf86b40b8a13d8a7d9916f0210bb1 127.0.0.1 "1" "DNS Plugin" "admin" "pandora" "100" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" 2001
Another example:
pandora_manage /etc/pandora/pandora_server.conf --create_plugin_module 'My module' generic_data 'Mi agente' 192.168.12.123 8080 myplugin myuser mypass 'param1 param2 param3' 'Descripcion del modulo' 'General' 1 3 0 300 0 0 0 0 1
==== Get_module_group ====
**Parameters**: []
**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"
==== Create_module_group ====
**Parameters**:
**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'
==== Module_group_synch ====
**Parameters**: []
**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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== Create_synthetic ====
**Parameters**:
Where can be "arithmetic" or "average".
**Examples**
pandora_manage /etc/pandora/pandora_server.conf --create_synthetic example_module arithmetic example_agent
pandora_manage /etc/pandora/pandora_server.conf --create_synthetic example_module average example_agent
Let's explain all the posible parameters that can be used on the >
* = ,,,,
* = ,,,
**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:
* **+** sum
* **-** substraction
* * multiplication
* **/** division
* **x** average. This operator only can be used with the //average// type.
**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
==== delete_module ====
**Required parameters**:
* < module_name >
* < agent_name >
**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. From version 771 on wards, the //descendants// of the deleted module are deleted recursively.
**Examples (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage.pl /etc/pandora/pandora_server.conf --delete_module 'My module' 'My agent'
==== Data_module ====
**Parameters**: []
**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'
==== Get_module_data ====
(>=5.0)
**Parameters**: []
**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 ':'
==== Get_module_id ====
**Parameters**:
**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'
==== Get_module_custom_id ====
**Parameters**:
**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
==== Set_module_custom_id ====
**Parameters**: []
**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'
==== Delete_data ====
**Parameters**: | -a | -g
**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.
==== Update_module ====
**Parameters**:
**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:
* **Common to any module**: module_name, agent_name, description, module_group, min, max, post_process, history_data, interval, warning_min, warning_max, critical_min, critical_max, warning_str, critical_str, ff_threshold, each_ff, ff_threshold_normal, ff_threshold_warning, ff_threshold_critical, critical_instructions, warning_instructions, unknown_instructions
* **For the data modules**: ff_timeout
* **For the network modules**: module_address, module_port
* **For the SNMP modules**: module_address, module_port, version, community, oid, snmp3_priv_method, snmp3_priv_pass, snmp3_sec_level, snmp3_auth_method, snmp3_auth_user, snmp3_priv_pass
* **For the plugin modules**: module_address, module_port, plugin_name, user, password, parameters
**Example**:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --update_module 'Module name' 'Agent name' description 'New description'
==== add_tag_to_module ====
**Parameters**:
**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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== Get_agents_module_current_data ====
(>=5.0)
**Parameters**:
**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'
==== Create_network_module_from_component ====
(>=5.0)
**Parameters**:
**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'
==== Create_data_module_from_local_component ====
(>=5.1)
**Parameters**:
**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'
==== Create_local_component ====
(>=5.1)
**Parameters**: []
**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'
==== Apply_module_template ====
**Parameters**: []
**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
===== Alerts =====
==== Create_template_module ====
**Parameters**:
**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'
==== Delete_template_module ====
**Parameters**:
**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'
==== Create_template_action ====
**Parameters**: []
**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
==== Delete_template_action ====
**Parameters**:
**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'
==== Disable_alerts ====
**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
==== Enable_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
==== Create_alert_template ====
**Parameters**: []
**Description**: An alert template will be created.
**The field ** is the type options of the template serialized with the separator ';' by default. It's possible change the separator with the parameter 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.//
* **Regular expression**:
* **Syntaxis**: ;;
* **Example**: regex;1;stopped|error (Alert when value match regexp 'stopped|error')
* **Max and min**:
* **Syntaxis**: ;;;
* **Example**: max_min;0;30;50 (Alert when value is out of interval 30-50)
* **Max.**:
* **Syntaxis**: ;
* **Example**: max;70 (Alert when value is above 70)
* **Min.**:
* **Syntaxis**: ;
* **Example**: min;30 (Alert when value is below 30)
* **Equal to**:
* **Syntaxis**: ;
* **Example**: equal;0 (Alert when value is equal to 0)
* **Not equal to**:
* **Syntaxis**: ;
* **Example**: not_equal;100 (Alert when value is not equal to 100)
* **Warning status**:
* **Syntaxis**:
* **Example**: warning (Alert when status turns into warning)
* **Critical status**:
* **Syntaxis**:
* **Example**: critical (Alert when status turns into critical)
* **Not normal**:
* **Syntaxis**:
* **Example**: not_normal (Alert when status differs from normal)
* **Unknown status**:
* **Syntaxis**:
* **Example**: unknown (Alert when status turns into unknown)
* **On Change**:
* **Syntaxis**: ;
* **Example**: onchange;1 (Alert when value changes)
* **Always**:
* **Syntaxis**:
* **Example**: always (Alert all times)
**The field ** 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" "mail@mail.com" "subject" "message" 3 "Mail to XXX" 1000000 38600 1 2 0 // // @
==== Delete_alert_template ====
(>=5.0)
**Parameters**:
**Description**: An alert template will be deleted if exists.
**Example**:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_alert_template 'Template name'
==== Update_alert_template ====
(>=5.0)
**Parameters**:
**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
==== Get_alert_actions ====
(>=5.0)
**Parameters**: []
**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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== Get_alert_actions_meta ====
(>=5.0)
This feature is in Command Center (Metaconsole).
**Parameters**: []
**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'' ([[:en:documentation:pandorafms:installation:04_configuration#configuration_file_elements|configuration file elements]]) : ''console_api_pass'' , ''console_pass'' , ''console_user'' y ''console_api_url'' .
==== Create_alert_command ====
(>=5.0)
**Parameters**: []
**Description**: A command will be created with the specified name and command data. Optionally you can specify:
* Group name. If no group is provided, it will be assigned in the group 'All'.
* Command Description.
* Internal (1-0).
* Field description. This will be formatted as follows: '["descr1","descr2","descr3","descr4","descr5"]'.
* Field value: This will be formatted as follows: ["val1","val2","val3","val4","val5"].
**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","","","","","",""]'
==== Get_alert_commands ====
(>=5.0)
**Parameters**: []
**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"
==== validate_alert ====
**Parameters**: [ ''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
==== Validate_all_alerts ====
(>=5.0)
**Parameters**: None
**Description**: Validate all the alerts.
**Example**:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --validate_all_alerts
==== Create_special_day ====
(>=5.1)
**Parameters**:
**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
==== Delete_special_day ====
(>=5.1)
**Parameters**:
**Description**: Delete specified special day.
**Example**:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --delete_special_day 2014-05-03
==== set_event_storm_protection ====
**Parameters**:
**Description**: Enable (''1'') or disable (''0'') [[:en:documentation:pandorafms:management_and_operation:01_alerts#cascade_protection|event storm protection]].
**Example**:
perl pandora_manage.pl /etc/pandora/pandora_server.conf --set_event_storm_protection 1
==== Update_special_day ====
(>=5.1)
**Parameters**:
**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
===== Users =====
==== create_user ====
NG 766 version or later: This function also works in Command Center (Metaconsole).
**Required parameters**:
* < id_user >
* < password >
* < is_admin >
**Optional parameters**:
* < comments >
**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 [[:en:documentation:pandorafms:introduction:03_glossary#superadmin|superadmin]] or not. Optionally a comment about the created user can be added.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --create_user user9500 'user 9500' 0 'This user has the password "user 9500"'
==== delete_user ====
NG 766 or later: This function also works in Command Center (Metaconsole).
**Required parameter**:
*
**Description**:
An user will be eliminated giving its name as parameter.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage.pl /etc/pandora/pandora_server.conf --delete_user user02
==== update_user ====
NG 766 or later: This function also works in Command Center (Metaconsole).
**Required parameters**:
* < id_user >
* < field_to_update >
* < new_value >
**Description**:
A given field of an existent user will be updated. The possible fields are the following:
* ''email''.
* ''phone''.
* ''is_admin'' ¿Is [[:en:documentation:pandorafms:introduction:03_glossary#superadmin|superadmin]]? (''0'' false,''1'' true).
* ''language'' , possible values:
* ''default'', English US.
* ''ca'', Catalan.
* ''en_GB'', English UK.
* ''es'', Spanish.
* ''fr'', French.
* ''ru'', Russian.
* ''ja'', Japanese.
* ''zh_CN'' , Chinese.
* ''comments''.
* ''fullname''.
* ''password''.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --update_user 'user 9500' password 'XYZ'
==== enable_user ====
NG 766 or later: This function also works in Command Center (Metaconsole).
**Required parameter**:
* < user_id >
**Description**:
An existent user will be enabled. If it's already enabled, will showed only a message.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage /etc/pandora/pandora_server.conf --enable_user 'user 9500'
==== disable_user ====
NG 766 or later: This function also works in Command Center (Metaconsole).
**Required parameter**:
* < user_id >
**Description**:
An existent user will be disabled. If it's already disabled, will showed only a message.
**Example (see [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage.pl /etc/pandora/pandora_server.conf --disable_user 'user 9500'
==== create_profile ====
NG 766 or later: This function also works in Command Center (Metaconsole).
**Required parameters**:
* < profile_name >
* < rights_list > Use ''1'' or ''0'' for otorgate or deny right, respectively. They are numbered so:
- AR View agents.
- AW Edit agents.
- AD Disable agents.
- LW Edit alerts.
- LM Manage alerts.
- UM Manage users.
- DM Manage database.
- ER View events.
- EW Edit events.
- EM Manage events.
- RR View reports.
- RW Edit reports.
- RM Manage reports.
- MR View network maps.
- MW Edit network maps.
- MM Manage network maps.
- VR View visual console.
- VW Edit visual console.
- VM Manage visual console.
- PM Pandora FMS management.
- **NR** View NCM data.
- **NW** Operate NCM -you must include **NR**-.
- **NM** Manage NCM -you must include **NW** and **NR**-.
**Descripción**:
A new profile will be created by passing the profile name and permissions as parameters. All fields are required.
**Example (see [[#ks1|call]] and [[#ks1_1|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
==== update_profile ====
NG 766 or later: This function also works in Command Center (Metaconsole).
**Required parameters**:
* < profile_name >
* < rights_list > Use ''1'' or ''0'' for otorgate or deny right, respectively. They are numbered so:
- AR View agents.
- AW Edit agents.
- AD Disable agents.
- LW Edit alerts.
- LM Manage alerts.
- UM Manage users.
- DM Manage database.
- ER View events.
- EW Edit events.
- EM Manage events.
- RR View reports.
- RW Edit reports.
- RM Manage reports.
- MR View network maps.
- MW Edit network maps.
- MM Manage network maps.
- VR View visual console.
- VW Edit visual console.
- VM Manage visual console.
- PM Pandora FMS management.
- **NR** View NCM data.
- **NW** Operate NCM -you must include **NR**-.
- **NM** Manage NCM -you must include **NW** and **NR**-.
**Descripción**:
A existent profile will be updated by passing the profile name and permissions as parameters. All fields are required.
**Example (see [[#ks1|call]] and [[#ks1_1|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
==== add_profile ====
NG 766 or later: This function also works in Command Center (Metaconsole).
**Required parameters**:
* < id_user >
* < profile_name >
* < group_name >
**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 [[#ks1|call]] and [[#ks1_1|syntax]])**:
pandora_manage.pl /etc/pandora/pandora_server.conf --add_profile usuario002 'Group coordinator' All
==== add_tag_to_user_profile ====
**Parameters**: