Nach der Installation des Hyperic Agents auf SUSE fehlt leider ein Skript in /etc/init.d, welches das automatische Starten des hq-agents übernehmen würde.
Hier ist eine ganz einfache Variante, die hoffentlich SUSE-konform die Steuerung mit chkconfig erlaubt:
#!/bin/bash
# chkconfig: - 99 01
# description: Start hyperic monitoring agent (installed in /opt/hyperic) and running as hyperix user
# processname: hq-agent
# Required-Start:
# Required-Stop:
start(){
echo "Starting hq-agent.."
su -l hyperic -c ' /opt/hyperic/agent-5.7.0-EE/bin/hq-agent.sh start'
}
stop(){
echo "Stopping hq-agent.."
su -l hyperic -c ' /opt/hyperic/agent-5.7.0-EE/bin/hq-agent.sh stop'
}
status(){
echo "Querying status of hq-agent.."
su -l hyperic -c ' /opt/hyperic/agent-5.7.0-EE/bin/hq-agent.sh status'
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "Usage: hq-agent {start|stop|restart|status}"
exit 1
esac
exit 0
Dieses Skript sollte unter /etc/init.d liegen, ausführbar sein und root gehören. Der Installationspfad sollte angepasst werden. Wenn alles klappt kann man mit
chkconfig hq-agent on
den hyperic agent startfähig nach dem Reboot machen. Getestet auf SLES 11.
