Command Line Interface (CLI)

Pandora FMS CLI

The Pandora FMS CLI (Command-Line Interface) is used by making command-line calls to the pandora_manage file.

This method is especially useful for integrating third-party applications with Pandora FMS through automated tasks. It basically consists of a call with the formatted parameters to perform an action such as creating and deleting an agent, a module, or a user, among others.

Syntax

Syntax with the backslash \ as a line connector:

pandora_manage \
    <pandora_server.conf path> \
    <option> \
    <option parameters> \
    [ optional parameters ]
  • All parameters, mandatory or optional, can be enclosed in single quotes. This is especially useful when a parameter has one or more spaces.
  • If a parameter needs to be omitted, two single quotes together can be used. If the parameter is strictly necessary, an [ERROR] Error: type message will be shown followed by its description. This is also useful to indicate empty optional parameters.
  • Some parameters are case-sensitive, others are not. For example, when creating an agent, the PFMS server name must be strictly the same, however, the name of the primary group to which the agent will belong can be in uppercase and/or lowercase and if there is a match the group will be assigned.
  • You can use an agent's alias, 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 | more

To get help on a specific option, enter the option without parameters:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_user

Commands are grouped into the following categories:

Agents

create_agent

Mandatory parameters (syntax):

  • <agent name> Returns an error if the name exists (see <alias as name>).
  • <operating system> Must match an existing OS (case-insensitive), otherwise it will be registered without any OS.
  • <name of agent group >
  • <server name> Strictly case-sensitive, otherwise the field value will be left null without displaying 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 that value the agent's alias will be the same as the agent's name. If you want the name to be randomly generated, you must 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 by using 0 as the last parameter, you must specify the agent's period, with the recommended value being 300 seconds.

Example (see call and 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' '300' 0

update_agent

Mandatory parameters (syntax):

  • <agent_name>
  • <field_to_modify>
  • <new_value>

Optional parameters:

  • use_alias

Description: An existing agent's <field_to_modify> will be updated. The available fields are as follows:

  • agent_name
  • address Even if the Unique IP token is enabled, you will not receive any warning for a repeated IP address (ISSUE 12992).
  • description
  • group_name
  • interval
  • os_name
  • disabled (0 to enable it, 1 to disable it, any other value used will have unpredictable results, ISSUE 13096).
  • parent_name If the parent agent is changed and the Cascade protection modules token is enabled on the child agent, it must be reconfigured so the cascade effect can be executed (ISSUE 13097). The parent agent must also have at least one registered module.
  • cascade_protection (0 to disable it, 1 to enable it, any other value used will have unpredictable results, ISSUE 13098).
  • icon_path to change the icon representing the agent in GIS maps, possible values are: circle, cross, marker, square_marker, star and triangle.
  • update_gis_data (0 to disable it, 1 to enable it).
  • custom_id

To identify the agent by its alias instead of its name, use use_alias right at the end.

Examples (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --update_agent \
  'My Agent' agent_name 'Agent 2'

When changing an agent's IP address, keep in mind that this command allows IP addresses to be repeated.

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, you must use only 0 and 1; any other value will produce unpredictable search and/or visualization 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, you must use only 0 and 1; any other value will produce unpredictable search and/or visualization results in the Web Console.

pandora_manage /etc/pandora/pandora_server.conf \ 
  --update_agent \
    'My Agent' cascade_protection 1 \
    use_alias
pandora_manage /etc/pandora/pandora_server.conf \ 
  --update_agent \
    'My Agent' icon_path cross \
    use_alias

agent_update_custom_fields

Mandatory parameters (syntax):

  • <agent_id> agent identifier.
  • <field_type> which can be 0 if it is a text type or 1 if it is a drop-down list (combo or combo box) type made up of several options. See the responses section.
  • <field_to_change> name of the custom field to update.
  • <new_value> the value of the custom field to update.

Description: updates an agent's custom fields. This command is incompatible with link type and password type custom fields (ISSUE 13532).

The responses it consists of are:

  • ERROR:
  • If the agent does not exist.
  • If the field does not exist.
  • In case the new_value of a combo box does not match its preset ones.
  • If it could not update the field.
  • INFO:
  • Updating field X with agent id Y.
  • Successfully updated.

Examples (see call and syntax):

TEXT TYPE:

pandora_manage /etc/pandora/pandora_server.conf \
 --agent_update_custom_fields \
 1 0 'Serial number' 'THX-1138'

LIST TYPE: a custom field named Names must have been configured with at least one item named John.

pandora_manage /etc/pandora/pandora_server.conf \
 --agent_update_custom_fields \
 1 1 'Names' 'John'

delete_agent

Mandatory parameters (syntax):

  • <agent_name>

Optional parameter:

  • use_alias

Description:

The agent will be deleted by passing its name or alias as a parameter.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \
    --delete_agent 'pandora.internals' \
    use_alias

disable_group

Mandatory parameter:

  • <group_name>

Description:

Disables all agents in a group. The group's agents passed as a parameter will be disabled upon execution of this option.

If All is passed as the group, all agents in all groups will be disabled.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --disable_group Firewalls

enable_group

Mandatory parameter:

  • <group_name>

Description:

The agents in the group passed as a parameter will be enabled upon execution of this option. If All is passed as the group, all agents in all groups will be enabled.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --enable_group FIREWALLS

create_group

Mandatory parameter:

  • <new_group_name>

Optional parameters:

  • <parent_group_name>
  • <icon> available options:
  • 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 the name does not exist and, optionally, it can be assigned a “parent” or higher group, an icon for graphical identification (the icon name, without extension, use only the listed options ISSUE 9408) and a description. The default parent group is 'All' and the default icon is an empty text string (no icon, it will not use it).

If you need to add a description:

  • If you do not use a parent group, put All as a padding parameter.
  • If you do not use any icon, put an empty string (two single quotes together) as a padding parameter.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_group \
    'New group name' \
    Web computer 'New description.'

delete_group

Mandatory parameter:

  • <group_name>

Description:

Deletes an agent group and its agents. The special group All cannot be deleted.

Each agent belonging to the indicated group will also be deleted.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_group 'Group name'

update_group

Mandatory parameter:

  • <group_id>

Optional parameters:

  • <group_name_to_modify>
  • <parent_group_name>
  • <icon> available options:
  • 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 using its numeric identifier. The parameters that can be modified are:

  • Group name.
  • “Parent” or higher group name.
  • Icon (only the name, without file extension, choose one from the described list).
  • Description.
  • You can use the “ get_agent_group_id ” function to obtain the numeric group identifier of any agent.
  • In the Web Console you can go to the menu Management → Profiles → Manage agent groups and note down the numeric identifier.

You must type exactly the same existing parameters if you need to change only the description.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --update_group 2 \
    'Group name' 'Web' 'transmit' 'Description'

stop_downtime

Mandatory parameter:

  • <planned_downtime_name>

Description:

Stops a planned downtime. If the disconnection has already finished, a message will be displayed. Return messages:

  • [ERROR] Planned_downtime cannot be stopped (the planned downtime cannot be stopped).
  • [INFO] Planned_downtime is already stopped (the planned downtime is already stopped).
  • [INFO] Stopping planned downtime (stopping planned downtime).

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --stop_downtime 'Downtine name'

get_agent_status

Mandatory parameter:

  • <agent_name>

Optional parameter:

To identify the agent by its alias instead of its name, use use_alias right at the end.

Description: Get the status of a specific agent by its name or alias.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \
  --get_agent_status 'agent name' use_alias

get_agent_group

Mandatory parameter:

  • <agent_name>

Optional parameter:

To identify the agent by its alias instead of its name, use use_alias right at the end.

Description: Get the group of a specific agent by its name or alias. Said agent group name will be returned with URL encoding (Percent-encoding).

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \
  --get_agent_group 'agent name' use_alias

get_agent_group_id

Mandatory parameter:

  • <agent_name>

Optional parameter:

To identify the agent by its alias instead of its name, use use_alias right at the end.

Description: Get the identifier of a specific agent by its name or alias.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_agent_group_id 'pandora.internals'
pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_agent_group_id 'pandorafms agent' use_alias

get_agent_modules

Mandatory parameter:

  • <agent_name>

Optional parameter:

To identify the agent by its alias instead of its name, use use_alias right at the end.

Description: Get the modules (identifiers and names, separated by a comma) of a specific agent by its name or alias.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_agent_modules 'agent name' use_alias

get_agents

Mandatory parameter: None.

Optional parameters: allow filtering the agent list in a serialized format where the order matters, use two single quotes to bypass parameter(s). They are numbered here for better control and visualization:

  1. <status> Possible values: critical, warning, unknown, normal.
  2. <maximum_number_of_modules> Only a numeric value must be used (ISSUE 13968).
  3. <keyword> Allows filtering by agent name (or agent alias if you add use_agent_alias at the end).
  4. <policy_name>
  5. use_alias to search for an agent by its alias instead of its name.

Description: Get all agents (without parameters) or agents according to a filter.

Example (see call and syntax):

  • Get all agents in the Network group:
pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_agents 'Network' '' '' '' '' ''
  • Get all agents having Linux as operating system:
pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_agents '' 'Linux' '' '' '' ''
  • Get all agents whose status is normal:
pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_agents '' '' 'normal' '' '' ''
  • Get all agents with zero modules (without any module):
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 containing the word test in their alias:
pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_agents '' '' '' '' 'test' '' use_alias
  • Get all agents that are in the monitoring policy named Basic Linux Monitoring:
pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_agents '' '' '' '' '' 'Basic Linux Monitoring'

get_agents_id_name_by_alias

Mandatory parameter: <agent_alias>

Optional parameter: strict

Description: Lists the identifiers and aliases of the agents matching the specified alias, case-insensitive. Using the optional parameter strict limits the search to an exact match of all letters.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_agents_id_name_by_alias 'name' strict

delete_conf_file

Mandatory parameter: <agent_name>

Optional parameter: use_alias

Description: An agent's configuration file will be deleted. When accessing via the Web Console in the Remote configuration option, an error message will be received: Error: the conf file of agent is not readable..

All connection values and all agent configuration will also be deleted.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_conf_file 'agent alias' use_alias

clean_conf_file

Mandatory parameter: <agent_name>

Optional parameter: use_alias

Description: An agent's configuration file will be cleaned (all the file's content will be deleted - including connection values and configuration parameters ISSUE 13663).

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --clean_conf_file 'agent alias' use_alias

get_bad_conf_files

Parameters: None.

Description:

  1. Badly configured configuration files will be listed by searching in the main tokens:
  • server_ip
  • server_path
  • temporal
  • logfile
  1. In case there are corrupted files that cannot be opened:

[WARN] Can't open file <path_file>.

  1. In case the file is not found in the path:

[WARN] File not exist <path_file>.

  1. In case the configuration files are correct (according to the tokens from the first point):

[INFO] No bad files found

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_bad_conf_files

migration_agent_queue

Only for the Command Center (Metaconsole).

Mandatory parameters:

  • <id_of_agent_to_migrate>
  • <source_node_name>
  • <destination_node_name>

Optional parameter:

  • <db_only> default 0, will migrate database and historical data, if it is 1 it will only migrate database without historical data.

Description: An agent is added to the migration queue to be moved from one node to another node.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --migration_agent_queue 1 node_1 node_2 0

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.1)

migration_agent

Only for the Command Center (Metaconsole).

Mandatory parameter: <id_agent_to_check>

Description: It will return true or false depending on whether the introduced agent exists in the agent migration table.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --migration_agent 1

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.2)

create_downtime

Mandatory parameters (syntax):

  • <planned_downtime_name>
  • <description>
  • <date_from>
  • <date_to>
  • <group_id>
  • <monday (0|1) >
  • <tuesday (0|1) >
  • <wednesday (0|1) >
  • <thursday (0|1) >
  • <friday (0|1) >
  • <saturday (0|1) >
  • <sunday (0|1) >
  • <time_from_in_period HH:MM:SS>
  • <time_to_in_period HH:MM:SS>
  • <day_number_from_in_period>
  • <day_number_to_in_period>
  • <planned_downtime_type (quiet|disable_agents|disable_agents_alerts) >
  • <execution_type periodically > (once option is disabled).
  • <periodicity_type (weekly|monthly) >
  • <user_id>

Description: A weekly or monthly planned downtime will be created with the sent data. The date format must be MM/DD/YYYY (Month/Day/Year) for this call to work properly.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_downtime \
  Testing Testing 05/07/2024 06/07/2024 \
  0 1 1 1 1 1 1 1 17:07:00 18:08:00 1 31 \
  quiet periodically weekly admin

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.3)

add_item_downtime

Mandatory parameters (syntax):

  • <planned_downtime_id>
  • <agent1_id,agent2_id,agent3_id,…,agentN_id>
  • <module1_name,module2_name,module3_name,…,moduleN_name>

Description:

Records will be added to a planned downtime with the sent data. Write the list of agent identifiers and the list of module names without leaving spaces between the commas separating the components of both lists. If a module name contains spaces, put said module name in single quotes. If two or more agents are passed, it is assumed by default that common modules are to be added, otherwise it will show a warning message.

Keep in mind that the command allows adding repeated items.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_item_downtime \
  1 1 Memory_Used,'CPU Load'

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.4)

get_all_planned_downtimes

Mandatory parameters:

  • <name_to_search>

Optional parameters (Issue 9414):

  • <group_id>
  • <planned_downtime_type> quiet, disable_agents, disable_agents_alerts.
  • <execution_type> once, periodically.
  • <periodicity_type> weekly, monthly.

