Tuesday, December 19, 2017

Hyperic installation issue in Linux || Error: /tmp/agent.encrypt.lock is locked. can't continue.

Solving hyperic monitoring tool installation issue:

This solution was tested on RHEL-7.

[root@system1 bin]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)
[root@system1 bin]#

[root@system1 bin]# ./hq-agent.sh start
Starting HQ Agent...... running (42024).
Error: /tmp/agent.encrypt.lock is locked. can't continue.
[root@system1 bin]#

[root@system1 opt]# tar -xzf hyperic-hqee-agent-x86-64-linux-5.8.5.tar.gz
[root@system1 opt]# cd hyperic-hqee-agent-5.8.5/bin/
[root@system1 bin]# ll
total 16
-rw-r--r-- 1 33334 33334  911 Nov 30  2015 hq-agent.bat
-rwxr-xr-x 1 33334 33334 1160 Nov 30  2015 hq-agent.sh
-rw-r--r-- 1 33334 33334 3961 Nov 30  2015 logBundleAgent.bat
-rwxr-xr-x 1 33334 33334 1949 Nov 30  2015 logBundleAgent.sh
[root@system1 bin]#

[root@system1 bin]# ./hq-agent.sh start
Starting HQ Agent...... running (42024).
Error: /tmp/agent.encrypt.lock is locked. can't continue.
org.hyperic.hq.agent.AgentConfigException: /tmp/agent.encrypt.lock is locked. can't continue.
        at org.hyperic.hq.agent.AgentConfig.ensurePropertiesEncryption(AgentConfig.java:274)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.ensurePropertiesEncryption(AgentClient.java:1437)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.initializeAgent(AgentClient.java:1207)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.main(AgentClient.java:1372)
[root@system1 bin]#

[root@system1 bin]# ./hq-agent.sh stop
Stopping HQ Agent...
Waiting for HQ Agent to exit...
Waiting for HQ Agent to exit...
Waiting for HQ Agent to exit...
Waiting for HQ Agent to exit...
Waiting for HQ Agent to exit...
Stopped HQ Agent.
[root@system1 bin]#

[root@system1 bin]# ./hq-agent.sh start
Starting HQ Agent...... running (42793).
Error: /tmp/agent.encrypt.lock is locked. can't continue.
org.hyperic.hq.agent.AgentConfigException: /tmp/agent.encrypt.lock is locked. can't continue.
        at org.hyperic.hq.agent.AgentConfig.ensurePropertiesEncryption(AgentConfig.java:274)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.ensurePropertiesEncryption(AgentClient.java:1437)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.initializeAgent(AgentClient.java:1207)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.main(AgentClient.java:1372)
[root@system1 bin]#


Solution 1:

[root@system1 bin]# /etc/init.d/hyperic-hqee-agent status
/etc/init.d/hyperic-hqee-agent: line 36: /opt/hyperic-hqee-agent/bin/hq-agent.sh: No such file or directory
[root@system1 bin]#

In this case, you ned to create soft link of your hyperic agent installation directory to match the entry from "/etc/init.d/hyperic-hqee-agent" script file.

[root@system1 opt]#
[root@system1 opt]# ln -s hyperic-hqee-agent-5.8.5/ hyperic-hqee-agent
[root@system1 opt]#
[root@system1 opt]# cd hyperic-hqee-agent/bin/
[root@system1 opt]#
[root@system1 bin]# ./hq-agent.sh stop
Stopping HQ Agent...
Waiting for HQ Agent to exit...
Waiting for HQ Agent to exit...
Waiting for HQ Agent to exit...
Waiting for HQ Agent to exit...
Waiting for HQ Agent to exit...
Stopped HQ Agent.
[root@system1 bin]#

In some cases, this is a sufficient solution but if you are still facing the issue like below, check 2nd solution:

[root@system1 bin]# ./hq-agent.sh setup
Error: /tmp/agent.encrypt.lock is locked. can't continue.
org.hyperic.hq.agent.AgentConfigException: /tmp/agent.encrypt.lock is locked. can't continue.
        at org.hyperic.hq.agent.AgentConfig.ensurePropertiesEncryption(AgentConfig.java:274)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.ensurePropertiesEncryption(AgentClient.java:1437)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.initializeAgent(AgentClient.java:1207)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.main(AgentClient.java:1372)
[root@system1 bin]#


Solution 2:

Check the FQDN of the system. In my case its not working.
[root@system1 bin]# hostname -f
^C
[root@system1 bin]#

Check if the hostname interface is resolving. In my case its not working.
[root@system1 bin]#
[root@system1 bin]# hostname -i
^C
[root@system1 bin]#

Check the hostname:
[root@system1 bin]# hostname
system1.dir.com
[root@system1 bin]#

====> Check if "hostname -f" command is showing system FQDN.
====> Check if "hostname -i" is showing the assigned system IP.

If not, you need to make changes in "/etc/hosts" file. As below:
[root@system1 bin]# cat /etc/hosts | grep -i system1
<own server IP>  system1.dir.com  system1
[root@system1 bin]#

Upon this, above both commands will run properly:
[root@system1 bin]# hostname -f
system1.dir.com
[root@system1 bin]#

[root@system1 bin]# hostname -i
<own server IP>
[root@system1 bin]#

Now, hyperic will install/start properly:
[root@system1 bin]# ./hq-agent.sh setup
Error: /tmp/agent.encrypt.lock is locked. can't continue.
org.hyperic.hq.agent.AgentConfigException: /tmp/agent.encrypt.lock is locked. can't continue.
        at org.hyperic.hq.agent.AgentConfig.ensurePropertiesEncryption(AgentConfig.java:274)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.ensurePropertiesEncryption(AgentClient.java:1437)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.initializeAgent(AgentClient.java:1207)
        at org.hyperic.hq.bizapp.agent.client.AgentClient.main(AgentClient.java:1372)
[root@system1 bin]#

[root@system1 bin]# ./hq-agent.sh stop
Stopping HQ Agent...
HQ Agent was not running.
[root@system1 bin]#

[root@system1 bin]# ./hq-agent.sh start
Starting HQ Agent...... running (44141).
[ Running agent setup ]
Should Agent communications to HQ be unidirectional [default=no]: yes
What is the HQ server IP address: <hyperic server IP>
Should Agent communications to HQ always be secure [default=yes]:
What is the HQ server SSL port [default=7443]:
- Testing secure connection ... Success
What is your HQ login [default=hqadmin]:
What is your HQ password:
What is the agent IP address [default=<own server IP>]:
- Received temporary auth token from agent
- Registering agent with HQ
- HQ gave us the following agent token
    1506777811224-8923478786777132225-2677299126324777
- Informing agent of new HQ server
- Validating
- Successfully setup agent
- Agent using new transport, unidirectional=true, port=7443
[root@system1 bin]#

No comments:

Post a Comment