NCPA agent detected another listener running

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
stepchi
Posts: 1
Joined: Mon Mar 02, 2020 2:54 pm

NCPA agent detected another listener running

Post by stepchi »

Our NCPA agent running on Ubuntu 16.04 showed an "Active (exited)" status when checking with "systemctl status ncpa_listener". When we looked back in the syslog we saw the following:
Nov 2 08:51:34 pxxxx ncpa_listener[3178]: Started NCPA Listener
...
Nov 2 09:20:00 pxxxx systemd[1]: Started LSB: This manages the NCPA Passive service.
Nov 2 09:20:00 pxxxx ncpa_listener[3234]: another instance seems to be running (pid 3290), exiting

We'd like to know how NCPA finds out whether there's an instance already running.

Thanks,
Steve
User avatar
kfanselow
Posts: 254
Joined: Tue Aug 31, 2021 3:25 pm

Re: NCPA agent detected another listener running

Post by kfanselow »

Hi Steve,

NCPA looks for another running instance by locating and validating the contents of the process identification (pid) file:

Code: Select all

/usr/local/ncpa/var/run/ncpa_listener.pid
/usr/local/ncpa/var/run/ncpa_passive.pid
The routine for the listener can be found here (check_pid function starts on line 320):

https://github.com/NagiosEnterprises/nc ... adaemon.py


Thanks and Best Regards,
Keith
Locked