Description:

All planned service downtimes matching the sent data will be listed.

Example (see call and syntax):

To get the full list of planned downtimes:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_all_planned_downtimes ''

To list a very specific planned downtime:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_all_planned_downtimes \ 
  "Stop 1" "8" "disable_agents" "periodically" "monthly"

get_planned_downtimes_items

Mandatory parameters:

  • <name_to_search>

Optional parameters (Issue 14343):

  • <group_id>
  • <planned_downtime_type> quiet, disable_agents, disable_agents_alerts.
  • <execution_type> once, periodically.
  • <periodicity_type> weekly, monthly

Description:

All items matching the requested service downtime name will be listed.

Example (see call and syntax):

To get all items from all planned downtimes:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_planned_downtimes_items ''

To get the items of planned downtimes containing the word new in uppercase and/or lowercase:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_planned_downtimes_items 'new'

To get the items of weekly planned downtimes:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_planned_downtimes_items '' '' '' '' 'weekly'

set_planned_downtimes_deleted

Mandatory parameters (syntax):

  • <planned_downtime_name>

Description:

Deletes a planned downtime by means of its corresponding name. It may respond with one of these messages:

  • This planned downtime is deleted.
  • Problems with this planned downtime.
  • The scheduled downtime is still being executed.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --set_planned_downtimes_deleted \
  'Name Scheduled Downtime'

set_disabled_and_standby

Only for the Command Center (Metaconsole) and nodes.

Mandatory parameters:

  • <agent_id>
  • For the Command Center (Metaconsole) the node identifier, for nodes any value is placed since it is indifferent.

Optional parameters:

  • <value> Default 1 to enable the agent, 0 to disable.

Description: Disables an agent and also, if it has remote configuration, puts it in standby mode.

Example (see call and syntax):

To enable an agent from the node:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --set_disabled_and_standby 2 0 1

To disable an agent from the node:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --set_disabled_and_standby 2 0 0

To enable an agent from the Command Center (Metaconsole):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --set_disabled_and_standby 2 1 1

To disable an agent from the Command Center (Metaconsole):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --set_disabled_and_standby 2 1 0

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.5)

reset_agent_counts

Mandatory parameters (syntax):

<agent_numeric_identifier>

Description: Synchronizes the module and alert counts of a given agent. In case you want to synchronize with all agents, the first parameter must be All.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --reset_agent_counts "All"

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.6)

insert_gis_data

Mandatory parameters (syntax):

  • <agent_numeric_identifier>
  • <latitude>
  • <longitude>
  • <altitude>

Optional parameters:

  • None.

Description: Updates the GIS data of an agent. This feature must be enabled in the general PFMS configuration.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --insert_gis_data 1 2 3 4

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.7)

get_gis_agent

Mandatory parameters (syntax):

  • <agent_numeric_identifier>

Optional parameters:

  • None.

Description: Gets the GIS data of an agent. This feature must be enabled in the general PFMS configuration.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_gis_agent 1

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.8)

agent_set_os

Mandatory parameters:

  • <agent_numeric_identifier>
  • <operating_system_numeric_identifier>
  • <operating_system_version>

Optional parameters:

  • None.

Description: Allows adding or changing the operating system (and obsolescence) to an agent.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --agent_set_os 7 1 'Ubuntu 16.04'

locate_agent

Mandatory parameter: <agent_name>

Optional parameter: use_alias to search by agent alias.

Description: Searches for an agent in the nodes of a Command Center (Metaconsole) and returns the node identifier.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --locate_agent NAS use_alias

Modules

create_data_module

Mandatory parameters:

  1. <module_name>
  2. <module_type>
  3. <agent_name>
  4. <description>
  5. <module_group>
  6. <minimum>
  7. <maximum>

Although fields 4 to 7 are mandatory, you can omit these parameters using quotes "". In case of establishing the minimum and maximum values accepted by the module, any value outside this range will be discarded.

Optional parameters:

  1. <post_process>
  2. <interval>
  3. <warning_minimum>
  4. <warning_maximum>
  5. <critical_minimum>
  6. <critical_maximum>
  7. <historical_data>
  8. <definition_file>
  9. <warning_string>
  10. <critical_string>
  11. <enable_unknown_events>
  12. <flip-flop_threshold>
  13. <each_flip-flop>
  14. <normal_flip-flop_threshold>
  15. <warning_flip-flop_threshold>
  16. <critical_flip-flop_threshold>
  17. <flip-flop_timeout>
  18. <warning_inverse>
  19. <critical_inverse>
  20. <critical_instructions>
  21. <warning_instructions>
  22. <unknown_state_instructions>
  23. use_agent_alias: For the agent search, it uses the agent alias instead of the agent name.
  24. ignore_unknown: Discards the unknown state calculation, so the module will never change to that state and will always keep the last known state.
  25. <number_of_intervals_in_warning> Allows state scaling by specifying the maximum number of consecutive intervals in which the module remains in warning state. Upon exceeding this value, the module will scale to critical state.

Description: A data type module will be created in an agent with the module name, module type, and agent name (see the use_agent_alias option) where it will be created. Optionally, it can be given a description, the module group, etc.

The default values are 0 for minimums and maximums, historical_data, and post_process; 300 for the interval.

Example (see call and syntax):

Basic example:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_data_module "My new module" "generic_data" \ 
  "pandora.internals" "My description" "Miscellaneous" "0" "100"

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 a different name or type is introduced between the parameters and the file definition, what is established in the file will take priority.

create_web_module

Mandatory parameters:

  1. <module_name>
  2. <module_type> web_data, web_proc, web_content_data, web_content_string.
  3. <agent_name>
  4. <description>

In <module_type> the possible values are:

Optional parameters:

  1. <module_group>
  2. <minimum>
  3. <maximum>
  4. <post_process>
  5. <interval>
  6. <warning_minimum>
  7. <warning_maximum>
  8. <critical_minimum>
  9. <critical_maximum>
  10. <historical_data>
  11. <retries>
  12. <queries>
  13. <agent_browser_identifier>
  14. <authentication_server>
  15. <authority_realm>
  16. <definition_file>
  17. <proxy_url>
  18. <proxy_auth_login_authorization>
  19. <proxy_auth_login_authorization_password>
  20. <warning_string>
  21. <critical_string>
  22. <enable_unknown_events>
  23. <flip-flop_threshold>
  24. <each_flip-flop>
  25. <normal_flip-flop_threshold>
  26. <warning_flip-flop_threshold>
  27. <critical_flip-flop_threshold>
  28. <flip-flop_timeout>
  29. <warning_inverse>
  30. <critical_inverse>
  31. <critical_instructions>
  32. <warning_instructions>
  33. <unknown_state_instructions>
  34. use_agent_alias: For the agent search, it uses the agent alias instead of the agent name.
  35. ignore_unknown: Discards the unknown state calculation, so the module will never change to that state and will always keep the last known state.
  36. <number_of_intervals_in_warning> Allows state scaling by specifying the maximum number of consecutive intervals in which the module remains in warning state. Upon exceeding this value, the module will scale to critical state.

Description: A web type module will be created in an agent with the module name, module type, and agent name (see the use_agent_alias parameter) where it will be created. Optionally, it can be given a description, the module group, minimum and maximum values, a module definition file, among other parameters. In case of establishing the minimum and maximum values accepted by the module, any value outside this range will be discarded.

Example (see call and syntax):

Basic example:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_web_module "My new web_content_string" \ 
  "web_content_string" "pandora.internals" \ 
  "My description" "Miscellaneous" "0" "100"

Simple example for state scaling:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_web_module web_module_test web_data \ 
  3f9c41953a072afa229aa0a7fe3a6203a1ecf86b40b8a13d8a7d9916f0210bb1 \ 
  "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" \ 
  "" "" "" "" "" "" "" "" "" "" "" "" "" "" 2001

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

Mandatory parameters:

  1. <module_name>
  2. <module_type> accepts the following values: remote_icmp_proc, remote_icmp, remote_tcp, remote_tcp_proc, remote_tcp_string, remote_tcp_inc.
  3. <agent_name>
  4. <module_address>
  5. <module_port> only for TCP: numeric value between 1 and 65535.
  6. <description>
  7. <module_group>
  8. <min>
  9. <max>
  10. <post_process>
  11. <interval>
  12. <warning_min>
  13. <warning_max>

Optional parameters:

  1. <critical_min>
  2. <critical_max>
  3. <history_data>
  4. <ff_threshold>
  5. <warning_str>
  6. <critical_str>
  7. <enable_unknown_events>
  8. <each_ff>
  9. <ff_threshold_normal>
  10. <ff_treshold_warning>
  11. <ff_threshold_critical>
  12. <timeout>
  13. <retries>
  14. <critical_instructions>
  15. <warning_instructions>
  16. <unknown_instructions>
  17. <warning_inverse>
  18. <critical_inverse>
  19. use_agent_alias to search for the agent by its alias instead of its name.
  20. ignore_unknown Discards the unknown state calculation, so the module will never change to that state and will always keep the last known state.
  21. <number_of_intervals_in_warning> Allows state scaling by specifying the maximum number of consecutive intervals in which the module remains in warning state. Upon exceeding this value, the module will scale to critical state.

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 specified module address. Optionally, it can be given a port number, a description, minimum and maximum values, and other optional values.

The default values are 0 for minimums and maximums, history_data, and post_process, and 300 seconds for the interval.

Example (see call and syntax):

Basic example:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_network_module \ 
  "My Network Module" "remote_icmp_proc" \ 
  "pandora.internals" "" "22" "My description" \ 
  "Enviromental" "" "" "" "" "" ""

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

Mandatory parameters:

  1. <network_component_name>
  2. <network_component_type> Only of the following numeric values (using any other value may produce unexpected results):
  • 6 Remote ICMP network agent, boolean data.
  • 7 Remote ICMP network agent (latency).
  • 8 Remote TCP network agent, numeric data.
  • 9 Remote TCP network agent, boolean data.
  • 10 Remote TCP network agent, alphanumeric data.
  • 11 Remote TCP network agent, incremental data.
  • 15 Remote SNMP network agent, numeric data.
  • 16 Remote SNMP network agent, incremental data.
  • 17 Remote SNMP network agent, alphanumeric data.
  • 18 Remote SNMP network agent, boolean data.

Optional parameters:

  • <description>
  • <module_interval> In seconds.
  • <max_value> Any value above this number is discarded.
  • <min_value>
  • <snmp_community>
  • <max_timeout> Field not editable by Web Console.
  • <history_data> Check this option if you need to save values long-term in the historical database. Active: 1, inactive: 0 (using any other value may produce unexpected results).
  • <min_warning>
  • <max_warning> Must be greater than <min_warning>.
  • <str_warning> Used if the component type is alphanumeric data.
  • <min_critical>
  • <max_critical> Must be greater than <min_critical>.
  • <str_critical> Used if the component type is alphanumeric data.
  • <min_ff_event>
  • <post_process>
  • <disabled_types_event> JSON format.
  • <each_ff>
  • <min_ff_event_normal>
  • <min_ff_event_warning>
  • <min_ff_event_critical>

Description: A network component will be created. Optionally, it can be given a port, a description, minimum and maximum values, a post-processing value, an interval in seconds, minimum and maximum warning values, minimum and maximum critical values, and a historical data value.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
 --create_network_component "example_name" 2 7

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.9)

create_snmp_module

Mandatory parameters:

  1. <module_name>
  2. <module_type> the following options are valid: remote_snmp, remote_snmp_inc, remote_snmp_proc.
  3. <agent_name>
  4. <module_address>
  5. <module_port> numeric value between 1 and 65535.
  6. <version>
  7. <community>
  8. <oid>
  9. <description>
  10. <module_group>
  11. <min>
  12. <max>
  13. <post_process>
  14. <interval>

Optional parameters:

  1. <warning_min>
  2. <warning_max>
  3. <critical_min>
  4. <critical_max>
  5. <history_data>
  6. <snmp3_priv_method>
  7. <snmp3_priv_pass>
  8. <snmp3_sec_level>
  9. <snmp3_auth_method>
  10. <snmp3_auth_user>
  11. <snmp3_auth_pass>
  12. <ff_threshold>
  13. <warning_str>
  14. <critical_str>
  15. <unknown_events>
  16. <each_ff>
  17. <ff_threshold_normal>
  18. <ff_threshold_warning>
  19. <ff_threshold_critical>
  20. <timeout>
  21. <retries>
  22. use_alias to search for the agent by its alias instead of its name.
  23. ignore_unknown Discards the unknown state calculation, so the module will never change to that state and will always keep the last known state.
  24. <critical_instructions>
  25. <warning_instructions>
  26. <unknown_instructions>
  27. <warning_inverse>
  28. <critical_inverse>
  29. <number_of_intervals_in_warning> Allows state scaling by specifying the maximum number of consecutive intervals in which the module remains in warning state. Upon exceeding this value, the module will scale to critical state.

Description: An SNMP type module will be created in an agent with the module name (non-null), module type, agent name where it will be created, the module address, the associated port, the SNMP version, community name, an OID, a description, the module group, minimum and maximum values, a post-processing value, a check interval (in seconds), along with other optional values.

The default values are 0 for minimums and maximums, history_data, and post_process, and 300 seconds for the interval.

Example (see call and syntax):

