Page 1 of 1
./check_ncpa.py: No such file or directory
Posted: Wed Jun 03, 2015 9:09 pm
by psbeach
I get the error message, ./check_ncpa.py: No such file or directory, when I try and restart the ncpa listener. I get data and graphs are working but I can restart the ncpa listening service.
OS CentOS 7, Nagios Core 4.
[root@nagtest objects]# /etc/init.d/ncpa_listener restart
-bash: /etc/init.d/ncpa_listener: No such file or directory
[root@nagtest objects]#
Re: ./check_ncpa.py: No such file or directory
Posted: Thu Jun 04, 2015 9:21 am
by jdalrymple
Maybe you're missing your restart script?
Code: Select all
[jdalrymple@localhost ~]$ /etc/init.d/
ajaxterm iprupdate ncpa_listener netconsole
iprdump nagios ncpa_passive network
iprinit nagiosxi ndo2db npcd
[jdalrymple@localhost ~]$ sudo /etc/init.d/ncpa_listener status
Process running with PID 95590
[jdalrymple@localhost ~]$ sudo /etc/init.d/ncpa_listener restart
Exited.
Started listener...
[jdalrymple@localhost ~]$ sudo /etc/init.d/ncpa_listener status
Process running with PID 95973
It might be advisable to just reinstall the pacckage.
Alternatively, if you want to just recreate the startup script - this is the contents:
ncpa_listner:
Code: Select all
#!/bin/bash
### BEGIN INIT INFO
# Provides: ncpa_listener
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Enable NCPA listener.
### END INIT INFO
BASEDIR="/usr/local/ncpa"
start() {
(
cd $BASEDIR
./ncpa_posix_listener --start
)
echo "Started listener..."
}
# Restart the service
stop() {
(
cd $BASEDIR
./ncpa_posix_listener --stop
echo "Exited."
)
}
# Get the status
status() {
if [ -f "/usr/local/ncpa/var/ncpa_listener.pid" ];
then
pid=`cat /usr/local/ncpa/var/ncpa_listener.pid`
echo "Process running with PID $pid"
else
echo "Process is not running."
fi
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
Re: ./check_ncpa.py: No such file or directory
Posted: Thu Jun 04, 2015 2:58 pm
by psbeach
Thank you very much for the help. That fixed it.
Re: ./check_ncpa.py: No such file or directory
Posted: Thu Jun 04, 2015 2:59 pm
by tmcdonald
I'll be closing this thread now, but feel free to open another if you need anything in the future!