====== 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:
/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
With backslash ''\'' as a line connector:
perl pandora_manage.pl \
\
**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
With backslash ''\'' as a line connector:
pandora_manage \
\
All examples shown here, unless implicitly stated otherwise, refer to the Enterprise version ( ''pandora_manage'' ).
==== Syntax ====
* All parameters, mandatory or optional, can be delimited with single quotation marks.
* Quotation marks are especially useful when a parameter has spaces, e.g. '''My Agent'''.
* Also if you need to omit some mandatory parameter you can use two single quotes together. If strictly necessary, an ''[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.
* Some parameters are case sensitive, //others are case insensitive//. For example, when [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#create_agent|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 ====
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
===== Agents =====
==== create_agent ====
**Mandatory parameters:**
* < agent_name >
* < operating_system>
* It can be omitted by means of two single quotation marks together.
* < group_name >
* < server_name >
* Be case sensitive, //otherwise the field value will be left null without warning//. **Make sure that the agent has been assigned to a server.**
**Optional parameters:**
* < address IP or URL>
* < description >
* If you omit the description it will be added ''Created by < server_name >''.
* < interval >
* < alias as 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf --create_agent \
'My agent' AIX Databases Central-Server \
192.168.12.123 'Agent description' '' 0
==== update_agent ====
**Mandatory parameters:**
* < name_of_agent >
* < field >
* < new_value >
**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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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
==== agent_update_custom_fields ====
Version NG 758 or later. \\ **Parameters:**
- ''id_agent'' → agent identifier.
- ''type_field'' → field type which can be ''0'' if it is a text type or ''1'' if it is a combobox (select) type composed of several options. See section on answers. Successful example:{{ :wiki:pfms-pandorafms:technical_reference-03_anexo_cli-agent_update_custom_fields-img01.png }}
- ''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:
* **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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
TEXT TYPE:
pandora_manage /etc/pandora/pandora_server.conf --agent_update_custom_fields 1 0 'Serial number' 'john'
{{ :wiki:pfms-pandorafms:technical_reference-03_anexo_cli-agent_update_custom_fields-img02.png }}
COMBO TYPE:
pandora_manage /etc/pandora/pandora_server.conf --agent_update_custom_fields 1 1 'Names' 'john'
==== delete_agent ====
**Mandatory parameter:**
* < agent_name >
**Optional parameter:**
* ''use_alias''
* Note that agent aliases can be repeated and you can delete several agents in one step.
**Description:**
The agent(s) will be deleted by passing its name or alias as a parameter.
**Example (see [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf \
--delete_agent 'My Agent' \
use_alias
{{ :wiki:pfms-pandora_manage--delete_agent-use_alias.png }}
==== 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf --disable_group Firewalls
{{ :wiki:pfms-pandora_manage_--disable_group-example_1.png }}
==== enable_group ====
**Mandatory 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf --enable_group firewalls
{{ :wiki:pfms-pandora_manage_--enable_group-example_1.png }}
==== create_group ====
**Mandatory 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf --create_group \
'New group name' \
Web computer 'New description.'
==== delete_group ====
**Mandatory parameter:**
* < group_name >
**Description:**
Delete an agent group.
Every agent belongs to indicated group will be deleted too.
**Example (see [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf –-delete_group 'Group name'
==== update_group ====
**Mandatory 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 " [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf –update_group 18 \
'Group name' 'Web' 'transmit' 'Description'
==== stop_downtime ====
**Mandatory 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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 [] : 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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 ====
**Mandatory 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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 ====
**Mandatory 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf --get_all_planned_downtimes ''
==== get_planned_downtimes_items ====
**Mandatory 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf --get_planned_downtimes_items 'Name downtime'
==== set_planned_downtimes_deleted ====
**Mandatory 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf --set_planned_downtimes_deleted 7
==== set_disabled_and_standby ====
[[https://pandorafms.com/en/prices/?o=dwpfms|{{:wiki:icono-modulo-enterprise.png?nolink&23x23 |Enterprise version}}]] Only for Metaconsole and Nodes.
\\ **Required parameters:**
* < id_agent >
* //For 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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 ====
**Mandatory 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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 ====
**Mandatory parameters:**
* < agent_id >
**Optional parameters:**
* None.
**Description:** Gets an [[:en:documentation:pandorafms:monitoring:20_gis|agent's GIS data]].
**Examples (see [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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'' .
==== cli_agent_set_os ====
**Mandatory 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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|syntax]]):**
pandora_manage /etc/pandora/pandora_server.conf --cli_agent_set_os 7 3 'Ubuntu 16.04'
===== Modules =====
==== create_data_module ====
**Required parameters:**
* < module_name >
* < module_type >
* < agent_name >
**Optional parameters:**
- < description >
- < module_group >
- < min >
- < max >
- < 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''
**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 [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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.
==== Create_web_module ====
**Parameters:** [[]
**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'
==== Create_network_module ====
**Parameters:** []
**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'
==== 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 ====
**Parameters:** []
**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'
==== Create_plugin_module ====
**Parameters:** []
**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'
==== 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 ====
**Mandatory 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 if the Enterprise version is available. From version 771 on wards, the //descendants// of the deleted module are deleted recursively.
**Examples (see [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#pandora_fms_cli|call]] and [[:en:documentation:pandorafms:technical_reference:03_anexo_cli#syntax|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:**