Basic example:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_snmp_module "My Module SNMP" "remote_snmp_inc" \ 
  "pandora.internals" "" "777" "" "" "" "My Description" \ 
  "Performance" "" "" "" ""

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> numeric value between 1 and 65535.
  • <plugin_name> one of the registered ones (menu Management → Servers → Plugins).
  • <user>
  • <password>
  • <params>
  • <description>
  • <module_group>

Optional parameters:

  • <min>
  • <max>
  • <post_process>
  • <interval>
  • <warning_min>
  • <warning_max>
  • <critical_min>
  • <critical_max>
  • <history_data>
  • <ff_threshold>
  • <warning_string>
  • <critical_string>
  • <enable_unknown_events>
  • <each_ff>
  • <ff_threshold_normal>
  • <ff_threshold_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 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. Upon exceeding this value, the module will scale to critical state.

Description: A plugin type module will be created in an agent with the module name, module type, agent name where it will be created, the module address, the associated port, the corresponding plugin name, a description, the module group, and minimum and maximum values, among other optional values.

The default values are 0 for minimums and maximums, history_data, and post_process, and 300 for the interval.

Example (see call and syntax):

Basic example:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_plugin_module \ 
  "My plugin module" "generic_data" "pandora.internals" "" "8080" \ 
  "DNS Plugin" "" "" "" "" "" "" "" "" "" "" ""

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 '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

Advanced example:

If you need to set a timeout 30, you must explicitly pass each of the optional parameters with "" so that the indicated position (in this case the timeout) is correct:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_plugin_module \ 
  MyModule generic_data MyAgent 127.0.0.1 5667 \ 
  MyPlugin "" "" "" "" MyGroup "" "" "" "" "" "" \
  "" "" "" "" "" "" "" "" "" "" "" "" 30

get_module_group

Optional parameters:

  • <module_group_name>

Description: Shows the available module groups. We can filter by adding the group name or part of it.

Response: CSV format with headers.

  • id_module_group
  • group_name

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_module_group "general"

create_module_group

Mandatory parameter:

  • <group_name>

Description: A module group will be created with the specified name.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_module_group "My module group"

module_group_synch

Mandatory parameter: <server_name_1|server_name_2| … |server_name_n>

Optional parameter: <return_type> JSON and CSV, default is CSV format.

Description: The module groups of the Command Center will be synchronized with the nodes specified in the first parameter, separated by |.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --module_group_synch \
"server_name1|server_name2|server_name3" "json"

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.10)

create_synthetic

Parameters:

  • <module_name>
  • <synthetic_type> arithmetic or average.
  • <agent_name>
  • <opts>
  • use_alias

Description: A synthetic module will be created in the agent and with the indicated module name. The module type can be arithmetic (arithmetic) or average (average). Operators can be: +-*/x.

Examples (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_synthetic example_module arithmetic example_agent <opts>
pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_synthetic example_module average example_agent <opts>

Possible parameters to use in <opts>:

  • <opts> = <source_agent1>,<operand>,<source_module1> <source_agent2>,<operand>,<source_module2>
  • <opts> = <source_agent1>,<operand>,<source_module1> <operand>,<fixed_value>

delete_module

Mandatory parameters:

  • <module_name>
  • <agent_name>

Optional parameters:

  • use_alias

Description: A module from an agent will be deleted by passing the name of both as parameters (or with the agent's alias using use_alias). If this module is on a local agent, it will also be deleted from the configuration file. Starting from version 771, the descendants of the deleted module are recursively deleted.

Examples (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_module 'My module' 'My agent'

data_module

Mandatory parameters:

  • <pfms_server_name>
  • <agent_name>
  • <module_name>
  • <new_data>

Optional parameters:

  • <date_time> in format YYY-MM-DD HH:mm.
  • use_alias if this option is used, a valid date and time must be specified.

Description: Inserts a value into a module.

Responses:

  • [ERROR] No module found with this type.: The module type differs from the one registered for the requested module.
  • [INFO] Inserting data to module: Successful response.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --data_module "pandorafms" "pandorafms agent" \ 
  "CPU Load" generic_data 77 "2024-07-19 13:38" use_alias

get_module_data

Mandatory parameters:

  • <agent_name>
  • <module_name>
  • <interval> value in seconds.

Optional parameters:

  • <separator> in quotes, if necessary; default is “|”.
  • use_alias if this option is used, a separator must be specified.

Description: Module data for the last X seconds (requested interval) will be returned using the separator between timestamp and value.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_module_data "pandorafms agent" "CPU Load" 7200 "," use_alias

get_module_id

Mandatory parameters:

  • <agent_numeric_identifier> if the identifier is not registered, it will return an error message indicating that the requested module does not exist.
  • <module_name>

Description: The numeric identifier of a specific module of an agent will be returned.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_module_id 2 "CPU Load" && echo ""

set_module_custom_id

Mandatory parameters:

Description: Inserts the value of the Custom ID field of a specific module. If it is left null “”, its content will be deleted.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --set_module_custom_id 21 "My id value" && echo ""

get_module_custom_id

Mandatory parameter:

Description: The value of the Custom ID field (including entities and without a line break) of a specific module of an agent will be returned.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_module_custom_id 4

delete_data

Description: All data associated with the specified object (module, agent, or agent group) will be deleted from the historical data.

Parameter to delete module data: -m <module_name> <agent_name>

Parameter to delete agent data: -a <agent_name> (optional use_alias)

Parameter to delete group data: -g <agent_group_name>

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_data -a "agent_alias" use_alias

update_module

Mandatory parameters:

  • <module_name>
  • <agent_name>
  • <field_to_update>
  • <new_value>

Optional parameter:

  • use_agent_alias

Description: A given field of an existing module will be updated. The module type will be detected to allow updating the specific fields for each type.

You should always keep in mind that EndPoints with remote configuration enabled can overwrite the changes made.

The possible fields to modify are:

Common to any module:

  • module_name
  • description
  • module_group
  • min
  • max
  • post_process
  • history_data (only 1 or 0 must be used)
  • interval
  • warning_min
  • warning_max (must be greater than warning_min)
  • critical_min
  • critical_max (must be greater than critical_min)
  • warning_str (not to be confused with warning_instructions)
  • critical_str (not to be confused with critical_instructions)
  • ff_threshold
  • each_ff (integer numeric value used in plugins)
  • ff_threshold_normal
  • ff_threshold_warning
  • ff_threshold_critical
  • critical_instructions
  • warning_instructions
  • unknown_instructions

For data modules: ff_timeout.

For network modules: module_address, module_port.

For SNMP type 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 plugin type modules:

  • module_address
  • module_port
  • plugin_name
  • user
  • password.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --update_module "CPU load" "pandorafms agent" "description" "new description"

With the agent_name parameter, a module can be moved from one agent to another agent identified only by its name:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --update_module "last_events_24h" "pandora.internals" \ 
  "agent_name" \ 
  4be5603649674274b9b7ba841118a876c2365f70667eb0da37badd498b6a4aa8

add_tag_to_module

Mandatory parameters:

  • <agent_name>
  • <module_name>
  • <tag_name>

Description: Adds a tag (menu Management → Profiles → Module tags) to the specified module.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_tag_to_module "pandora.internals" "console_log_size" "Dmz"

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.11)

get_agents_module_current_data

Mandatory parameter:

  • <module_name>

Description: Gets the agent identifier, its name, and the current data (separated by commas) of all modules with the exact requested name (regardless of uppercase and/or lowercase).

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_agents_module_current_data "cpu load"

create_network_module_from_component

Mandatory parameters:

  • <agent_name>
  • <remote_component_name>

Optional parameters:

  • use_alias

Description: Creates a module in a given agent from a remote component. You must provide the agent name or its alias with the use_alias option.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_network_module_from_component \ 
  "pandorafms agent" "IIS PutRequestsPersec" use_alias

create_data_module_from_local_component

Mandatory parameters:

  • <agent_name>
  • <local_component_name>

Optional parameters:

  • use_alias

Description: Creates a module in a given agent from a local component. You must provide the agent name or its alias with the use_alias option.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_data_module_from_local_component \ 
  "pandorafms agent" "Event 1000" use_alias

create_local_component

Parameters:

  • <component_name>
  • <data>
  • <description>
  • <id_os>
  • <os_version>
  • <id_network_component_group>
  • <type>
  • <min>
  • <max>
  • <module_interval>
  • <id_module_group>
  • <history_data>
  • <min_warning>
  • <max_warning>
  • <str_warning>
  • <min_critical>
  • <max_critical>
  • <str_critical>
  • <min_ff_event>
  • <post_process>
  • <unit>
  • <wizard_level>
  • <critical_instructions>
  • <warning_instructions>
  • <unknown_instructions>
  • <critical_inverse>
  • <warning_inverse>
  • <id_category>
  • <disabled_types_event>
  • <tags>
  • <min_ff_event_normal>
  • <min_ff_event_warning>
  • <min_ff_event_critical>
  • <each_ff>
  • <ff_timeout>

Description: To create a new local component.

Example (see call and syntax), the $PARAM variable is added for clarity:

PARAM=''
PARAM=$PARAM'module_begin\nmodule_name name\n'
PARAM=$PARAM'module_type generic_data\n'
PARAM=$PARAM'module_exec exec\nmodule_end'
 
pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_local_component 'New local component' \ 
  $PARAM

Alerts

create_template_module

Mandatory parameters:

  • <template_name>
  • <module_name>
  • <agent_name>

Optional parameters:

  • use_alias

Description: By means of a template, an alert will be created for a module of an agent.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_template_module "Manual alert" "CPU Load" "pandorafms agent" use_alias

delete_template_module

Mandatory parameters:

  • <template_name>
  • <module_name>
  • <agent_name>

Optional parameters:

  • use_alias

Description: An alert to a module of an agent that was created using an alert template will be deleted. It will return a response only if all three mandatory parameters exist and the operation is successful, otherwise no message will be shown.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_template_module \ 
  "Manual alert" "CPU Load" "pandorafms agent" use_alias

If the previous successful execution, it will show:

[INFO] Delete template 'Manual alert' from 
  module 'CPU Load' from agent 'pandorafms agent'

create_template_action

Mandatory parameters:

  • <action_name>
  • <template_name>
  • <module_name>
  • <agent_name >

Optional parameters:

  • <minimum_number_of_alerts>
  • <maximum_number_of_alerts>
  • use_alias

Description: An action will be added to an alert by passing as parameters the name of the action and that of the template, module, and agent that make up the alert. Optionally, it can also be passed the scaling values minimum number of alerts and maximum number of alerts (both defaulting to 0).

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_template_action \ 
  "Mail to Admin" "Manual alert" "CPU Load" "pandorafms agent" 3 4 use_alias

Delete_template_action

Mandatory parameters:

  • <action_name>
  • <template_name>
  • <module_name>
  • <agent_name>

Optional parameters:

  • use_alias

Description: An alert action will be deleted from an agent module that uses a template.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_template_action "Mail to Admin" \ 
  "Manual alert" "CPU Load" "pandorafms agent" use_alias

disable_alerts

Mandatory parameters: None.

Optional parameters: None.

Description: Disables all alerts. If there were already disabled alerts before the execution of this command and then its counterpart enable_alerts is executed, every single alert will be active again.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --disable_alerts

enable_alerts

Mandatory parameters: None.

Optional parameters: None.

Description: Enables all alerts. If there were already active alerts before the execution of this command and then its counterpart disable_alerts is executed, every single alert will be inactive again.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --enable_alerts

create_alert_template

Parameters:

  • <template_name>
  • <condition_type_serialized>
  • <time_from>
  • <time_to>
  • <description>
  • <group_name>
  • <field_1 >
  • <field_2 >
  • <field_3 >
  • <priority>
  • <default_action>
  • <days>
  • <time_threshold>
  • <min_alerts>
  • <max_alerts>
  • <alert_recovery>
  • <field_2_recovery>
  • <field_3_recovery>
  • <condition_type_separator>

Description: An alert template will be created.

Field <condition_type_serialized>: These are the template type options serialized with the default ; separator. You can change the separator with the <condition_type_separator> parameter to avoid conflicts in some options if there were a possibility that they contained the default character.

In the following examples the default separator ; is used and the matches_value field is a binary value to set whether the alert will trigger when the value matches or does not match the conditions.

Regular expression:

  • Syntax: <type>;<matches_value>;<value>
  • Example: regex;1;stopped|error (Alert when the value matches the regular expression 'stopped|error')

Maximum and minimum:

  • Syntax: <type>;<matches_value>;<min_value>;<max_value>
  • Example: max_min;0;30;50 (Alert when the value is outside the 30-50 range)

Maximum:

  • Syntax: <type>;<max_value>
  • Example: max;70 (Alert when the value is greater than 70)

Minimum:

  • Syntax: <type>;<min_value> :
  • Example: min;30 (Alert when the value is less than 30)

Equal to:

  • Syntax: <type>;<value>
  • Example: equal;0 (Alert when the value is equal to 0)

Not equal to:

  • Syntax: <type>;<value>
  • Example: not_equal;100 (Alert when the value is different from 100)

Warning state:

  • Syntax: <type>
  • Example: warning (Alert when the state changes to warning)

Critical state:

  • Syntax: <type>
  • Example: critical (Alert when the state changes to critical)

Unknown state:

  • Syntax: <type>
  • Example: unknown (Alert when the state changes to unknown)

State other than normal:

  • Syntax: <type>
  • Example: not_normal (Alert when the state is different from normal -warning, critical, etc.-)

In changing state:

  • Syntax: <type>;<matches_value>
  • Example: on_change;1 (Alert when the value changes)

Always:

  • Syntax: <type>
  • Example: always (Always alert)

The <days> field:

  • They are seven binary characters that specify the days of the week when the alert will be activated. e.g.: 0000011 to activate the alert only on Saturdays and Sundays.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_alert_template \
 "Template name" \
 "max_min@1@3@5" \
 "09:00 18:00" \
 "It sends an email interval 3-5, 9 AM-6 PM, Mondays. Separator forced to @" \
 "Unknown" \
 "[email protected]" \
 "subject" \
 "message" \
 "3" \
 "Mail to XXX" \
 "1000000" \
 "38600" \
 "1" \
 "2" \
 "0" \
 "@"

delete_alert_template

Mandatory parameter: <template_name>

Optional parameters: None.

Description: An alert template will be deleted if it exists.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_alert_template "Critical condition" "" "" "" "" "" ""

update_alert_template

Parameters:

  • <template_name>
  • <field_to_update>
  • <new_value>

Description: A given field of an existing alert template will be updated.

For <field_to_update> the possible fields are:

  • 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)
  • field_1
  • field_2
  • field_3
  • recovery_field_2
  • recovery_field_3
  • priority (0-4)
  • default_action
  • group_name

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --update_alert_template "Template name" "priority" "4"

get_alert_actions

Mandatory parameters: None.

Optional parameters:

  • <action_name>
  • <separator>
  • <format> csv (default), json, string

Description: Returns all alert actions. Optionally, the result can be filtered by keyword. Optionally, the result separator can be specified in the second parameter and the format of the result in the third parameter.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.jim --get_alert_actions '%28' ';' csv

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.12)

