PEM Agent Troubleshooting¶
Restoring a Deleted PEM Agent¶
If an agent has been deleted from the
pem.agent table then you cannot restore it. You will need to use the pemworker utility to re-register the agent.
If an agent has been deleted from PEM Web client but still has an entry in the
pem.agent table with value of active = f, then you can restore the agent using
the following steps:
Use the following command to check the values of the
pem=# select * from pem.agent;
Update the status for the agent to
pem=# update pem.agent set active=true where id=<x>;
xis the identifier that was displayed in the output of the query used in step 1.
Refresh the PEM web client.
The deleted agent will be restored again. However, the servers that were bound to that particular agent might appear to be down. To resolve this issue, you need to modify the PEM agent properties of the server to add the bound agent again; after the successful modification, the servers will be displayed as running properly.
Reconfiguring the PEM Server¶
In certain situations, you may need to uninstall the PEM server, install it again, and reconfigure the PEM server. Use the following commands in the given sequence:
Use the following command to remove the PEM server configuration and uninstall:
Use the following command to remove the PEM packages:
yum erase edb-pem-server
Use the following command to drop the
DROP DATABASE pem
Move the certificates from
/root/.pem/to another location:
mv /root/.pem/* <new_location>
/usr/edb/pem/agent/etc/agent.cfgto another location:
mv /usr/edb/pem/agent/etc/agent.cfg <new_location>
Then, use the following command to configure the PEM server again:
Using the Command Line to Delete a PEM Agent with Down or Unknown Status¶
Using the PEM web interface to delete PEM agents with
Unknown status may be difficult if the number of such agents is large. In such situations, you might want to use the command line interface to delete Down or Unknown agents.
- Use the following query to delete the agents that are
Downfor more than N number of hours:
DELETE FROM pem.agent WHERE id IN (SELECT a.id FROM pem.agent a JOIN pem.agent_heartbeat b ON (b.agent_id=a.id) WHERE a.id IN (SELECT agent_id FROM pem.agent_heartbeat WHERE (EXTRACT (HOUR FROM now())- EXTRACT (HOUR FROM last_heartbeat)) > <N> ));``
- Use the following query to delete the agents with an
DELETE FROM pem.agent WHERE id IN (SELECT id FROM pem.agent WHERE id NOT IN (SELECT agent_id FROM pem.agent_heartbeat));``