PEM Worker Usage Guide¶
The PEM Worker performs tasks on behalf of the PEM Agent. Please note that all the pemworker command-line options must be run as root user on Linux platforms and as an administrator user on Windows platforms.
The following command-line options are supported by the PEM Worker:
- On Linux:
1$./pemworker 2Postgres Enterprise Manager Agent 3Version: 8.0.0 4(Revision: REL-7_15_0-5-685-g415f794, Built on: Dec 1 2020 13:27:02) 5Schema Supported: 202010081 6 7./pemworker [options] 8./pemworker --register-agent [register-options] 9./pemworker --register-server [register-server-options] 10./pemworker --unregister-server [unregister-server-options] 11./pemworker --unregister-agent [unregister-agent-options] 12./pemworker --add-webhook [add-webhook-options] 13./pemworker --remove-webhook [remove-webhook-options 14./pemworker --register-barman [barman-registration-options] 15./pemworker --update-barman [barman-update-options] 16./pemworker --unregister-barman [barman-unregistration-options] 17 18options: 19 -v/--version (Show the version & the supported schema and, then exit.) 20 -c <filepath> (Path to the configuration file.) 21 -o <option name>=<option value> (Override the configuration file options.) 22 -f Run in the foreground (do not detach from the terminal.) 23 -t <short_wait> (Default: 10, Poll time interval (in seconds).) 24 -r <long_wait> (Default: 30, Retry period (in seconds) after connection aborted.) 25 -s <log file> (Path to the worker log file. Messages are logged to STDOUT if not specified.) 26 -l <logging verbosity> (Default: ERROR, Possible Values: ERROR, WARNING, DEBUG1, DEBUG2) 27 --allow_server_restart <true|false> (Default: true, Allow to restart the monitored server.) 28 --allow-batch-probes <true|false> (Default: false, Allow to run the batch probes on this agent.) 29 --batch-script-user <os-user> (Default: <none>, Name of the operating system user to run the batch script that is defined as a batch probe and a step in jobs.) 30 --enable-heartbeat-connection (Default: false, Agent to use dedicated connection to update the heartbeat) 31 --enable-smtp <true|false> (Default: false, Allow the PEM agent to send the email on behalf of the PEM server.) 32 --enable-snmp <true|false> (Default: false, Allow the PEM agent to send the SNMP traps on behalf of the PEM server.) 33 --enable-webhook <true|false> (Default: false, Allow the PEM agent to call webhooks on behalf of the PEM server.) 34 --max-webhook-retries (Default: 3, Retry webhooks for specified times on failure.) 35 36register-options: 37 --pem-server <hostname|address> (Host name/address of the PEM backend database server.) 38 --pem-port <port number (Default: 5432, Port of the PEM backend database server.) 39 --pem-user <username> (Database user, having superuser privileges, of the PEM backend database server.) 40 --pem-agent-user <username> (Default: agent<agent_id>, Agent user to connect the PEM server backend database server) 41 --cert-path <path> (Default: "~/.pem", Path where SSL certificates are saved.) 42 --config-dir <path> (Default: "<pemworker path>/../etc", Directory path where configuration file can be found.) 43 --display-name <name> (Default: system hostname, Display name for the agent.) 44 --force-registration (forcefully registers the agent to PEM server with arguments provided.) 45 --group <name> (Specify the group name where registered agent will be displayed.) 46 --team <database-role> (Specify the name of the database role, on the PEM backend database server, that should have access to the monitored database server.) 47 --owner <database-user> <Specify the name of the database user, on the PEM backend database server, who will own the agent.) 48 --allow_server_restart <true|false> (Default: true, Allow to restart the monitored server.) 49 --allow-batch-probes <true|false> (Default: false, Allow to run the batch probes on this agent.) 50 --pem-ssl-mode <ssl-mode> (Default: 'require', SSL mode that agent will use to connect to PEM server.) 51 --batch-script-user <os-user> (Default: <none>, Name of the operating system user to run the batch script that is defined as a batch probe and a step in jobs.) 52 --enable-heartbeat-connection (Default: false, Agent to use dedicated connection to update the heartbeat) 53 --enable-smtp <true|false> (Default: false, Allow the PEM agent to send the email on behalf of the PEM server.) 54 --enable-snmp <true|false> (Default: false, Allow the PEM agent to send the SNMP traps on behalf of the PEM server.) 55 --enable-webhook <true|false> (Default: false, Allow the PEM agent to call webhooks on behalf of the PEM server.) 56 --max-webhook-retries (Default: 3, Retry webhooks for specified times on failure.) 57 -o <option name>=<option value> (Override the configuration file options.) 58 59 NOTE: 60 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 61 PEM server to allow the pemworker to register itself. 62 63register-server-options: 64 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 65 --display-name <name> (Default: system hostname, Display name for the monitored database server.) 66 --server-addr <hostname|address> (Host name/address of the database server to register with PEM server.) 67 --server-port <port> (Port of the database server.) 68 --server-database <name>(Postgres server database.) 69 --server-user <name>(Database server user name.) 70 --server-service-name <service-name> (Database server service name.) 71 --efm-cluster-name <name> (EFM Cluster name.) 72 --efm-install-path <path> (EFM installation path.) 73 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 74 --remote-monitoring <yes|no> (Default: 'no', Allow remote monitoring.) 75 --group <name> (Specify the group name where registered server will be displayed.) 76 --team <datase-role> (Specify the name of the database role, on the PEM backend database server, that should have access to the monitored database server.) 77 --owner <name> (Specify the name of the database user who will own the monitored server.) 78 --asb-host-name <hostname> (Host name that the agent will use to connect to the database server. If not provided then '--server-addr' value will be used.) 79 --asb-host-port <port> (Port number that agent will use to connect to database server. If not provided then '--server-port' value will be used. 80 --asb-host-db <database> (Database name that agent will use to connect to database server. If not provided then '--server-database' value will be used.) 81 --asb-host-user <database-user> (Database username that agent will use to connect to database server. If not provided then '--server-user' value will be used.) 82 --asb-ssl-mode <ssl-mode> (Default: 'prefer', SSL mode that agent will use to connect to monitored database server.) 83 84 NOTE: 85 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 86 PEM server to allow the pemworker to connect as a PEM admin user. Set 87 PEM_MONITORED_SERVER_PASSWORD to provide the password of the database server being 88 registered and monitored by pemagent. 89 90unregister-server-options: 91 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 92 --server-addr (Database server address to unregister from PEM server.) 93 --server-port (Port of database server.) 94 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 95 96unregister-agent-options: 97 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 98 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 99 100add-webhook-options: 101 --webhook-name (Name of the webhook endpoint.) 102 --webhook-ssl-key (The complete path of the client key file to connect to the webhook server.) 103 --webhook-ssl-crt (The complete path of the client certificate file to connect to the webhook server.) 104 --webhook-ssl-ca-crt (The complete path to the webhook SSL CA certificate file.) 105 --webhook-ssl-crl (The complete path of the CRL file to validate revoked webhook server certificate.) 106 --webhook-allow-insecure-ssl (Default: false, Allow webhooks to call with insecure flag.) 107 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 108 109remove-webhook-options: 110 --webhook-name (Name of the webhook endpoint.) 111 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 112 113 NOTE: 114 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 115 PEM server to allow the pemworker to connect as a PEM admin user. 116 117barman-registration-options: 118 --api-url <url> (URL of the BARMAN API 'pg-backup-api') 119 --description <name> (Description to show on the UI 'User interface' for the BARMAN API.) 120 --probe-execution-frequency <interval> (Default: 30, Probe the BARMAN API 'pg-backup-api' at regular interval 'in seconds' and fetch the metrics.) 121 --heartbeat-interval <interval> (Default: 10, Ping the BARMAN API 'pg-backup-api' 'status' API at a regular interval 'in seconds' for checking its availability.) 122 --ssl-crt <certificate_file> (SSL certificate file for the BARMAN API.) 123 --ssl-key <key_file> (Private SSL key for the BARMAN API.) 124 --ssl-ca-crt <ca_file> (CA certificate to verify peer against the BARMAN API.) 125 --team <database-role> (Specify the name of the database group role, on the PEM backend database server, that should have access to this BARMAN API Server.) 126 --owner <database-user> (Specify the name of the database user, on the PEM backend database server, who will own the BARMAN API Server.) 127 --config-file/-c <config_file> (Path to the agent configuration file.) 128 129barman-update-options: 130 --id <barman-id> (ID for the existing BARMAN API 'pg-backup-api') 131 --api-url <url> (URL of the BARMAN API 'pg-backup-api') 132 --probe-execution-frequency <interval> (Default: 30, Probe the BARMAN API 'pg-backup-api' at regular interval 'in seconds' and fetch the metrics.) 133 --heartbeat-interval <interval> (Default: 10, Ping the BARMAN API 'pg-backup-api' 'status' API at a regular interval 'in seconds' for checking its availability.) 134 --ssl-crt <certificate_file> (SSL certificate file for the BARMAN API.) 135 --ssl-key <key_file> (Private SSL key for the BARMAN API.) 136 --ssl-ca-crt <ca_file> (CA certificate to verify peer against the BARMAN API.) 137 --config-file/-c <config_file> (Path to the agent configuration file.) 138 139barman-unregistration-options: 140 --id <barman-id> (ID for the existing BARMAN API, registered with the PEM Server.'pg-backup-api') 141 --config-file/-c <config_file> (Path to the agent configuration file.)
- On Windows:
1C:\Program Files\edb\pem\agent\bin> pemworker.exe --help 2Postgres Enterprise Manager Worker 3Version: 8.0.0 4 5pemworker.exe DEBUG [options] 6pemworker.exe REGISTER [register-options] 7pemworker.exe REGISTER-SERVER [register-server-options] 8pemworker.exe UNREGISTER-SERVER [unregister-server-options] 9pemworker.exe UNREGISTER-AGENT [unregister-agent-options] 10pemworker.exe ADD-WEBHOOK [--add-webhook-options] 11pemworker.exe REMOVE-WEBHOOK [--remove-webhook-options] 12 13options: 14 -v/--version (Show the version & the supported schema and, then exit.) 15 -c <filepath> (Path to the configuration file.) 16 -o <option name>=<option value> (Override the configuration file options.) 17 -t <short_wait> (Default: 10, Poll time interval (in seconds).) 18 -r <long_wait> (Default: 30, Retry period (in seconds) after connection aborted.) 19 -l <logging verbosity> (Default: ERROR, Possible Values: ERROR, WARNING, DEBUG1, DEBUG2) 20 --allow_server_restart <true|false> (Default: true, Allow to restart the monitored server.) 21 --allow-batch-probes <true|false> (Default: false, Allow to run the batch probes on this agent.) 22 --enable-heartbeat-connection (Default: false, Agent to use dedicated connection to update the heartbeat) 23 --enable-smtp <true|false> (Default: false, Allow the PEM agent to send the email on behalf of the PEM server.) 24 --enable-snmp <true|false> (Default: false, Allow the PEM agent to send the SNMP traps on behalf of the PEM server.) 25 --enable-webhook <true|false> (Default: false, Allow the PEM agent to call webhooks on behalf of the PEM server.) 26 --max-webhook-retries (Default: 3, Retry webhooks for specified times on failure.) 27 28register-options: 29 --pem-server <hostname|address> (Host name/address of the PEM backend database server.) 30 --pem-port <port number (Default: 5432, Port of the PEM backend database server.) 31 --pem-user <username> (Database user, having superuser privileges, of the PEM backend database server.) 32 --pem-agent-user <username> (Default: agent<agent_id>, Agent user to connect the PEM server backend database server) 33 --cert-path <path> (Default: "%APPDATA%\pem", Path where SSL certificates are saved.) 34 --display-name <name> (Default: system hostname, Display name for the agent.) 35 --force-registration (forcefully registers the agent to PEM server with arguments provided.) 36 --group <name> (Specify the group name where registered agent will be displayed.) 37 --team <database-role> (Specify the name of the database role, on the PEM backend database server, that should have access to the monitored database server.) 38 --owner <database-user> <Specify the name of the database user, on the PEM backend database server, who will own the agent.) 39 --allow_server_restart <true|false> (Default: true, Allow to restart the monitored server.) 40 --allow-batch-probes <true|false> (Default: false, Allow to run the batch probes on this agent.) 41 --pem-ssl-mode <ssl-mode> (Default: 'require', SSL mode that agent will use to connect to PEM server.) 42 --enable-heartbeat-connection (Default: false, Agent to use dedicated connection to update the heartbeat) 43 --enable-smtp <true|false> (Default: false, Allow the PEM agent to send the email on behalf of the PEM server.) 44 --enable-snmp <true|false> (Default: false, Allow the PEM agent to send the SNMP traps on behalf of the PEM server.) 45 --enable-webhook <true|false> (Default: false, Allow the PEM agent to call webhooks on behalf of the PEM server.) 46 --max-webhook-retries (Default: 3, Retry webhooks for specified times on failure.) 47 -o <option name>=<option value> (Override the configuration file options.) 48 49 NOTE: 50 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 51 PEM server to allow the pemworker to register itself. 52 53register-server-options: 54 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 55 --display-name <name> (Default: system hostname, Display name for the monitored database server.) 56 --server-addr <hostname|address> (Host name/address of the database server to register with PEM server.) 57 --server-port <port> (Port of the database server.) 58 --server-database <name>(Postgres server database.) 59 --server-user <name>(Database server user name.) 60 --server-service-name <service-name> (Database server service name.) 61 --remote-monitoring <true|false> (Allow remote monitoring.) 62 --group <name> (Specify the group name where registered server will be displayed.) 63 --team <database-role> (Specify the name of the database role, on the PEM backend database server, that should have access to the monitored database server.) 64 --owner <name> (Specify the name of the database user who will own the monitored server.) 65 --asb-host-name <hostname> (Host name that the agent will use to connect to the database server. If not provided then '--server-addr' value will be used.) 66 --asb-host-port <port> (Port number that agent will use to connect to database server. If not provided then '--server-port' value will be used. 67 --asb-host-db <database> (Database name that agent will use to connect to database server. If not provided then '--server-database' value will be used.) 68 --asb-host-user <database-user> (Database username that agent will use to connect to database server. If not provided then '--server-user' value will be used.) 69 --asb-ssl-mode <ssl-mode> (Default: 'prefer', SSL mode that agent will use to connect to monitored database server.) 70 71 NOTE: 72 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 73 PEM server to allow the pemworker to connect as a PEM admin user. Set 74 PEM_MONITORED_SERVER_PASSWORD to provide the password of the database server being 75 registered and monitored by pemagent. 76 77unregister-server-options: 78 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 79 --server-addr (Database server address to unregister from PEM server.) 80 --server-port (Port of database server.) 81 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 82 83unregister-agent-options: 84 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 85 86add-webhook-options: 87 --webhook-name (Name of the webhook endpoint.) 88 --webhook-ssl-key (The complete path of the client key file to connect to the webhook server.) 89 --webhook-ssl-crt (The complete path of the client certificate file to connect to the webhook server.) 90 --webhook-ssl-ca-crt (The complete path to the webhook SSL CA certificate file.) 91 --webhook-ssl-crl (The complete path of the CRL file to validate revoked webhook server certificate.) 92 --webhook-allow-insecure-ssl (Default: false, Allow webhooks to call with insecure flag.) 93 94remove-webhook-options: 95 --webhook-name (Name of the webhook endpoint.) 96 97 NOTE: 98 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 99 PEM server to allow the pemworker to connect as a PEM admin user.