get_alert_actions_meta

Only for the Command Center (Metaconsole).

Parameters:

  • <server_name>
  • <action_name>
  • <separator>
  • <return_type>

Description: Returns all alert actions of the Command Center (Metaconsole). Optionally, the result can be filtered by node name or by action name. In the second parameter, the result separator can be specified and in the third parameter, the format of the returned list (csv, json, string).

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_alert_actions_meta  'Action 1' ';' 'json'

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.13)

create_alert_command

Parameters:

  • <command_name>
  • <command>
  • <id_group>
  • <description>
  • <internal>
  • <fields_descriptions>
  • <fields_values>

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 to the All group.
  • Command description.
  • Internal (1-0).
  • Field description in the following format: [“description_1”,“descrip_2”,“descrip_3”,“descrip_4”,“descrip_5”].
  • Field values in the following format: [“value_1”,“value_2”,“value_3”,“value_4”,“value_5”].

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_alert_command \
 'Test' 'command' 'All' 'Desc' '1' \
 '["des1","des2","des3","","des5","","","","",""]' \ 
 '["val1","val2","val3","val4","","","","","",""]'

get_alert_commands

Mandatory parameters: None.

Optional parameters:

  • <command_name>
  • <command_itself>
  • <group_name>
  • 1 to list commands for internal use in PFMS, 0 to list other commands.

Description: Allows seeing all the alert commands. Optionally, the result can be filtered by keyword in the following fields: command name, code executed by the alert command, group name, description, or whether it is for internal use.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_alert_commands "log" "echo" "" "0"

You cannot filter by agent group All since it is a system group that does not exist in the database.

validate_alert

Mandatory parameters:

  • <alert_template_name>
  • <agent_id>
  • <module_id>

Optional parameters:

  • use_alias if this option is used, the agent's alias must be placed instead of its identifier.

Description: Validates an alert given an alert template name, an agent ID, and a module ID.

Example (see call and syntax):

Assuming an alert is set on the agent that is installed by default with PFMS.

pandora_manage /etc/pandora/pandora_server.conf \ 
  --validate_alert "Critical condition" pandora.internals 99 use_alias

validate_all_alerts

Parameters: None.

Description: All alerts will be validated.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --validate_all_alerts

create_special_day

Mandatory parameters:

  1. <special_day>: Date in YYYY-MM-DD format.
  2. <calendar_name>: Calendar name, PFMS comes with the Default calendar created by default. The calendar name cannot contain spaces or special characters.
  3. <same_day>: Day of the week to emulate, they must be specified in English, case-insensitive.
  4. <description>: It can be omitted by putting quotes together, "" or ''.
  5. <group_name>: Agent group name, PFMS comes with the All group created by default. The group name cannot contain spaces or special characters.

Description: Create a special day.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_special_day \ 
  "2026-05-05" 'Default' "sunday" 'my description' "All"

delete_special_day

Parameters: <special_day>

Description: Deletion of the specified special day.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_special_day "2024-05-03"

update_special_day

Parameters:

  • <special_day>
  • <field_to_change>
  • <new_value>

Description: Modify a specific field of a special day. The fields that can be updated are: same_day, description, and group_name.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --update_special_day "2014-05-03" "same_day" "monday"

set_event_storm_protection

Mandatory parameters:

  • <value> 1 to enable, 0 to disable.

Optional parameters: None.

Description: Enables or disables the Event storm protection token. If it is enabled, no events or alerts will be generated while data (agent checks) are still being received. Only use 1 or 0, any other value may produce unexpected results.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --set_event_storm_protection 1

Users

create_user

Mandatory parameters:

  • <user_id>
  • <password>
  • <is_admin>

Optional parameters:

  • <comment>

Description: A user will be created with the user identifier (which will also be their username) and the received password. Also, a binary value will be received (<is_admin> 0 false or 1 true) specifying whether or not the user will be a superadmin. Optionally, a comment about the created user can be added.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_user "user7500" "user 7500" "0" \ 
  "User created by PFMS CLI."

This function also works in the Command Center (Metaconsole).

delete_user

Mandatory parameter:

  • <user_id>

Description: An attempt will be made to delete a user by passing their name as a parameter. You can verify if a user exists or not by using the update_user command.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_user user02

This function also works in the Command Center (Metaconsole).

update_user

Mandatory parameters:

  • <user_id>
  • <field_to_update>
  • <new_value>

The available fields for <field_to_update> are:

  1. email : email address.
  2. phone : phone number.
  3. is_admin : Is superadmin? (0 false, 1 true).
  4. comments : Comments.
  5. fullname : User's full name.
  6. password : User's password, use quotes if it contains spaces.
  7. language language, possible values:
  • default, takes the language selected in the general configuration.
  • ca, Catalan.
  • en_GB, English UK.
  • es, Spanish.
  • fr, French.
  • ru, Russian.
  • ja, Japanese.
  • zh_CN, Simplified Chinese.

Description: Updates the given field for an existing user.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --update_user "usuario 7500" password "XYZ"

This function also works in the Command Center (Metaconsole).

enable_user

Mandatory parameter:

  • <user_id>

Description: An existing user will be enabled. If they are already active, only a message will be displayed.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --enable_user "user7500"

This function also works in the Command Center (Metaconsole).

disable_user

Mandatory parameter:

  • <user_id>

Description: An existing user will be disabled. If they are already disabled, only a message will be displayed.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --disable_user "user7500"

This function also works in the Command Center (Metaconsole).

create_profile

Mandatory parameters:

  • <profile_name>
  • <permission_list> 1 to grant permission to the new profile or 0 to deny it, in this order:
  1. View agents (AR View agents): agent_view.
  2. Edit agents (AW Edit agents): agent_edit.
  3. Disable agents (AD Disable agents): agent_disable.
  4. Edit alerts (LW Edit alerts): alert_edit.
  5. Manage alerts (LM Manage alerts): alert_management.
  6. Manage users (UM Manage users): user_management.
  7. Manage database (DM Manage database): db_management.
  8. View events (ER View events): event_view.
  9. Edit events (EW Edit events): event_edit.
  10. Manage events (EM Manage events): event_management.
  11. View reports (RR View reports): report_view.
  12. Edit reports (RW Edit reports): report_edit.
  13. Manage reports (RM Manage reports): report_management.
  14. View network maps (MR View network maps): map_view.
  15. Edit network maps (MW Edit network maps): map_edit.
  16. Manage network maps (MM Manage network maps): map_management.
  17. View visual console (VR View visual console): vconsole_view.
  18. Edit visual console (VW Edit visual console): vconsole_edit.
  19. Manage visual console (VM Manage visual console): vconsole_management.
  20. Manage Pandora PFMS (PM Pandora FMS management): pandora_management.
  21. 0.
  22. 0.
  23. 0.

The following permissions must be added via the Web Console:

  1. View Network Config Management (NR View NCM data).
  2. Operate Network Config Management (NW Operate NCM -must include NR-).
  3. Manage Network Config Management (NM Manage NCM -must include NW and NR).
  4. Groups Write (GW Manage groups).

Description: A new profile will be created passing the profile name and permissions as parameters.

Example (see call and syntax):

To create a profile with only one PM permission:

pandora_manage /etc/pandora/pandora_server.conf \
 --create_profile "New Profile" \
 0 0 0 0 0 0 0 0 0 0 \
 0 0 0 0 0 0 0 0 0 1 1 1 1

This function also works in the Command Center (Metaconsole).

update_profile

Mandatory parameters:

  • <profile_name>
  • <permission_list> 1 to grant permission to the new profile or 0 to deny it, in this order:
  1. View agents (AR View agents): agent_view.
  2. Edit agents (AW Edit agents): agent_edit.
  3. Disable agents (AD Disable agents): agent_disable.
  4. Edit alerts (LW Edit alerts): alert_edit.
  5. Manage alerts (LM Manage alerts): alert_management.
  6. Manage users (UM Manage users): user_management.
  7. Manage database (DM Manage database): db_management.
  8. View events (ER View events): event_view.
  9. Edit events (EW Edit events): event_edit.
  10. Manage events (EM Manage events): event_management.
  11. View reports (RR View reports): report_view.
  12. Edit reports (RW Edit reports): report_edit.
  13. Manage reports (RM Manage reports): report_management.
  14. View network maps (MR View network maps): map_view.
  15. Edit network maps (MW Edit network maps): map_edit.
  16. Manage network maps (MM Manage network maps): map_management.
  17. View visual console (VR View visual console): vconsole_view.
  18. Edit visual console (VW Edit visual console): vconsole_edit.
  19. Manage visual console (VM Manage visual console): vconsole_management.
  20. Manage Pandora PFMS (PM Pandora FMS management): pandora_management.
  21. 0.
  22. 0.
  23. 0.

The following permissions must be added via the Web Console:

  1. View Network Config Management (NR View NCM data).
  2. Operate Network Config Management (NW Operate NCM -must include NR-).
  3. Manage Network Config Management (NM Manage NCM -must include NW and NR).
  4. Groups Write (GW Manage groups).

Description: A new profile will be modified passing the profile name and permissions as parameters.

Example (see call and syntax):

So that New Profile only has one PM permission:

pandora_manage /etc/pandora/pandora_server.conf \
 --update_profile "New Profile" \
 0 0 0 0 0 0 0 0 0 0 \
 0 0 0 0 0 0 0 0 0 1 1 1 1

This function also works in the Command Center (Metaconsole).

add_profile

Mandatory parameters:

  • <user_id>
  • <profile_name>
  • <group_name>

Description: A profile will be added to a user passing as parameters the user identifier, the profile name, and the group name over which they will have the privileges of that profile. Specify the All group if you want the profile to be valid in all groups.

  • This command allows you to specify a null or non-existent user.
  • This command allows repeating profile/group for a user without issuing a warning message.
  • You must verify through the user list in the PFMS Web Console if the profile was successfully added.

Related command: add_profile_to_user.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_profile "User 07" "Group coordinator" "All"

This function also works in the Command Center (Metaconsole).

add_tag_to_user_profile

Mandatory parameters:

  • <user_id>
  • <tag_name>
  • <group_name>
  • <profile_name>

Description: Adds a tag to the profile and group assigned to a user.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_tag_to_user_profile 'User 7500' 'dmz' 'Servers' 'Chief Operator'

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.14)

delete_profile

Mandatory parameters:

  • <user_id>
  • <profile_name>
  • <group_name>

Description: A profile will be removed from a user by passing as a parameter the user identifier, the profile name, and the group name over which the profile has privileges.

  • If the user identifier includes spaces or any other extended character, those characters must be escaped. A space is represented as &#x20; and & as &amp;, etc.
  • You must verify through the user list in the PFMS Web Console if the profile was successfully deleted.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_profile "john&#x20;doe" "Chief Operator" "Applications"

This function also works in the Command Center (Metaconsole).

add_profile_to_user

Mandatory parameters:

  • <user_id>
  • <profile_name>

Optional parameter:

  • <group_name>

Description: Adds an existing group profile to a user. If no group is provided, it will be assigned to the All group.

  • This command allows repeating profile/group for a user without issuing a warning message. You must verify through the user list in the PFMS Web Console if the profile was successfully added.

Related command: add_profile.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_profile_to_user 'user01' 'Chief Operator' 'Network'

This function also works in the Command Center (Metaconsole).

disable_eacl

Parameters: None.

Description: The EACL system will be disabled in the general PFMS configuration.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --disable_eacl

enable_eacl

Parameters: None.

Description: The EACL system will be enabled in the general PFMS configuration.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --enable_eacl

disable_double_auth

Mandatory parameter:

  • <user_id>

Description: The double authentication of the chosen user will be deactivated.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --disable_double_auth 'admin'

create_tag

Mandatory parameters:

  • <tag_name>
  • <tag_description> you can use single or double quotes for a null description.

Optional parameters:

  • <tag_url> if you use any string, it will open a link in the Web Console.
  • <tag_email>

Description: Creates a new tag.

