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 --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.) 51 --enable-heartbeat-connection (Default: false, Agent to use dedicated connection to update the heartbeat) 52 --enable-smtp <true|false> (Default: false, Allow the PEM agent to send the email on behalf of the PEM server.) 53 --enable-snmp <true|false> (Default: false, Allow the PEM agent to send the SNMP traps on behalf of the PEM server.) 54 --enable-webhook <true|false> (Default: false, Allow the PEM agent to call webhooks on behalf of the PEM server.) 55 --max-webhook-retries (Default: 3, Retry webhooks for specified times on failure.) 56 -o <option name>=<option value> (Override the configuration file options.) 57 58 NOTE: 59 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 60 PEM server to allow the pemworker to register itself. 61 62register-server-options: 63 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 64 --display-name <name> (Default: system hostname, Display name for the monitored database server.) 65 --server-addr <hostname|address> (Host name/address of the database server to register with PEM server.) 66 --server-port <port> (Port of the database server.) 67 --server-database <name>(Postgres server database.) 68 --server-user <name>(Database server user name.) 69 --server-service-name <service-name> (Database server service name.) 70 --efm-cluster-name <name> (EFM Cluster name.) 71 --efm-install-path <path> (EFM installation path.) 72 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 73 --remote-monitoring <yes|no> (Default: 'no', Allow remote monitoring.) 74 --group <name> (Specify the group name where registered server will be displayed.) 75 --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.) 76 --owner <name> (Specify the name of the database user who will own the monitored server.) 77 --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.) 78 --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. 79 --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.) 80 --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.) 81 --asb-ssl-mode <ssl-mode> (Default: 'prefer', SSL mode that agent will use to connect to database server.) 82 83 NOTE: 84 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 85 PEM server to allow the pemworker to connect as a PEM admin user. Set 86 PEM_MONITORED_SERVER_PASSWORD to provide the password of the database server being 87 registered and monitored by pemagent. 88 89unregister-server-options: 90 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 91 --server-addr (Database server address to unregister from PEM server.) 92 --server-port (Port of database server.) 93 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 94 95unregister-agent-options: 96 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 97 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 98 99add-webhook-options: 100 --webhook-name (Name of the webhook endpoint.) 101 --webhook-ssl-key (The complete path of the client key file to connect to the webhook server.) 102 --webhook-ssl-crt (The complete path of the client certificate file to connect to the webhook server.) 103 --webhook-ssl-ca-crt (The complete path to the webhook SSL CA certificate file.) 104 --webhook-ssl-crl (The complete path of the CRL file to validate revoked webhook server certificate.) 105 --webhook-allow-insecure-ssl (Default: false, Allow webhooks to call with insecure flag.) 106 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 107 108remove-webhook-options: 109 --webhook-name (Name of the webhook endpoint.) 110 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 111 112 NOTE: 113 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 114 PEM server to allow the pemworker to connect as a PEM admin user. 115 116barman-registration-options: 117 --api-url <url> (URL of the BARMAN API 'pg-backup-api') 118 --description <name> (Description to show on the UI 'User interface' for the BARMAN API.) 119 --probe-execution-frequency <interval> (Default: 30, Probe the BARMAN API 'pg-backup-api' at regular interval 'in seconds' and fetch the metrics.) 120 --heartbeat-interval <interval> (Default: 10, Ping the BARMAN API 'pg-backup-api' 'status' API at a regular interval 'in seconds' for checking its availability.) 121 --ssl-crt <certificate_file> (SSL certificate file for the BARMAN API.) 122 --ssl-key <key_file> (Private SSL key for the BARMAN API.) 123 --ssl-ca-crt <ca_file> (CA certificate to verify peer against the BARMAN API.) 124 --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.) 125 --owner <database-user> (Specify the name of the database user, on the PEM backend database server, who will own the BARMAN API Server.) 126 --config-file/-c <config_file> (Path to the agent configuration file.) 127 128barman-update-options: 129 --id <barman-id> (ID for the existing BARMAN API 'pg-backup-api') 130 --api-url <url> (URL of the BARMAN API 'pg-backup-api') 131 --probe-execution-frequency <interval> (Default: 30, Probe the BARMAN API 'pg-backup-api' at regular interval 'in seconds' and fetch the metrics.) 132 --heartbeat-interval <interval> (Default: 10, Ping the BARMAN API 'pg-backup-api' 'status' API at a regular interval 'in seconds' for checking its availability.) 133 --ssl-crt <certificate_file> (SSL certificate file for the BARMAN API.) 134 --ssl-key <key_file> (Private SSL key for the BARMAN API.) 135 --ssl-ca-crt <ca_file> (CA certificate to verify peer against the BARMAN API.) 136 --config-file/-c <config_file> (Path to the agent configuration file.) 137 138barman-unregistration-options: 139 --id <barman-id> (ID for the existing BARMAN API, registered with the PEM Server.'pg-backup-api') 140 --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 --enable-heartbeat-connection (Default: false, Agent to use dedicated connection to update the heartbeat) 42 --enable-smtp <true|false> (Default: false, Allow the PEM agent to send the email on behalf of the PEM server.) 43 --enable-snmp <true|false> (Default: false, Allow the PEM agent to send the SNMP traps on behalf of the PEM server.) 44 --enable-webhook <true|false> (Default: false, Allow the PEM agent to call webhooks on behalf of the PEM server.) 45 --max-webhook-retries (Default: 3, Retry webhooks for specified times on failure.) 46 -o <option name>=<option value> (Override the configuration file options.) 47 48 NOTE: 49 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 50 PEM server to allow the pemworker to register itself. 51 52register-server-options: 53 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 54 --display-name <name> (Default: system hostname, Display name for the monitored database server.) 55 --server-addr <hostname|address> (Host name/address of the database server to register with PEM server.) 56 --server-port <port> (Port of the database server.) 57 --server-database <name>(Postgres server database.) 58 --server-user <name>(Database server user name.) 59 --server-service-name <service-name> (Database server service name.) 60 --remote-monitoring <true|false> (Allow remote monitoring.) 61 --group <name> (Specify the group name where registered server will be displayed.) 62 --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.) 63 --owner <name> (Specify the name of the database user who will own the monitored server.) 64 --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.) 65 --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. 66 --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.) 67 --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.) 68 --asb-ssl-mode <ssl-mode> (Default: 'prefer', SSL mode that agent will use to connect to database server.) 69 70 NOTE: 71 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 72 PEM server to allow the pemworker to connect as a PEM admin user. Set 73 PEM_MONITORED_SERVER_PASSWORD to provide the password of the database server being 74 registered and monitored by pemagent. 75 76unregister-server-options: 77 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 78 --server-addr (Database server address to unregister from PEM server.) 79 --server-port (Port of database server.) 80 --config-dir <Directory path of agent configuration file (Default: "<pemworker path>/../etc") 81 82unregister-agent-options: 83 --pem-user <username> (Database user, a member of 'pem_admin' role, of the PEM backend database server.) 84 85add-webhook-options: 86 --webhook-name (Name of the webhook endpoint.) 87 --webhook-ssl-key (The complete path of the client key file to connect to the webhook server.) 88 --webhook-ssl-crt (The complete path of the client certificate file to connect to the webhook server.) 89 --webhook-ssl-ca-crt (The complete path to the webhook SSL CA certificate file.) 90 --webhook-ssl-crl (The complete path of the CRL file to validate revoked webhook server certificate.) 91 --webhook-allow-insecure-ssl (Default: false, Allow webhooks to call with insecure flag.) 92 93remove-webhook-options: 94 --webhook-name (Name of the webhook endpoint.) 95 96 NOTE: 97 Set environment variable PEM_SERVER_PASSWORD to provide the password for the 98 PEM server to allow the pemworker to connect as a PEM admin user.