cdp-agent not running and also not starting when try to manually start it.

Error:

root@ [~]# /etc/init.d/cdp-agent status
/etc/init.d/cdp-agent status: cdp (pid 753?) not running

You can grab the error generating from the r1soft log
(/usr/sbin/r1soft/log/cdp.log), there you can find the exact reason.

The error would be like as follows:
============
,[ERROR],[NO-CONNECTION],Exception from network
server: Address already in use
============

This happens when port 1167 is on use. The issue can be sorted out by using the following steps.

If your Agent hangs up and is not restarting properly,
check Agent port is used by hcp demon

lsof -i :1167 #1167 default agent port

~]# lsof -i :1167
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
hcp_io/1/ 2250 root 8u IPv4 191316993 TCP *:1167 (LISTEN)
hcp_io/1/ 2256 root 8u IPv4 191316993 TCP *:1167 (LISTEN)
hcp_io/1/ 2257 root 8u IPv4 191316993 TCP *:1167 (LISTEN)
hcp_io/1/ 2258 root 8u IPv4 191316993 TCP *:1167 (LISTEN)

you see that hcp working so , you must stop hcp activity :

hcp -r /dev/hcp1 (/dev/hcp1 : example)

now ! you can restart agent easily :
/etc/init.d/cdp-agent restart

check the status now

# /etc/init.d/cdp-agent status
/etc/init.d/cdp-agent status: cdp (pid 10238) running

Simple 🙂

2 thoughts on “cdp-agent not running and also not starting when try to manually start it.”

Leave a Reply

Your email address will not be published. Required fields are marked *