Examples (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_tag "New tag" "My description" \ 
  "index.php?sec=custom_report&sec2=godmode/reporting/reporting_builder"
pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_tag "New tag" "My description" \ 
  "https://example.com" "[email protected]"

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.15)

Events

create_event

Mandatory parameters (3):

  • <event_name> (allows repeating existing names).
  • <event_type> It can take one of these typed values:
  • unknown
  • alert_fired
  • alert_recovered
  • alert_ceased
  • alert_manual_validation
  • recon_host_detected
  • system
  • error
  • new_agent
  • going_up_warning
  • going_up_critical
  • going_down_warning
  • going_unknown
  • going_down_normal
  • going_down_critical
  • going_up_normal
  • configuration_change
  • <group_name> (except the ALL group).

Optional parameters:

  1. Agent name.
  2. Agent module name.
  3. Event status (0 new unvalidated event, 1 if it is validated and 2 in process). To add the rest of the optional fields, one of these values must be specified.
  4. Severity: 0 (Maintenance), 1 (Informational), 2 (Normal), 3 (Warning), 4 (Critical), 5 (Minor) and 6 (Major). To add the rest of the optional fields, one of these values must be specified.
  5. Alert template name in case the specified module is associated with an alert.
  6. User name or user identifier (id_user, different from the owner user owner_user of the event). If the user name or user identifier includes space(s) or any other extended character, those characters must be escaped. A space is represented as &#x20; and & as &amp;, etc.
  7. Comment. If the name of the user or identifier of the user making the comment includes spaces or any other extended character, those characters must be escaped. A space is represented as &#x20; and & as &amp;, etc. (via Web Console the user name or user identifier will be shown unescaped, this is normal). It is recommended to use the user identifier since this is immutable and will always allow the user to be correctly identified.
  8. Source, text field to indicate the origin of the event, keywords can be used.
  9. Extraordinary identifier (Extra ID), used in the events view to group additionally.
  10. (Version 6.0 SP5 OUM 625 or older, issue 525) Tags: The tags format must be <tag> <url>. Multiple tags can be added separated by commas: <tag> <url>,<tag> <url>. It is important that there are no spaces between the comma and the next tag.
  11. Custom data: Custom data is entered as a JSON document. For example: {"Location": "Office", "Priority": 42}. If the JSON is poorly structured an unhandled exception will occur, it is recommended to use the json_pp command to check the JSON before creating the event.
  12. Force agent creation (0 false, 1 true): If the agent name parameter refers to an agent that does not exist, then it will be created (use null, two quotes together, in the module name and alert template name parameters). The new agent's alias will be exactly the same provided name.
  13. Instructions on critical: Adds the instructions to perform in case of transitioning to critical state.
  14. Instructions on warning: Adds the instructions to perform in case of transitioning to warning state.
  15. Instructions on unknown: Adds the instructions to perform in case of transitioning to unknown state.
  16. Use agent alias, use textually use_alias. Two single quotes together, without space between them, must be specified if you use the following parameter below.
  17. Command Center (Metaconsole): Server identifier.
  18. Unused parameter, omit with quotes together ('' or "").
  19. Unused parameter, omit with quotes together ('' or "").
  20. Unused parameter, omit with quotes together ('' or "").
  21. Custom event identifier.
  22. Default instructions.

Description: An event will be created with the event name and type data, and associated module, agent, and group names.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_event \
    'Event CLI' \
    system \
    Firewalls \
    'My agent' 'My module' 0 4 Template004 \

validate_event

Mandatory parameters:

  • <agent_name>

Optional parameters:

  • <module_name>
  • <minimum_date_time>
  • <maximum_date_time>
  • <event_owner_user>
  • <criticality_id> One of these values: 0 (maintenance), 1 (informational), 2 (normal), 3 (warning), 4 (critical), 5 (minor).
  • <alert_template_name> (without functionality).
  • use_alias if the agent name is unknown, you can search by its alias.

Description: All events will be validated based on a series of filters. The configurable filters are the agent name, module name, a minimum date and time and a maximum date and time, the name of the user who owns the event, the criticality identifier, and the name of the associated alert template.

Parameters can be combined in many ways, leaving blank with empty quotes "" or '' those you do not want to use (including the agent name) and filling in the others.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --validate_event 'My agent' 'My module'  '2024-06-02 22:02'

validate_event_id

Mandatory parameters: <event_id>

Optional parameters: None.

Description: Allows validating an event using its integer numeric identifier.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf 1234

get_event_info

Mandatory parameter:

  • <event_id>

Optional parameter:

  • <separator> default |.

Description: Information for an event will be shown given its identifier.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_event_info 341

add_event_comment

Mandatory parameters:

  • <event_id>
  • <user_id>
  • <comment>

Description: Adds a comment to an event specifying a registered user.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_event_comment "1234" "admin" "TEXT"

event_in_progress

Mandatory parameter: <event_id>

Description: Changes the status of an event to “In progress” using its numeric identifier.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --event_in_progress 123

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.16)

update_event_custom_id

Mandatory parameters:

  • <event_id>
  • <custom_event_id>

Description: Adds a custom identifier to an event.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --update_event_custom_id "232" "CLI test"

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.17)

get_event_lifetime

Mandatory parameters:

  • <event_id>
  • One or both of the following parameters: <sla_response_minutes> <sla_resolution_minutes>.

Optional parameter:

If run from the Command Center, and all three mandatory parameters have been provided, you can specify the identifier of the PFMS Server hosting the requested event, <server_identifier>.

Description: Displays on screen an SLA summary of an event, calculated according to the provided parameters.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \
  --get_event_lifetime 123

Policies

create_policy

Mandatory parameters:

  • <new_policy_name>
  • <agent_group_name>

Optional parameter:

  • <description> (errata: the command's online help indicates that it is mandatory).

Description: A policy will be created with the specified name and belonging to the specified group.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_policy "New policy" "Workstations" "All desktop computers."

apply_policy

Mandatory parameters:

  • <numeric_policy_id> If optional parameters are omitted, the policy will be applied to all agents belonging to it.

Optional parameters:

  1. <numeric_agent_id>
  2. <use_numeric_id> default 0, to use the agent name in optional parameter one, 1 must be specified in this parameter.
  3. <server_id> If working in a centralized environment this parameter must be specified, indicating the server to which the monitoring policy will be executed and applied.

Description: A policy will be forcibly applied. Within the process of applying a policy is: creating the policy's modules in all its associated agents, creating the policy's alerts in the created modules, and making changes to the configuration file of local agents that the policy may have to add the modules created and the collections associated with the policy.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --apply_policy 6 1 0 1

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.18)

apply_all_policies

Parameters: None.

Description: Adds all policies to the application queue. The server is the one that observes the queue and applies the monitoring policies.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --apply_all_policies

add_agent_to_policy

Mandatory parameters:

  • <agent_name>
  • <policy_name>

Optional parameter:

  • use_alias

Description: An existing agent will be added to an existing policy by specifying its agent name or, if the optional parameter is used, its agent alias.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_agent_to_policy "pandorafms agent" "Basic Linux Monitoring" use_alias

add_collection_to_policy

Mandatory parameters:

  • <policy_name>
  • <collection_name> If a non-existent collection is specified, an unhandled exception will be obtained.

Optional parameters: None.

Description: An existing collection will be added to an existing policy.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_collection_to_policy "Basic Remote Checks" "Apache Enterprise Plugin"

recreate_collection

Mandatory parameter: <file_collection_id>

Optional parameters: None.

Description: Recreates the files of a collection. You must have zip installed to compress the files. The collection must have at least one file for the result to be successful. If a non-existent collection is specified, an unhandled exception will be obtained.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --recreate_collection 1

create_policy_data_module_from_local_component

Parameters:

  • <policy_name>
  • <component_name>

Description: A module taken from an existing local component will be added to an existing policy.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \
 --create_policy_data_module_from_local_component \
 "Monitoring policy name" \
 "Local component name"

delete_not_policy_modules

Parameters: None.

Description: All modules that do not belong to any policy will be deleted, both from the database and from the agents' configuration file (if applicable).

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_not_policy_modules

remove_agent_from_policy

Mandatory parameters:

  • <policy_id>
  • <agent_id>

Description: Removes an agent from a policy. It is necessary to specify the numeric identifier of the monitoring policy and the identifier of the agent you want to remove.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --remove_agent_from_policy '11' '2'

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.19)

disable_policy_alerts

Mandatory parameter: <policy_name>

Optional parameter: None.

Description: All alerts of a policy passed by parameter will be marked as disabled.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --disable_policy_alerts "Basic HP-UX Local Monitoring"

create_policy_data_module

Mandatory parameters:

  • <policy_name>
  • <module_name>
  • <module_type>

Optional parameters:

  • <description>
  • <module_group>
  • <min>
  • <max>
  • <post_process>
  • <interval>
  • <warning_min>
  • <warning_max>
  • <critical_min>
  • <critical_max>
  • <history_data>
  • <data_configuration>
  • <warning_str>
  • <critical_str>
  • <enable_unknown_events>
  • <ff_threshold>
  • <each_ff>
  • <ff_threshold_normal>
  • <ff_threshold_warning>
  • <ff_threshold_critical>
  • <ff_timeout>
  • <critical_instructions>
  • <warning_instructions>
  • <unknown_instructions>
  • ignore_unknown Discards the unknown state calculation, so the module will never change to that state and will always keep the last known state.

Description: A data module will be created in a policy. The default values are the same as for the --create_data_module option.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_policy_data_module 'Policy name' 'Module name' \ 
  generic_proc 'Module description' 'group module' \ 
  0 100 0 300 30 60 61 100 0 \ 
  'module_begin\nmodule_name modname\nmodule_end' \ 
  'Warning string' 'Critical string'

create_policy_web_module

Mandatory parameters:

  • <policy_name>
  • <module_name>
  • <module_type> web_data, web_proc, web_content_data, web_content_string.

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>
  • <configuration_data>
  • <proxy_url>
  • <proxy_auth_login>
  • <proxy_auth_password>
  • <warning_str>
  • <critical_str>
  • <enable_unknown_events>
  • <ff_threshold>
  • <each_ff>
  • <ff_threshold_normal>
  • <ff_threshold_warning>
  • <ff_threshold_critical>
  • <ff_timeout>
  • <warning_inverse>
  • <critical_inverse>
  • <critical_instructions>
  • <warning_instructions>
  • <unknown_instructions>
  • ignore_unknown Discards the unknown state calculation, so the module will never change to that state and will always keep the last known state.

Description: A web module will be created in a policy. The default values are the same as for the --create_web_module option.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_policy_web_module 'Policy name' 'Module name' \ 
  web_data 'Module description' 'General' \ 
  0 100 0 300 0 0 0 0 1 0 1 'Pandora FMS' \ 
  auto public 'module_begin\nmodule_name modname\nmodule_end' \ 
  'http://proxy.url' 'proxy_login' 'proxy_password' \ 
  1 10 10 10 10 10 10 10 10 1 1 \ 
  'critical_instructions' 'warning_instructions' 'unknown_instructions'

create_policy_network_module

Mandatory parameters:

  • <policy_name>
  • <module_name>
  • <module_type>

Optional parameters:

  • <module_port> numeric 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_threshold_warning>
  • <ff_threshold_critical>
  • <critical_instructions>
  • <warning_instructions>
  • <unknown_instructions>
  • ignore_unknown Discards the unknown state calculation, so the module will never change to that state and will always keep the last known state.

Description: A network module will be created in a policy. The default values are the same as for the --create_network_module option.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_policy_network_module 'Policy name' \ 
  'Module name' remote_icmp_proc 22 'Module description' \ 
  'Name group' 0 100 0 300 30 60 61 100 0 0 \ 
  'Warning string' 'Critical string'

create_policy_snmp_module

Mandatory parameters:

  • <policy_name>
  • <module_name>
  • <module_type>
  • <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_priv_pass>
  • <ff_threshold>
  • <warning_str>
  • <critical_str>
  • <enable_unknown_events>
  • <each_ff>
  • <ff_threshold_normal>
  • <ff_threshold_warning>
  • <ff_threshold_critical>
  • <critical_instructions>
  • <warning_instructions>
  • <unknown_instructions>
  • ignore_unknown Discards the unknown state calculation, so the module will never change to that state and will always keep the last known state.

Description: An SNMP module will be created in a policy. The default values are the same as for the --create_snmp_module option.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_policy_snmp_module 'Policy name' \ 
  'Module name' remote_snmp_inc 8080 1 \ 
  mycommunity myoid 'Module description'

create_policy_plugin_module

Mandatory parameters:

  • <policy_name>
  • <module_name>
  • <module_kind>
  • <module_port> numeric value between 1 and 65535.
  • <plugin_name>
  • <user>
  • <password>
  • <parameters>

Optional parameters:

  • <description>
  • <module_group>
  • <min>
  • <max>
  • <post_process>
  • <interval>
  • <warning_min>
  • <warning_max>
  • <critical_min>
  • <critical_max>
  • <history_data>
  • <warning_str>
  • <critical_str>
  • <enable_unknown_events>
  • <each_ff>
  • <ff_threshold_normal>
  • <ff_threshold_warning>
  • <ff_threshold_critical>
  • <critical_instructions>
  • <warning_instructions>
  • <unknown_instructions>
  • ignore_unknown Discards the unknown state calculation, so the module will never change to that state and will always keep the last known state.

