Troubleshoot agent on CentOS6
Learn how to solve problems on CentOS6
The installation of the agent run flawlessly using the RPM package which is suitable for CentOS/Rehl 6 and 7. But the agent might not start after the installation. CentOS and Rhel6 use both upstart and sysvinit Verify by executing rpm -qa|grep upstart If upstart has been detected during the installation of cagent, a file /etc/init/cagent.conf has been created. The command initctl list should confirm, that cagent has been registered as an upstart service. Try initctl start cagent to start the agent.

Switching to sysvinit

If the above hints don't help, try to switch back to a traditional sysvinit start-stop-script. Delete the upstart script and reload upstart.
rm /etc/init/cagent.conf initctl reload-configuration
Create the start-stop-script in /etc/init.d/cagent
/etc/init.d/cagent
1
#! /bin/sh
2
#
3
# cagent Start/Stop cagent daemon
4
#
5
# chkconfig: 345 30 30
6
# description: cloudradar monitoring agent daemon
7
# processname: cagent
8
9
# Source function library.
10
. /etc/init.d/functions
11
12
# Check that we're a privileged user
13
[ `id -u` = 0 ] || exit 4
14
15
prog="cagent"
16
17
18
RETVAL=0
19
lockfile=/var/lock/subsys/$prog
20
cd /tmp
21
22
start() {
23
24
# Check if binary is installed & executable
25
[ -f /usr/bin/$prog ] && [ -x /usr/bin/$prog ] || exit 5
26
27
echo -n $"Starting $prog: "
28
ARGS="-d -c /etc/cagent/cagent.conf"
29
30
daemon --user=cagent /usr/bin/$prog $ARGS
31
RETVAL=$?
32
echo
33
[ $RETVAL -eq 0 ] && touch $lockfile
34
return $RETVAL
35
}
36
37
stop() {
38
echo -n $"Stopping $prog: "
39
killproc $prog
40
RETVAL=$?
41
echo
42
[ $RETVAL -eq 0 ] && rm -f $lockfile
43
return $RETVAL
44
}
45
46
restart() {
47
stop
48
start
49
}
50
51
# See how we were called.
52
case "$1" in
53
start)
54
start
55
;;
56
stop)
57
stop
58
;;
59
status)
60
status $prog
61
;;
62
restart)
63
restart
64
;;
65
*)
66
echo $"Usage: $0 {start|stop|status|restart}"
67
exit 2
68
esac
69
70
exit $?
71
Copied!
Finally, execute chkconfig cagent on to start cagent automatically on boot.
Last modified 2yr ago
Copy link