Register/Unregister database server using PEM Agent

You can use the pemworker utility to register a database server for monitoring. The RPM installer places the utility in the /usr/pem/agent/bin directory. Use the following commands to register a server:

  • On Linux: pemworker −−register-server [register-server-options]
  • On Windows: pemworker.exe REGISTER-SERVER [register-server-options]

The following information is required when registering a database server with PEM Server; you will be prompted for required information if you do not include it on the command line:

Parameters Command-line options Optional Description Default Value
PEM Admin User −−pem-user <username> No PEM Admin User to connect the PEM database server.  
Server Host −−server-addr <host name/address> No Host name/address of the database server  
Server Port −−server-port <port> No Port on which database server is running  
Server Database −−server-database <name> No Database of the server  
Server User −−server-user <name> No User of the server, which will be used by the agent for monitoring purpose  
Server Service Name −−server-service-name <name> Yes Name of the system level service, which controls the operations like start, stop, restart, reload, etc. of the server  
Remote Monitoring? −−remote-monitoring <true/false> No false for the server installed on the same machine, otherwise true false
EDB Failover manager Cluster Name −−efm-cluster-name <name> Yes Name of EDB Failover Manager Cluster associated with this server.  
EDB Failover manager Installation Path −−efm-install-path <path> Yes Installation Path of EDB Failover Manager associated with this server.  

Use the PEM_NEW_SERVER_PASSWORD environment variable to set the password of the user of the database server which is to be registered. When registering the database server, the pemworker utility will bind the server to the PEM Agent associated with the pemworker utility. The PEM server will use the specified user name (Server User) and password specified in the PEM_NEW_SERVER_PASSWORD environment variable when monitoring the database server.

NOTE: You can use the PEM_SERVER_PASSWORD environment variable to set the password of the PEM Admin User. If the PEM_SERVER_PASSWORD is not set, the server will use the PGPASSWORD or pgpass file when connecting to the PEM Database Server.

Unregister a database server

You can use the pemworker utility to unregister a server:

  • On Linux: pemworker −−unregister-server [unregister-server-options]
  • On Windows: pemworker.exe UNREGISTER-SERVER [unregister-server-options]

Include the following information when unregistering a database server from the PEM Server; you will be prompted for required information if you do not include it on the command line:

Parameters Command-line options Optional Description Default Value
PEM Admin User −−pem-user <username> No PEM Admin User to connect the PEM database server.  
Server Host −−server-addr <host name/address> No Host name/address of the database server.  
Server Port −−server-port <port> No Port on which database server is running.  

The command will unregister the server from the PEM Server for the specified combination of Server Host and Server Port, which is being monitored by the PEM Agent.

NOTE: You can use the PEM_SERVER_PASSWORD environment variable to set the password of the PEM Admin User. If the PEM_SERVER_PASSWORD is not set, the server will use the PGPASSWORD or pgpass file when connecting to the PEM Database Server.

Refer the PEM Worker Usage Guide.