Description: A plugin type module will be created in a policy. The default values are the same as for the --create_plugin_module option.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_policy_plugin_module 'Policy name' \ 
  'Module name' generic_data 22 myplugin myuser \ 
  mypass 'param1 param2 param3' 'Module description' \ 
  'General' 1 3 0 300 0 0 0 0 1 'Warning string' 'Critical string'

validate_policy_alerts

Mandatory parameter: <policy_name>

Optional parameters: None.

Description: Validates all alerts of a given policy.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --validate_policy_alerts "Basic Linux Monitoring"

get_policy_modules

Mandatory parameter: <policy_name>

Optional parameters: None.

Description: Gets the list of modules (numeric identifier and name) of a given policy.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_policy_modules "Basic Linux Monitoring"

get_policies

Mandatory parameters: None.

Optional parameters:

  • <agent_name>
  • use_alias to search by agent alias.

Description:

  • Without parameters: Gets all policies (numeric identifier and name).
  • Agent name: Gets the policies of an agent (lists agent name, numeric policy identifier, and policy name).

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_policies "pandorafms agent" use_alias

NetFlow

create_netflow_filter

Mandatory parameters:

  • <new_filter_name>
  • <agent_group_name>
  • <filter_itself>
  • <aggregated_by> One of the following values: none, dstip, dstport, proto, srcip, srcport.
  • <output_format> kilobytes, kilobytespersecond, megabytes, megabytespersecond.

Optional parameters: None.

Description: Create a new filter to monitor via NetFlow®.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_netflow_filter "New filter" "Network" \ 
  "host 192.168.50.3 OR host 192.168.50.4 or HOST 192.168.50.6" \ 
  dstport kilobytes

Tools

exec_from_file

Mandatory parameters (see case study):

  • <command_to_execute>
  • <parameters_of_the_command_to_execute>

Description: With this option it is possible to execute any PFMS CLI command with macros from a CSV file. The number of macros will correspond to the number of columns in the CSV file. Each macro will be called __FIELD1__, __FIELD2__, __FIELD3__, … , __FIELDn__.

Commas in CSV columns are not yet supported.

Case study:

Register users with the create_user command from a /tmp/users_csv CSV file:

User 1,Password 1,0
User 2,Password 2,0
User 3,Password 3,0
User Admin,Password Admin,1

Statement to execute (line connectors are included for educational purposes):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --exec_from_file \
  /tmp/users_csv \
  create_user \
  __FIELD1__ \
  __FIELD2__ \
  __FIELD3__ \
  'Created by exec_from_file CLI PFMS command'

create_snmp_trap

Mandatory parameters:

  • <snmp_trap_name> As it will be seen in the SNMP traps console.
  • <OID>
  • <description>
  • <severity> Numeric value, one of the following values: 0 (Maintenance), 1 (Info) , 2 (Normal), 3 (Warning), 4 (Critical), 5 (Minor), 6 (Major).

Description: Creates a new SNMP trap definition. A name must be placed; if an OID is repeated, the trap will not be created.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_snmp_trap "Cisco_FAN_Crash" "1.3.3.3.2.12.3.3.4.1" \ 
  "Something happen with the FAN inside the CISCO device, probably a failure" "3"

start_snmptrapd

Parameters: None.

Starts the snmptrapd process on the SNMP traps server. If it is already started, it ends that service (kill command) and runs it again, deleting all traps located in the exchange log located by default in:

/var/log/pandora/pandora_snmptrapd.log

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --start_snmptrapd

kill

Mandatory parameter:

  • <PFMS_server_name>

Optional parameters: None.

Description: The multiprocess option must be enabled so that PFMS servers run in individual processes and can be detected by this command. Once this configuration is done, using this command without parameters will list the running servers and their corresponding names to be killed, one by one.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --kill dataserver

parse_siem_log

Mandatory parameters:

  • <log_line>
  • <source_id>

Optional parameter:

  • <source_type>: If not indicated, syslog will be used.

Description: Parses the given log and returns matching decoders and SIEM rules.

Example (see call and syntax), the $PARAM variable is used for clarity:

PARAM="[Tue Sep 30 14:25:44.895897 2014] "
PARAM=$PARAM"[authz_core:error] [pid 31858] "
PARAM=$PARAM"[client 99.47.227.95:38870] "
PARAM=$PARAM"AH01630: client denied by server configuration: "
PARAM=$PARAM"/var/www/example.com/docroot/"
pandora_manage /etc/pandora/pandora_server.conf \ 
  --parse_siem_log \ 
  $PARAM \ 
  'httpd' 'syslog'

A valid SIEM license and the decoders and rules already loaded in the database are needed for the CLI call to work. The result will always be what would be generated at the time it is evaluated. This call does not introduce new log entries into the monitoring, nor does it generate SIEM events.

The generated output will be in JSON, example (with formatted output), the $PARAM variable is used for clarity:

`{
  "decoder": [
    "apache-errorlog",
    "apache24-errorlog-ip-port",
    "apache24-errorlog-ip",
    "apache-errorlog-ip"
  ],
  "source_type": "syslog",
  "logcontent": "<$PARAM>",
  "source_id": "httpd",
  "srcport": "38870",
  "id": "AH01630",
  "type": "syslog",
  "srcip": "99.47.227.95:38870",
  "program_name": "httpd",
  "events": [
    {
      "level": 2,
      "description": "Unknown problem somewhere in the system.",
      "severity": 1,
      "mitre": [],
      "groups": [
        "syslog",
        "gpg13_4.3",
        "errors"
      ],
      "rule": 1002
    },
    {
      "description": "Apache: Attempt to access forbidden file or directory.",
      "level": 5,
      "severity": 1,
      "rule": 30305,
      "mitre": [],
      "groups": [
        "gdpr_IV_35.7.d",
        "hipaa_164.312.b",
        "nist_800_53_AC.7",
        "nist_800_53_AU.14",
        "pci_dss_10.2.4",
        "tsc_CC6.1",
        "tsc_CC6.8",
        "tsc_CC7.2",
        "tsc_CC7.3",
        "apache",
        "web",
        "nist_800_53_SA.11",
        "tsc_CC6.6",
        "tsc_CC7.1",
        "access_denied",
        "pci_dss_6.5.8"
      ]
    }
  ]
}`

Graphs

create_custom_graph

Mandatory parameters:

  • <new_graph_name>
  • <description>
  • <user_id>
  • <group_id>
  • <width>
  • <height>
  • <events>
  • <graph_type> Default 0 (Area) or one of the following values:
  1. Stacked area.
  2. Line.
  3. Stacked line.
  4. Dot chart.
  5. Gauge.
  6. Horizontal bars.
  7. Vertical bars.
  8. Pie chart.
  • <period>
  • <modules>
  • <module_separator>

Description: A graph will be created with the specified elements. Two or more modules must be distinguished with < module_separator >, which must always be specified, even for a single module.


Although all parameters are mandatory, some can be left empty using single quotes. In those cases, the default values taken by the parameters are as follows:

  • Width: 550.
  • Height: 210.
  • Period: 86400 (in seconds).
  • Events: 0.
  • Graph type: 0.
  • Group ID: 0.


Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_custom_graph "New graph" \ 
  "Graph created by CLI PFMS" "admin" "0" \ 
  "" "" "0" "2" "" "1;2;3" ";"

edit_custom_graph

Mandatory parameters:

  • <graph_id_to_edit>
  • <graph_name_to_edit>
  • <description_to_edit>
  • <user_to_edit>
  • <group_id_to_edit>
  • <width_to_edit>
  • <height_to_edit>
  • <events_to_edit>
  • <graph_type_to_edit> Default 0 (Area) or one of the following values:
  1. Stacked area.
  2. Line.
  3. Stacked line.
  4. Dot chart.
  5. Gauge.
  6. Horizontal bars.
  7. Vertical bars.
  8. Pie chart.
  • <period_to_edit>

Description: A graph will be edited with the specified elements. All parameters are mandatory, but some can be left empty using single quotes. If this happens, the values will be the ones the graph already had before editing.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --edit_custom_graph "1" "" "edit graph by CLI" \ 
  "" "" "" "" "" "" "" 3600

add_modules_to_graph

Mandatory parameters:

  1. <graph_id>
  2. <module_ids> up to a maximum of 10 modules, delimited with <separator>
  3. <separator>

Description: The specified modules will be added to the selected graph. Although more than 10 modules can be added, only the first 10 will be displayed.

Examples (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_modules_to_graph 1 '1,2,3' ','
pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_modules_to_graph 1 '4;5;6;7' ';'

delete_modules_to_graph

Mandatory parameters:

  • <graph_id>
  • <module_ids> the numeric module identifiers must be delimited with <separator>
  • <separator>

Description: The specified modules will be removed from the selected graph.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_modules_to_graph "1" "2,4,6" ","

Clusters

new_cluster

Mandatory parameters:

  • <cluster_name>
  • <cluster_type> only AA or AP.
  • <description>
  • <group_id>

Description: A cluster will be created with the specified parameters and its associated elements.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --new_cluster \
 "New cluster" "AA" "My description" "2"

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.20)

add_cluster_agent

Mandatory parameter:

  • <base64_json_data> in JSON format, then base64 encoded: value pairs with the cluster identifier and the agent identifier. Example:
[{"id":5,"id_agent":2},{"id":5,"id_agent":3}]

Description: A specific agent will be added to the specified cluster. It is absolutely necessary that the JSON data is base64 encoded.

Continuation of the previous example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_cluster_agent \ 
 W3siaWQiOjUsImlkX2FnZW50IjoyfSwKeyJpZCI6NSwiaWRfYWdlbnQiOjN9XQ==

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.21)

add_cluster_item (active / active)

Parameters:

Data in JSON format with the following fields:

  • name: (text string value).
  • id_cluster: (numeric value).
  • type: AA (means “Active/Active”).
  • critical_limit: (numeric value).
  • warning_limit: (numeric value).

JSON Example:

[
  {
    "name": "Swap_Used",
    "id_cluster": 5,
    "type": "AA",
    "critical_limit": 80,
    "warning_limit": 60
  },
  {
    "name": "TCP_Connections",
    "id_cluster": 5,
    "type": "AA",
    "critical_limit": 80,
    "warning_limit": 60
  }
]

Description: A specific module will be added as an item to the specified cluster.

It is absolutely necessary that JSONs are base64 encoded.

Continuation of the previous example (see call and syntax), the $PARAM variable is used for clarity:

PARAM="WwogIHsKICAgICJuYW1lIjogIlN3YXBfVXNlZC"
PARAM=$PARAM"IsCiAgICAiaWRfY2x1c3RlciI6IDUsCiAgICAi"
PARAM=$PARAM"dHlwZSI6ICJBQSIsCiAgICAiY3JpdGljYWxfbG"
PARAM=$PARAM"ltaXQiOiA4MCwKICAgICJ3YXJuaW5nX2xpbWl0"
PARAM=$PARAM"IjogNjAKICB9LAogIHsKICAgICJuYW1lIjogIl"
PARAM=$PARAM"RDUF9Db25uZWN0aW9ucyIsCiAgICAiaWRfY2x1"
PARAM=$PARAM"c3RlciI6IDUsCiAgICAidHlwZSI6ICJBQSIsCi"
PARAM=$PARAM"AgICAiY3JpdGljYWxfbGltaXQiOiA4MCwKICAg"
PARAM=$PARAM"ICJ3YXJuaW5nX2xpbWl0IjogNjAKICB9Cl0="
 
pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_cluster_item $PARAM

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.22)

add_cluster_item (active / passive)

Mandatory parameter:

JSON data with these fields:

  • name: (text string value).
  • id_cluster: (numeric value).
  • type: AP (means “Active/Passive”).
  • critical_limit: (numeric value).
  • warning_limit: (numeric value).

JSON Example:

[
  {
    "name": "DiskUsed_/proc/kcore",
    "id_cluster": 5,
    "type": "AP",
    "is_critical": 1
  },
  {
    "name": "DiskUsed_/proc/sched_debug",
    "id_cluster": 5,
    "type": "AP",
    "is_critical": 1
  }
]

Description: A specific module will be added as an item to the specified cluster.

It is absolutely necessary that JSONs are base64 encoded.

Continuation of the previous example (see call and syntax), the $PARAM variable is used for clarity:

PARAM="WwogIHsKICAgICJuYW1lIjogIkRpc2tVc2VkXy"
PARAM=$PARAM"9wcm9jL2tjb3JlIiwKICAgICJpZF9jbHVzdGVy"
PARAM=$PARAM"IjogNSwKICAgICJ0eXBlIjogIkFQIiwKICAgIC"
PARAM=$PARAM"Jpc19jcml0aWNhbCI6IDEKICB9LAogIHsKICAg"
PARAM=$PARAM"ICJuYW1lIjogIkRpc2tVc2VkXy9wcm9jL3NjaG"
PARAM=$PARAM"VkX2RlYnVnIiwKICAgICJpZF9jbHVzdGVyIjog"
PARAM=$PARAM"NSwKICAgICJ0eXBlIjogIkFQIiwKICAgICJpc1"
PARAM=$PARAM"9jcml0aWNhbCI6IDEKICB9Cl0="
 
pandora_manage /etc/pandora/pandora_server.conf \ 
  --add_cluster_item $PARAM

get_cluster_status

Mandatory parameter: <cluster_identifier>

Description: Gets the status of a cluster.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --get_cluster_status 7

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.23)

delete_cluster

Mandatory parameter: <cluster_id>

Description: A cluster will be deleted.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_cluster 1

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.24)

delete_cluster_agent

Mandatory parameters:

  • <agent_id>
  • <cluster_id>

