./check_ncpa.py: No such file or directory

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
psbeach
Posts: 2
Joined: Tue May 19, 2015 7:57 pm

./check_ncpa.py: No such file or directory

Post 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]#
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: ./check_ncpa.py: No such file or directory

Post 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
psbeach
Posts: 2
Joined: Tue May 19, 2015 7:57 pm

Re: ./check_ncpa.py: No such file or directory

Post by psbeach »

Thank you very much for the help. That fixed it.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: ./check_ncpa.py: No such file or directory

Post by tmcdonald »

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked