check_ncpa.py broken on Centos 7 epel repo install FIXED
Posted: Sat Aug 10, 2019 4:01 pm
NOTE: I have this working on a separate Centos 7 minimal install but I installed nagios from source so something is not the same when installing as below:
Fresh minimal Centos install (with developer tools and sysadmin tools installation options ticked)
yum install epel-release
yum install nagios nagios-plugins-all
systemctl start nagios.service
systemctl start httpd.service
systemctl enable nagios
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
Logged in to nagios web page successfully and confirmed localhost checks were working and returning OK.
[root@nagios-yum tmp]# whereis nagios
nagios: /usr/sbin/nagios /usr/lib64/nagios /etc/nagios /usr/share/nagios
Nagios Plugins Folder:
/usr/lib64/nagios/plugins
Tested ./check_ups --help and this worked as expected.
wget https://assets.nagios.com/downloads/ncp ... cpa.tar.gz
tar zxf check_ncpa.tar.gz
chown nagios:nagios check_ncpa.py
chmod 775 check_ncpa.py
cp check_ncpa.py /usr/lib64/nagios/plugins
cd /usr/lib64/nagios/plugins
./check_ncpa.py -V
: No such file or directory
[root@nagios-yum plugins]# python
Python 2.7.5 (default, Jun 20 2019, 20:27:34)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
[root@nagios-yum plugins]# which python
/usr/bin/python
[root@nagios-yum plugins]# whereis python
python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/share/man/man1/python.1.gz
Modified shebang in check_ncpa.py to #!/usr/bin python
[root@nagios-yum plugins]# ./check_ncpa.py -V
-bash: ./check_ncpa.py: /usr/bin: bad interpreter: Permission denied
I noticed that all other plugins have 3 whereas check_ncpa.py has 10:
ls -al /usr/lib64/nagios/plugins
-rwxr-xr-x. 1 nagios nagios 49664 Jan 3 2019 check_mrtgtraf
-rwxr-xr-x. 1 nagios nagios 62528 Jan 3 2019 check_mysql
-rwxr-xr-x. 1 nagios nagios 58208 Jan 3 2019 check_mysql_query
-rwxr-xr-x. 1 nagios nagios 53768 Jan 3 2019 check_nagios
-rwxr-xr-x. 1 nagios nagios 10563 Aug 10 21:41 check_ncpa.py
lrwxrwxrwx. 1 nagios nagios 9 Aug 10 21:29 check_nntp -> check_tcp
lrwxrwxrwx. 1 nagios nagios 9 Aug 10 21:29 check_nntps -> check_tcp
-rwxr-xr-x. 1 nagios nagios 66336 Jan 3 2019 check_nt
-rwxr-xr-x. 1 nagios nagios 14360 Jan 3 2019 check_ntp
-rwxr-xr-x. 1 nagios nagios 62536 Jan 3 2019 check_ntp_peer
-rwxr-xr-x. 1 nagios nagios 14360 Jan 3 2019 check_ntp.pl
Am i missing something?? Is anyone able to help me get the check_ncpa.py plugin working??
Thanks in advance.
Fresh minimal Centos install (with developer tools and sysadmin tools installation options ticked)
yum install epel-release
yum install nagios nagios-plugins-all
systemctl start nagios.service
systemctl start httpd.service
systemctl enable nagios
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
Logged in to nagios web page successfully and confirmed localhost checks were working and returning OK.
[root@nagios-yum tmp]# whereis nagios
nagios: /usr/sbin/nagios /usr/lib64/nagios /etc/nagios /usr/share/nagios
Nagios Plugins Folder:
/usr/lib64/nagios/plugins
Tested ./check_ups --help and this worked as expected.
wget https://assets.nagios.com/downloads/ncp ... cpa.tar.gz
tar zxf check_ncpa.tar.gz
chown nagios:nagios check_ncpa.py
chmod 775 check_ncpa.py
cp check_ncpa.py /usr/lib64/nagios/plugins
cd /usr/lib64/nagios/plugins
./check_ncpa.py -V
: No such file or directory
[root@nagios-yum plugins]# python
Python 2.7.5 (default, Jun 20 2019, 20:27:34)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
[root@nagios-yum plugins]# which python
/usr/bin/python
[root@nagios-yum plugins]# whereis python
python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/share/man/man1/python.1.gz
Modified shebang in check_ncpa.py to #!/usr/bin python
[root@nagios-yum plugins]# ./check_ncpa.py -V
-bash: ./check_ncpa.py: /usr/bin: bad interpreter: Permission denied
I noticed that all other plugins have 3 whereas check_ncpa.py has 10:
ls -al /usr/lib64/nagios/plugins
-rwxr-xr-x. 1 nagios nagios 49664 Jan 3 2019 check_mrtgtraf
-rwxr-xr-x. 1 nagios nagios 62528 Jan 3 2019 check_mysql
-rwxr-xr-x. 1 nagios nagios 58208 Jan 3 2019 check_mysql_query
-rwxr-xr-x. 1 nagios nagios 53768 Jan 3 2019 check_nagios
-rwxr-xr-x. 1 nagios nagios 10563 Aug 10 21:41 check_ncpa.py
lrwxrwxrwx. 1 nagios nagios 9 Aug 10 21:29 check_nntp -> check_tcp
lrwxrwxrwx. 1 nagios nagios 9 Aug 10 21:29 check_nntps -> check_tcp
-rwxr-xr-x. 1 nagios nagios 66336 Jan 3 2019 check_nt
-rwxr-xr-x. 1 nagios nagios 14360 Jan 3 2019 check_ntp
-rwxr-xr-x. 1 nagios nagios 62536 Jan 3 2019 check_ntp_peer
-rwxr-xr-x. 1 nagios nagios 14360 Jan 3 2019 check_ntp.pl
Am i missing something?? Is anyone able to help me get the check_ncpa.py plugin working??
Thanks in advance.