Description: An agent added to a cluster will be disassociated.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_cluster_agent 1 1

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.25)

delete_cluster_item

Mandatory parameter:

  • <item_id>

Description: A cluster item will be deleted.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_cluster_item 1

For it to be done correctly, the API configuration parameter console_api_url must be filled in pandora_server.conf.26)

Visual consoles

create_visual_console

Mandatory parameters:

  1. <name>
  2. <background_image> one of the files located in …/pandora_console/images/console/background/.
  3. <width>
  4. <height>
  5. <group_name>
  6. <mode> static_objects or auto_creation: In the first way, elements will be created without considering the position where to place the elements (the position described in the elements JSON itself will be used), see case study 1. If the mode is auto_creation, a coordinate grid must be established (field <position_to_locate_elements>) and the algorithm will automatically set the position and size of each of the elements, see case study 2.

Optional parameters:

  • <position_to_locate_elements>
  • <background_color> in hexadecimal format.
  • <elements> in JSON format. It is absolutely necessary that the parameters in JSON are enclosed in single quotes to be able to include the double quotes of those data.

Description: A Visual Console will be created with the specified parameters and its associated elements.

Due to database restrictions, each element to be added in the JSON (last parameter) must mandatorily contain the following elements:

"id_layout_linked_weight": 0, "element_group": 0,"show_on_top":0


Case study 1

Example with auto_creation and line connectors (see call and syntax), the $PARAM variable is used for clarity:

PARAM='[{"image": "_engine","height": 0,"width": 0,"label": "",'
PARAM=$PARAM'"type": 0,"period": 300,"id_agent": 1,"id_agente_modulo": 0,'
PARAM=$PARAM'"id_group": 0,"id_layout_linked": 0,"parent_item": 0,'
PARAM=$PARAM'"enable_link": 1,"id_metaconsole": 0,"id_custom_graph": 0,'
PARAM=$PARAM'"border_width": 0,"border_color": "","fill_color": "",'
PARAM=$PARAM'"type_graph": "area","label_position": "down",'
PARAM=$PARAM'"id_layout_linked_weight": 0, "element_group": 0,"show_on_top":0},'
PARAM=$PARAM'{"image": "_printer","height": 0,"width": 0,"label": "","type": 0,'
PARAM=$PARAM'"period": 300,"id_agent": 2,"id_agente_modulo": 0,"id_group": 0,'
PARAM=$PARAM'"id_layout_linked": 0,"parent_item": 0,"enable_link": 1,'
PARAM=$PARAM'"id_metaconsole": 0,"id_custom_graph": 0,"border_width": 0,'
PARAM=$PARAM'"border_color": "","fill_color": "","type_graph": "area",'
PARAM=$PARAM'"label_position": "down","id_layout_linked_weight": 0, '
PARAM=$PARAM'"element_group": 0,"show_on_top":0}]'
 
pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_visual_console \
 'Visual Console test 1' \
 'map-africa.png' \
 '1024' \
 '768' \
 '12' \
 'auto_creation' \
 '{"pos1x":0,"pos1y":60,"pos2x":800,"pos2y":600}' \
 '#FFF' \
 $PARAM

The second JSON is illustrated:

[
  {
    "image": "_engine",
    "height": 0,
    "width": 0,
    "label": "",
    "type": 0,
    "period": 300,
    "id_agent": 1,
    "id_agente_modulo": 0,
    "id_group": 0,
    "id_layout_linked": 0,
    "parent_item": 0,
    "enable_link": 1,
    "id_metaconsole": 0,
    "id_custom_graph": 0,
    "border_width": 0,
    "border_color": "",
    "fill_color": "",
    "type_graph": "area",
    "label_position": "down",
    "id_layout_linked_weight": 0,
    "element_group": 0,
    "show_on_top": 0
  },
  {
    "image": "_printer",
    "height": 0,
    "width": 0,
    "label": "",
    "type": 0,
    "period": 300,
    "id_agent": 2,
    "id_agente_modulo": 0,
    "id_group": 0,
    "id_layout_linked": 0,
    "parent_item": 0,
    "enable_link": 1,
    "id_metaconsole": 0,
    "id_custom_graph": 0,
    "border_width": 0,
    "border_color": "",
    "fill_color": "",
    "type_graph": "area",
    "label_position": "down",
    "id_layout_linked_weight": 0,
    "element_group": 0,
    "show_on_top": 0
  }
]

Case study 2

Example with static_objects (see call and syntax):

PARAM='[{"image": "_engine","pos_x":100,"pos_y":100,"height": '
PARAM=$PARAM'0,"width": 0,"label": "","type": 0,"period": 300,'
PARAM=$PARAM'"id_agent": 1,"id_agente_modulo": 0,"id_group": 0,'
PARAM=$PARAM'"id_layout_linked": 0,"parent_item": 0,"enable_link": 1,'
PARAM=$PARAM'"id_metaconsole": 0,"id_custom_graph": 0,"border_width": 0,'
PARAM=$PARAM'"border_color": "","fill_color": "","type_graph": "area",'
PARAM=$PARAM'"label_position": "down","id_layout_linked_weight": 0, '
PARAM=$PARAM'"element_group": 0,"show_on_top":0},{"image": "_printer",'
PARAM=$PARAM'"pos_x":400,"pos_y":100,"height": 0,"width": 0,"label": "",'
PARAM=$PARAM'"type": 0,"period": 300,"id_agent": 2,"id_agente_modulo": '
PARAM=$PARAM'0,"id_group": 0,"id_layout_linked": 0,"parent_item": 0,'
PARAM=$PARAM'"enable_link": 1,"id_metaconsole": 0,"id_custom_graph": 0,'
PARAM=$PARAM'"border_width": 0,"border_color": "","fill_color": "",'
PARAM=$PARAM'"type_graph": "area","label_position": "down",'
PARAM=$PARAM'"id_layout_linked_weight": 0, "element_group": 0,'
PARAM=$PARAM'"show_on_top":0}]'
 
pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_visual_console \
 'Visual Console test 2' \
 'mapa-asia.png' \
 '1024' \
 '768' \
 '12' \
 'static_objects' \
 '' \
 '#FFF' \
 $PARAM

The last JSON is illustrated:

[
  {
    "image": "_engine",
    "pos_x": 100,
    "pos_y": 100,
    "height": 0,
    "width": 0,
    "label": "",
    "type": 0,
    "period": 300,
    "id_agent": 1,
    "id_agente_modulo": 0,
    "id_group": 0,
    "id_layout_linked": 0,
    "parent_item": 0,
    "enable_link": 1,
    "id_metaconsole": 0,
    "id_custom_graph": 0,
    "border_width": 0,
    "border_color": "",
    "fill_color": "",
    "type_graph": "area",
    "label_position": "down",
    "id_layout_linked_weight": 0,
    "element_group": 0,
    "show_on_top": 0
  },
  {
    "image": "_printer",
    "pos_x": 400,
    "pos_y": 100,
    "height": 0,
    "width": 0,
    "label": "",
    "type": 0,
    "period": 300,
    "id_agent": 2,
    "id_agente_modulo": 0,
    "id_group": 0,
    "id_layout_linked": 0,
    "parent_item": 0,
    "enable_link": 1,
    "id_metaconsole": 0,
    "id_custom_graph": 0,
    "border_width": 0,
    "border_color": "",
    "fill_color": "",
    "type_graph": "area",
    "label_position": "down",
    "id_layout_linked_weight": 0,
    "element_group": 0,
    "show_on_top": 0
  }
]

Case study 3

Visual console with all available elements, the $PARAM variable is used for clarity:

