VMware Cloud Community
nbrown1
Contributor
Contributor

Autostart Hyperic 2.7.0 with agent.rc file

Hi-

I noticed that the Hyperic Agent install includes an /rcfiles directory in which there is a agent.rc file. This appears to be the file that we would use to autostop/autostart the agent upon reboot (by putting a copy of the file into /etc/init.d and running chkconfig [for a linux server]). In reviewing the agent.rc file, it expects the user to set an AGENT_DIR parameter, which is used by the script to run hq-agent.sh. It also looks like the AGENT_DIR directory is checked for the existance of a tokendata file. In our installation, the tokendata file actually resides in the AGENT_DIR/data directory.

Is it ok to move the tokendata file to the directory that will be checked by agent.rc, or is it a better idea to leave tokendata where it is, and modify the agent.rc script to look for it in the /data directory?

Thanks...

Nathaniel
0 Kudos
6 Replies
admin
Immortal
Immortal

Hi Nathaniel,

The agent.rc can be used on linux systems to start the agent upon system restart.

The location of the tokendata file is incorrect in the script. I have filed a bug for this at http://jira.hyperic.com/browse/HHQ-114. It will be fixed in our upcoming 2.7.2 release due out in a few weeks.

In the meantime you can work around the issue by changing the script to check the correct location in $AGENT_DIR/data/tokendata. Also remember to set the AGENT_DIR variable as well. I would recommend creating a symlink in the directory where you install your agents, so that this variable does not need to be updated when you upgrade your agents.
0 Kudos
nbrown1
Contributor
Contributor

Thanks Ryan. We'll make the change in the script as you suggested. As a follow-up question, is there a similar script for the server? I have poked around the directory structure where we have installed the server (we went with the default install option), and I haven't come across anything similar to the agent.rc. Just wondering if one exists. Thanks...

Nathaniel
0 Kudos
admin
Immortal
Immortal

Currently there is not a script for the server component. It would look very similar to the agent script though. I have filed an enhancement: http://jira.hyperic.com/browse/HHQ-115
0 Kudos
Kro77
Contributor
Contributor

Hi, I am trying to use this agent, and do a chkconfig agent.rc on, and get a agent.rc does not support chkconfig. I am missing something simple... any hint.

/etc/init.d/
0 Kudos
admin
Immortal
Immortal

The rc script does not support chkconfig. It only supports start, stop, restart and ping.

What config are you looking to validate?
0 Kudos
Kro77
Contributor
Contributor

I think I mis-spoke, since I was trying to validate the original post stating do a chkconfig on the agent.rc file. Basically i am still new to linux and have gotten the chkconfig stuff but am unsure as to what to do here. Could i do the @reboot in the cron file?
0 Kudos