Full reference of the administration CLI (pandora_manage)¶
pandora_manage is the administration tool that runs on the server and talks
directly to the database and to the product libraries. It is not an API client:
there is no HTTP request, no token and no list of allowed addresses. That lets it
do things the API cannot do and, for the same reason, it is useless for
administering a console from outside.
It has not been retired and it is no relic: it is still the only way to do half a dozen operations that the API v2 does not expose. What has changed is the division of labour. The three command-line tools do not compete with each other:
| Tool | Where it runs | What it talks to | What authorises it |
|---|---|---|---|
pandora_manage |
On the server | Database and local libraries | Access to the system |
pandora_revent |
On any machine | API v1 (api.php) |
Allowed IP, API password and user |
pandora-cli |
On any machine | API v2 | User session or token |
The practical consequence is the usual one: whatever is done with
pandora_manage does not go through the API, so the API security layers —the
IP list and the API password— do not apply, and neither do its user permissions.
What limits its use is access to the server and to the database. That is why it
runs as root, on the machine, and is not handed to a remote script.
Where it lives and what it needs¶
The binary is installed with the server at /usr/bin/pandora_manage. It needs
three things:
- The server configuration, passed as the first argument:
/etc/pandora/pandora_server.conf. - Root permissions. It reads the server configuration and writes to the database.
- A reachable database. The program connects as soon as it starts, before running any option; if the configuration or the connection fails, it does nothing.
pandora_manage /etc/pandora/pandora_server.conf --option parameter1 parameter2
There is no further ceremony: no login, no context, no credentials file of its own.
Syntax and quoting¶
The general form is the one above. Mandatory and optional parameters appear in brackets in the help, and are passed in the same order.
- Single quotes for any value with spaces:
--create_group 'Virtual servers'. - Two single quotes together (
'') to skip an optional parameter without shifting to the next one. If the parameter was mandatory, the program answers with the error and the help. use_aliasat the end in the commands that accept it: the agent is then identified by its alias instead of its internal name. It goes as the last parameter, not in the middle.- Exact spelling of names that already exist. When the value is the name of an agent, a group or a server, use the same string the console stores: the program looks for a match, and a difference in case or an extra space means "does not exist".
The help¶
The full help, with every category:
pandora_manage --h | more
--help does the same. The program accepts any option that starts with a dash
and ends in h, so --h is the short form people actually use.
Running it with no option does not print the help cleanly: it first warns that there are no arguments and then shows it. And if an option is passed with a different number of parameters than it expects, the program answers with the parameter error and only that option's line, which is the quick way to look up one signature:
[ERROR] Parameters error: 0 received | 1 necessary.
What the API does not expose¶
These operations have no equivalent in the API v2, so today they can only be done here. They go with the chapter that covers them, when there is one:
| Operation | Option | Where it is covered |
|---|---|---|
| Unlock a user blocked by failed attempts | --unlock_user <user> |
7.11 |
| Remove two-factor authentication from a user | --disable_double_auth <user> |
4.2 |
| Enable or disable the advanced ACL | --enable_eacl, --disable_eacl |
4.3 |
| Clean or delete an agent's remote configuration | --clean_conf_file, --delete_conf_file |
This chapter |
| Clusters: create, add agents and items, check status | --new_cluster, --add_cluster_agent, --get_cluster_status |
9.6 |
| Reset an agent's module and alert counters | --reset_agent_counts <agent_id> |
This chapter |
| Check a vulnerability against the local database | --check_vulnerabilities <software> <version> [<os>] |
7.4 |
One example of each of the first two, which are the ones used most in an emergency:
pandora_manage /etc/pandora/pandora_server.conf --unlock_user jdoe
pandora_manage /etc/pandora/pandora_server.conf --disable_double_auth jdoe
Both write to the database and ask for no confirmation. Check the user before running them.
Common recipes¶
Create a group and an agent inside it. The operating system and the server must already exist in the console:
pandora_manage /etc/pandora/pandora_server.conf \
--create_group 'Virtual servers' 'Servers'
pandora_manage /etc/pandora/pandora_server.conf \
--create_agent web1 Linux 'Virtual servers' pandora.local 10.0.0.5 'Web front end'
Create a user. The third parameter is 1 for administrator and 0 for a
regular user:
pandora_manage /etc/pandora/pandora_server.conf \
--create_user jdoe 'long-password' 0 'Operations team'
A newly created user with no profile assigned cannot log in; profiles are added
with --add_profile_to_user.
Raise an event. The first three parameters are mandatory; the rest are
optional and can be skipped with '':
pandora_manage /etc/pandora/pandora_server.conf \
--create_event 'Scheduled restart' system 'Virtual servers'
Apply a policy to an agent. The first parameter is the policy identifier, not its name:
pandora_manage /etc/pandora/pandora_server.conf --apply_policy 7 42
Scheduled downtimes have their own section in 3.8, with the full syntax and the four types.
When not to use it¶
- Remote work. If the console is on another server, or the script runs on
another machine, this is no good: use the API v2 or
pandora-cli. - Work that must be subject to console permissions. Here no ACL profile applies: whoever can run the binary can do the operation.
- Events against a remote console. That is what
pandora_reventis for; it talks to the API v1 with a user's credentials.
The rule is simple: if the operation exists in the API and you are doing it from outside, do it through the API. If it does not exist, or you are on the server and need to touch the database, this is the way.
Common problems¶
| Message | Cause and remedy |
|---|---|
[ERROR] No valid arguments |
It was run without an option. Add the option, or --h for the help. |
[ERROR] Parameters error: N received | M necessary. |
Wrong number of parameters. The line for that option appears below. |
[ERROR] Error: The user 'jdoe' does not exist. |
The name or identifier does not exist in the console. Check the spelling. |
[ERROR] Error: The group 'Servers' already exists. |
Something with that name is already there. Use another one, or modify the existing one. |
| The node is in centralised mode and the operation is refused | That operation is done in the Command Center, not on the node. |
Can't locate PandoraFMS/SIEMServer.pm |
The .pl from util/ is being run instead of the installed binary. Use /usr/bin/pandora_manage. |
| Nothing happens and there is no visible error | The configuration or the database did not load. The program connects at start-up: check the .conf path and database access. |
Command reference¶
Chapter 9.15 · Administration CLI command reference lists the 135 options of the binary in 15 domains, with their signature and description. It is generated from the program's own help and is always in English:
pandora_manage --h | more