PARAM=''
PARAM=$PARAM'[{"id":69,"image":"network","pos_y":8,"pos_x":7,"width":70,"height'
PARAM=$PARAM'":70,"label":"","type":0,"period":3600,"id_agente_modulo":0,"id_ag'
PARAM=$PARAM'ent":0,"id_layout_linked":0,"parent_item":0,"enable_link":1,"id_me'
PARAM=$PARAM'taconsole":0,"id_group":0,"id_custom_graph":0,"border_width":0,"ty'
PARAM=$PARAM'pe_graph":"area","label_position":"down","border_color":"","fill_c'
PARAM=$PARAM'olor":"","id_layout_linked_weight":0,"element_group":0,"show_on_to'
PARAM=$PARAM'p":0},{"id":70,"image":"percent","pos_y":9,"pos_x":123,"width":100'
PARAM=$PARAM',"height":0,"label":"","type":15,"period":3600,"id_agente_modulo":'
PARAM=$PARAM'0,"id_agent":0,"id_layout_linked":0,"parent_item":0,"enable_link":'
PARAM=$PARAM'1,"id_metaconsole":0,"id_group":0,"id_custom_graph":0,"border_widt'
PARAM=$PARAM'h":0,"type_graph":"area","label_position":"down","border_color":"#'
PARAM=$PARAM'000000","fill_color":"#bcbcbc","id_layout_linked_weight":0,"elemen'
PARAM=$PARAM't_group":0,"show_on_top":0},{"id":71,"image":"white","pos_y":9,"po'
PARAM=$PARAM's_x":239,"width":300,"height":180,"label":"","type":1,"period":360'
PARAM=$PARAM'0,"id_agente_modulo":0,"id_agent":0,"id_layout_linked":0,"parent_i'
PARAM=$PARAM'tem":0,"enable_link":1,"id_metaconsole":0,"id_group":0,"id_custom_'
PARAM=$PARAM'graph":0,"border_width":0,"type_graph":"area","label_position":"do'
PARAM=$PARAM'wn","border_color":"","fill_color":"","id_layout_linked_weight":0,'
PARAM=$PARAM'"element_group":0,"show_on_top":0},{"id":72,"image":"","pos_y":0,"'
PARAM=$PARAM'pos_x":614,"width":394,"height":175,"label":"","type":23,"period":'
PARAM=$PARAM'3600,"id_agente_modulo":0,"id_agent":0,"id_layout_linked":0,"paren'
PARAM=$PARAM't_item":0,"enable_link":1,"id_metaconsole":0,"id_group":0,"id_cust'
PARAM=$PARAM'om_graph":0,"border_width":0,"type_graph":"area","label_position":'
PARAM=$PARAM'"down","border_color":"#000000","fill_color":"","id_layout_linked_'
PARAM=$PARAM'weight":0,"element_group":0,"show_on_top":0},{"id":73,"image":"","'
PARAM=$PARAM'pos_y":197,"pos_x":14,"width":300,"height":300,"label":"","type":1'
PARAM=$PARAM'7,"period":3600,"id_agente_modulo":0,"id_agent":0,"id_layout_linke'
PARAM=$PARAM'd":0,"parent_item":0,"enable_link":1,"id_metaconsole":0,"id_group"'
PARAM=$PARAM':0,"id_custom_graph":0,"border_width":0,"type_graph":"area","label'
PARAM=$PARAM'_position":"down","border_color":"#ffffff","fill_color":"","id_lay'
PARAM=$PARAM'out_linked_weight":0,"element_group":0,"show_on_top":0},{"id":74,"'
PARAM=$PARAM'image":"white","pos_y":198,"pos_x":354,"width":300,"height":180,"l'
PARAM=$PARAM'abel":"","type":18,"period":3600,"id_agente_modulo":0,"id_agent":0'
PARAM=$PARAM',"id_layout_linked":0,"parent_item":0,"enable_link":1,"id_metacons'
PARAM=$PARAM'ole":0,"id_group":0,"id_custom_graph":0,"border_width":0,"type_gra'
PARAM=$PARAM'ph":"horizontal","label_position":"down","border_color":"#000000",'
PARAM=$PARAM'"fill_color":"","id_layout_linked_weight":0,"element_group":0,"sho'
PARAM=$PARAM'w_on_top":0},{"id":75,"image":"","pos_y":398,"pos_x":481,"width":5'
PARAM=$PARAM'00,"height":70,"label":"","type":14,"period":86400,"id_agente_modu'
PARAM=$PARAM'lo":0,"id_agent":0,"id_layout_linked":0,"parent_item":0,"enable_li'
PARAM=$PARAM'nk":1,"id_metaconsole":0,"id_group":0,"id_custom_graph":0,"border_'
PARAM=$PARAM'width":0,"type_graph":"area","label_position":"down","border_color'
PARAM=$PARAM'":"#000000","fill_color":"","id_layout_linked_weight":0,"element_g'
PARAM=$PARAM'roup":0,"show_on_top":0},{"id":76,"image":"string","pos_y":510,"po'
PARAM=$PARAM's_x":9,"width":0,"height":0,"label":"(_value_)","type":2,"period":'
PARAM=$PARAM'300,"id_agente_modulo":0,"id_agent":0,"id_layout_linked":0,"parent'
PARAM=$PARAM'_item":0,"enable_link":1,"id_metaconsole":0,"id_group":0,"id_custo'
PARAM=$PARAM'm_graph":0,"border_width":0,"type_graph":"area","label_position":"'
PARAM=$PARAM'down","border_color":"","fill_color":"","id_layout_linked_weight":'
PARAM=$PARAM'0,"element_group":0,"show_on_top":0},{"id":77,"image":"","pos_y":5'
PARAM=$PARAM'11,"pos_x":76,"width":50,"height":50,"label":"","type":4,"period":'
PARAM=$PARAM'3600,"id_agente_modulo":0,"id_agent":0,"id_layout_linked":0,"paren'
PARAM=$PARAM't_item":0,"enable_link":1,"id_metaconsole":0,"id_group":0,"id_cust'
PARAM=$PARAM'om_graph":0,"border_width":0,"type_graph":"area","label_position":'
PARAM=$PARAM'"down","border_color":"","fill_color":"","id_layout_linked_weight"'
PARAM=$PARAM':0,"element_group":0,"show_on_top":0},{"id":78,"image":"http://192'
PARAM=$PARAM'.168.7.117/pandora_console/images/console/icons/appliance.png","po'
PARAM=$PARAM's_y":510,"pos_x":162,"width":70,"height":70,"label":"","type":5,"p'
PARAM=$PARAM'eriod":3600,"id_agente_modulo":0,"id_agent":0,"id_layout_linked":0'
PARAM=$PARAM',"parent_item":0,"enable_link":1,"id_metaconsole":0,"id_group":0,"'
PARAM=$PARAM'id_custom_graph":0,"border_width":0,"type_graph":"area","label_pos'
PARAM=$PARAM'ition":"down","border_color":"","fill_color":"","id_layout_linked_'
PARAM=$PARAM'weight":0,"element_group":0,"show_on_top":0},{"id":79,"image":"","'
PARAM=$PARAM'pos_y":513,"pos_x":253,"width":100,"height":50,"label":"","type":1'
PARAM=$PARAM'9,"period":3600,"id_agente_modulo":0,"id_agent":0,"id_layout_linke'
PARAM=$PARAM'd":0,"parent_item":0,"enable_link":0,"id_metaconsole":0,"id_group"'
PARAM=$PARAM':0,"id_custom_graph":0,"border_width":0,"type_graph":"area","label'
PARAM=$PARAM'_position":"down","border_color":"#000000","fill_color":"#000000",'
PARAM=$PARAM'"id_layout_linked_weight":0,"element_group":0,"show_on_top":0},{"i'
PARAM=$PARAM'd":80,"image":"appliance","pos_y":515,"pos_x":343,"width":70,"heig'
PARAM=$PARAM'ht":70,"label":"","type":11,"period":3600,"id_agente_modulo":0,"id'
PARAM=$PARAM'_agent":0,"id_layout_linked":0,"parent_item":0,"enable_link":1,"id'
PARAM=$PARAM'_metaconsole":0,"id_group":0,"id_custom_graph":0,"border_width":0,'
PARAM=$PARAM'"type_graph":"area","label_position":"down","border_color":"","fil'
PARAM=$PARAM'l_color":"","id_layout_linked_weight":0,"element_group":0,"show_on'
PARAM=$PARAM'_top":0},{"id":81,"image":"","pos_y":495,"pos_x":445,"width":100,"'
PARAM=$PARAM'height":100,"label":"","type":12,"period":3600,"id_agente_modulo":'
PARAM=$PARAM'0,"id_agent":0,"id_layout_linked":0,"parent_item":0,"enable_link":'
PARAM=$PARAM'1,"id_metaconsole":0,"id_group":0,"id_custom_graph":0,"border_widt'
PARAM=$PARAM'h":1,"type_graph":"area","label_position":"down","border_color":"#'
PARAM=$PARAM'000000","fill_color":"#ffffff","id_layout_linked_weight":0,"elemen'
PARAM=$PARAM't_group":0,"show_on_top":0},{"id":82,"image":"","pos_y":158,"pos_x'
PARAM=$PARAM'":91,"width":42,"height":43,"label":"","type":13,"period":3600,"id'
PARAM=$PARAM'_agente_modulo":0,"id_agent":0,"id_layout_linked":0,"parent_item":'
PARAM=$PARAM'0,"enable_link":1,"id_metaconsole":0,"id_group":0,"id_custom_graph'
PARAM=$PARAM'":0,"border_width":1,"type_graph":"area","label_position":"down","'
PARAM=$PARAM'border_color":"#000000","fill_color":"","id_layout_linked_weight":'
PARAM=$PARAM'0,"element_group":0,"show_on_top":0},{"id":83,"image":"","pos_y":4'
PARAM=$PARAM'88,"pos_x":562,"width":169,"height":183,"label":"{\"default_color\'
PARAM=$PARAM'":\"#000000\",\"color_ranges\":[]}","type":20,"period":3600,"id_ag'
PARAM=$PARAM'ente_modulo":0,"id_agent":0,"id_layout_linked":0,"parent_item":0,"'
PARAM=$PARAM'enable_link":1,"id_metaconsole":0,"id_group":0,"id_custom_graph":0'
PARAM=$PARAM',"border_width":0,"type_graph":"area","label_position":"down","bor'
PARAM=$PARAM'der_color":"#000000","fill_color":"","id_layout_linked_weight":0,"'
PARAM=$PARAM'element_group":0,"show_on_top":0},{"id":84,"image":"","pos_y":533,'
PARAM=$PARAM'"pos_x":755,"width":909,"height":560,"label":"{\"labelStart\":null'
PARAM=$PARAM',\"labelEnd\":null,\"linkedStart\":null,\"linkedEnd\":null}","type'
PARAM=$PARAM'":21,"period":3600,"id_agente_modulo":0,"id_agent":0,"id_layout_li'
PARAM=$PARAM'nked":0,"parent_item":0,"enable_link":1,"id_metaconsole":0,"id_gro'
PARAM=$PARAM'up":0,"id_custom_graph":0,"border_width":5,"type_graph":"area","la'
PARAM=$PARAM'bel_position":"down","border_color":"#000000","fill_color":"","id_'
PARAM=$PARAM'layout_linked_weight":0,"element_group":0,"show_on_top":0},{"id":8'
PARAM=$PARAM'5,"image":"","pos_y":0,"pos_x":0,"width":300,"height":150,"label":'
PARAM=$PARAM'"","type":22,"period":3600,"id_agente_modulo":0,"id_agent":0,"id_l'
PARAM=$PARAM'ayout_linked":0,"parent_item":0,"enable_link":1,"id_metaconsole":0'
PARAM=$PARAM',"id_group":0,"id_custom_graph":0,"border_width":0,"type_graph":"a'
PARAM=$PARAM'rea","label_position":"down","border_color":"#000000","fill_color"'
PARAM=$PARAM':"","id_layout_linked_weight":0,"element_group":0,"show_on_top":0}'
PARAM=$PARAM',{"id":86,"image":"","pos_y":583,"pos_x":864,"width":140,"height":'
PARAM=$PARAM'56,"label":"","type":10,"period":3600,"id_agente_modulo":0,"id_age'
PARAM=$PARAM'nt":0,"id_layout_linked":0,"parent_item":0,"enable_link":1,"id_met'
PARAM=$PARAM'aconsole":0,"id_group":0,"id_custom_graph":0,"border_width":0,"typ'
PARAM=$PARAM'e_graph":"area","label_position":"down","border_color":"","fill_co'
PARAM=$PARAM'lor":"","id_layout_linked_weight":0,"element_group":0,"show_on_top'
PARAM=$PARAM'":0},{"id":90,"image":"","pos_y":271,"pos_x":791,"width":116,"heig'
PARAM=$PARAM'ht":44,"label":"","type":22,"period":3600,"id_agente_modulo":129,"'
PARAM=$PARAM'id_agent":3,"id_layout_linked":0,"parent_item":0,"enable_link":1,"'
PARAM=$PARAM'id_metaconsole":0,"id_group":0,"id_custom_graph":0,"border_width":'
PARAM=$PARAM'0,"type_graph":"area","label_position":"down","border_color":"#000'
PARAM=$PARAM'000","fill_color":"","id_layout_linked_weight":0,"element_group":0'
PARAM=$PARAM',"show_on_top":0}]'
 
pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_visual_console \ 
  "Visual Console with all elements" \ 
  "map-southamerica.png" \ 
  1024 \ 
  768 \ 
  12 \ 
  "static_objects" \ 
  "" \ 
  "#000000" \ 
  $PARAM 

edit_visual_console

Mandatory parameters (see description for details):

  • <numeric_id_of_visual_console_to_modify>
  • <name>
  • <background_image>
  • <width>
  • <height>
  • <group_name>
  • <mode>
  • <position_to_locate_elements>
  • <background_color>
  • <elements>

Optional parameters: None.

Description: Works in conjunction with the export_json_visual_console command and allows editing an existing visual console and its elements. This command displays on screen the complete data of a registered visual console which can be copied and pasted to be modified.

Following having invoked edit_visual_console and the numeric identifier of the visual console to be modified, the modified text can be pasted.

Full example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --create_visual_console \
  "My Visual Console" \
  "None.png" \
  1024 \
  768 \
  9 \
  "static_objects" \
  "" \
  "#ffffff" \
  '[]'

It will return something like this (take note of the numeric identifier, in this case 14):

 [*] DB Host is 127.0.0.1
[INFO] Creating visual console 'My Visual Console'

[INFO] The visual console id is '14'

[root@pandorafms ~]#
  • Export the code with the export_json_visual_console command, it is important that the last parameter is set to one to obtain the numeric identifiers of each of the elements (although in this case no item is registered).
pandora_manage /etc/pandora/pandora_server.conf \ 
  --export_json_visual_console "14" "" "1"

It will return something like this (you must copy the full line below the second [INFO] informational message):

 [*] DB Host is 127.0.0.1
[INFO] Exporting visual console elements with ID '14'

[INFO] JSON file now contents:
"My Visual Console" "None.png" 1024 768 9 "static_objects" "" "#ffffff" '[]'

[root@pandorafms ~]#
  • Invoke the edit_visual_console command, a space, the visual console identifier, another space and paste the code obtained in the previous step. Modify the name (or other element or elements).
pandora_manage /etc/pandora/pandora_server.conf \ 
  --edit_visual_console \
 "14" \
 "My MODIFIED Visual Console" \
 "None.png" \
 1024 \
 768 \
 9 \
 "static_objects" \
 "" \
 "#ffffff" \
 '[]'

It will return something like the following:

 [*] DB Host is 127.0.0.1
[INFO] The visual console with id 14 is updated

[root@pandorafms ~]#

You can confirm through the PFMS Web Console or invoke the export_json_visual_console command again.

delete_visual_console

Mandatory parameter:

  • <visual_console_id>

Description: The specified visual console will be deleted using its numeric identifier, if a non-existent visual console is specified it will throw an error message.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_visual_console "1"

delete_visual_console_objects

Mandatory parameters:

  • <item_id>
  • <filter>
  • <filter_value>

Description: The elements associated with a visual console will be deleted following a filter. The available filters are:

  • image to delete all items that have an exact image name.
  • id_agent to delete all items that have a particular numeric agent identifier.
  • id_agente_modulo to delete all items that have a particular numeric module identifier.
  • id_group to delete all items that belong to a specific numeric agent group identifier. By default, and unless they have been modified, all items belong to the All group identified with the value 0; specifying this value will delete most of the elements.
  • type_graph to delete all items that have a particular chart type. By default, and unless they have been modified, all items have the value area set; specifying this value will delete most of the elements.
  • type to delete all items by their element type:
  • 0 Static image.
  • 1 Module Graph.
  • 2 Simple value.
  • 4 Label.
  • 5 Icon.
  • 10 Service.
  • 11 Group.
  • 12 Box.
  • 13 Line.
  • 14 Event history graph.
  • 15 Percentile item.
  • 17 Serialized pie graph.
  • 18 Bars graph.
  • 19 Clock.
  • 20 Color cloud.
  • 21 Network link.
  • 22 Odometer.
  • 23 Basic Chart.

Examples (see call and syntax):

To delete all items containing the image network in visual console 1:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_visual_console_objects \
 "1" image "network"

To delete all items showing agent 3 in visual console 1:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_visual_console_objects \
 "1" id_agent "3"

To delete all items representing module 2 in visual console 1:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_visual_console_objects \
 "1" id_agente_modulo "2"

To delete all items belonging to group 4 in visual console 1:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_visual_console_objects \
 "1" id_group "4"

To delete all items using the horizontal graph type in visual console 1:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_visual_console_objects \
 "1" type_graph "horizontal"

To delete all items of Odometer type (22) in visual console 1:

pandora_manage /etc/pandora/pandora_server.conf \ 
  --delete_visual_console_objects \
 "1" type "22"

duplicate_visual_console

Mandatory parameters:

  • <visual_console_id_to_copy>
  • <number_of_copies> the suffix _n from 1 to n will be added.

Optional parameter:

  • <prefix> it will be added as prefix and additionally the suffix _n from 0 to n-1.

Description: The indicated visual console will be duplicated the number of times needed.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --duplicate_visual_console "1" "7" "copy of visual console #1"

export_json_visual_console

Mandatory parameter:

  • <visual_console_id>

Mandatory parameters:

  • <directory_to_save>
  • <with_element_identifier> 0 or 1, false and true, respectively. For the edit_visual_console command, the numeric identifier of each element is required.

Description: Exports, including data in JSON format, a visual console and its elements. You can specify the path where to save the file and if you want to include the identifiers of the associated elements to facilitate later editing.

Example (see call and syntax):

pandora_manage /etc/pandora/pandora_server.conf \ 
  --export_json_visual_console "1" "/tmp" "1"

In case no visual console is registered, it is normal to return this result:

[INFO] JSON file now contents: 
"" ""    "static_objects" "" "" '[]'

←Back to Pandora FMS documentation index

1) , 2) , 3) , 4) , 5) , 6) , 7) , 8) , 9) , 10) , 11) , 12) , 13) , 14) , 15) , 16) , 17) , 18) , 19) , 20) , 21) , 22) , 23) , 24) , 25) , 26)
If necessary, use
console_api_url http://127.0.0.1/pandora_console/include/api.php