Page 1 of 2

Nagios core plugin issue

Posted: Wed Jul 19, 2017 10:18 am
by tpa
Hello,

I was able to setup nagios core 4 on centos 7.
My problem is with check_ping plugin, it cannot run, I get "no such file or directory"
Adding any host to check, I get "down" status.

I tried several things that I read on other users posts without success.

I tried "ls -la /usr/local/nagios/libexec" and the files are there.

Code: Select all

total 6348
drwxrwxr-x. 3 nagios nagios   4096 Jul 19 11:35 .
drwxr-xr-x. 9 root   root       94 Jul 19 11:35 ..
-rwxr-xr-x. 1 nagios nagios 210424 Jul 19 11:35 check_apt
-rwxr-xr-x. 1 nagios nagios   2346 Jul 19 11:35 check_breeze
-rwxr-xr-x. 1 nagios nagios 214448 Jul 19 11:35 check_by_ssh
lrwxrwxrwx. 1 root   root        9 Jul 19 11:35 check_clamd -> check_tcp
-rwxr-xr-x. 1 nagios nagios 162792 Jul 19 11:35 check_cluster
-r-sr-xr-x. 1 root   nagios 211288 Jul 19 11:35 check_dhcp
-rwxr-xr-x. 1 nagios nagios 227136 Jul 19 11:35 check_disk
-rwxr-xr-x. 1 nagios nagios   9469 Jul 19 11:35 check_disk_smb
-rwxr-xr-x. 1 nagios nagios 126832 Jul 19 11:35 check_dummy
-rwxr-xr-x. 1 nagios nagios   3860 Jul 19 11:35 check_file_age
-rwxr-xr-x. 1 nagios nagios   6504 Jul 19 11:35 check_flexlm
lrwxrwxrwx. 1 root   root        9 Jul 19 11:35 check_ftp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 310552 Jul 19 11:35 check_http
-r-sr-xr-x. 1 root   nagios 226976 Jul 19 11:35 check_icmp
-rwxr-xr-x. 1 nagios nagios 169664 Jul 19 11:35 check_ide_smart
-rwxr-xr-x. 1 nagios nagios  15275 Jul 19 11:35 check_ifoperstatus
-rwxr-xr-x. 1 nagios nagios  13423 Jul 19 11:35 check_ifstatus
lrwxrwxrwx. 1 root   root        9 Jul 19 11:35 check_imap -> check_tcp
-rwxr-xr-x. 1 nagios nagios   6984 Jul 19 11:35 check_ircd
-rwxr-xr-x. 1 nagios nagios 187448 Jul 19 11:35 check_load
-rwxr-xr-x. 1 nagios nagios   6669 Jul 19 11:35 check_log
-rwxr-xr-x. 1 nagios nagios  22733 Jul 19 11:35 check_mailq
-rwxr-xr-x. 1 nagios nagios 172992 Jul 19 11:35 check_mrtg
-rwxr-xr-x. 1 nagios nagios 170216 Jul 19 11:35 check_mrtgtraf
-rwxr-xr-x. 1 nagios nagios 186576 Jul 19 11:35 check_nagios
lrwxrwxrwx. 1 root   root        9 Jul 19 11:35 check_nntp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 219616 Jul 19 11:35 check_nt
-rwxr-xr-x. 1 nagios nagios 218272 Jul 19 11:35 check_ntp
-rwxr-xr-x. 1 nagios nagios 208008 Jul 19 11:35 check_ntp_peer
-rwxr-xr-x. 1 nagios nagios 202904 Jul 19 11:35 check_ntp_time
-rwxr-xr-x. 1 nagios nagios 249960 Jul 19 11:35 check_nwstat
-rwxr-xr-x. 1 nagios nagios   9457 Jul 19 11:35 check_oracle
-rwxr-xr-x. 1 nagios nagios 192848 Jul 19 11:35 check_overcr
-rwxr-xr-x. 1 nagios nagios 223072 Jul 19 11:35 check_ping
lrwxrwxrwx. 1 root   root        9 Jul 19 11:35 check_pop -> check_tcp
-rwxr-xr-x. 1 nagios nagios 223952 Jul 19 11:35 check_procs
-rwxr-xr-x. 1 nagios nagios 185384 Jul 19 11:35 check_real
-rwxr-xr-x. 1 nagios nagios   9679 Jul 19 11:35 check_rpc
-rwxr-xr-x. 1 nagios nagios   1533 Jul 19 11:35 check_sensors
-rwxr-xr-x. 1 nagios nagios 216680 Jul 19 11:35 check_smtp
-rwxr-xr-x. 1 nagios nagios 185008 Jul 19 11:35 check_ssh
-rwxr-xr-x. 1 nagios nagios 166592 Jul 19 11:35 check_swap
-rwxr-xr-x. 1 nagios nagios 205336 Jul 19 11:35 check_tcp
-rwxr-xr-x. 1 nagios nagios 186760 Jul 19 11:35 check_time
lrwxrwxrwx. 1 root   root        9 Jul 19 11:35 check_udp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 199248 Jul 19 11:35 check_ups
-rwxr-xr-x. 1 nagios nagios 163072 Jul 19 11:35 check_uptime
-rwxr-xr-x. 1 nagios nagios 157440 Jul 19 11:35 check_users
-rwxr-xr-x. 1 nagios nagios   3032 Jul 19 11:35 check_wave
drwxr-xr-x. 4 nagios nagios    221 Jul 19 11:21 eventhandlers
-rwxr-xr-x. 1 nagios nagios 157512 Jul 19 11:35 negate
-rwxr-xr-x. 1 nagios nagios 151032 Jul 19 11:35 urlize
-rwxr-xr-x. 1 nagios nagios   1914 Jul 19 11:35 utils.pm
-rwxr-xr-x. 1 nagios nagios   2791 Jul 19 11:35 utils.sh
Thanks in advance!!

Re: Nagios core plugin issue

Posted: Wed Jul 19, 2017 10:24 am
by tmcdonald
Are you able to run the plugin directly? What happens if you run /usr/local/nagios/libexec/check_ping? What is the output of file /usr/local/nagios/libexec/check_ping. Did you compile the plugins manually, install from a repo, or copy them from another machine?

Re: Nagios core plugin issue

Posted: Wed Jul 19, 2017 10:53 am
by tpa
Hello,

Both tests seems to be ok

Code: Select all

[root@localhost objects]# file /usr/local/nagios/libexec/check_ping
/usr/local/nagios/libexec/check_ping: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=28b261b1ef42f0c2a362371543f9c7a436993524, not stripped

Code: Select all

[root@localhost objects]# /usr/local/nagios/libexec/check_ping
check_ping: Could not parse arguments
Usage:
check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%
 [-p packets] [-t timeout] [-4|-6]
I installed plugins following intructions from "https://assets.nagios.com/downloads/nag ... Source.pdf"

Re: Nagios core plugin issue

Posted: Wed Jul 19, 2017 2:00 pm
by bolson
Hello tpa,

From the command line run /usr/local/libexec/check_ping -H localhost -w 1,20% -c 10,40%

And post the result

Re: Nagios core plugin issue

Posted: Wed Jul 19, 2017 2:07 pm
by tpa
bolson wrote:Hello tpa,

From the command line run /usr/local/libexec/check_ping -H localhost -w 1,20% -c 10,40%

And post the result
Hello,
[root@localhost libexec]# /usr/local/libexec/check_ping -H localhost -w 1,20% -c 10,40%
-bash: /usr/local/libexec/check_ping: No such file or directory
:cry:

Re: Nagios core plugin issue

Posted: Wed Jul 19, 2017 2:15 pm
by bolson

Code: Select all

from the command line: which ping
and post the result.

Re: Nagios core plugin issue

Posted: Wed Jul 19, 2017 2:16 pm
by bolson
also,

Code: Select all

env | grep PATH
and post the result

Re: Nagios core plugin issue

Posted: Wed Jul 19, 2017 2:30 pm
by tpa
bolson wrote:

Code: Select all

from the command line: which ping
and post the result.
Results:
[root@localhost libexec]# which ping
/usr/bin/ping
[root@localhost libexec]# env | grep PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

Re: Nagios core plugin issue

Posted: Wed Jul 19, 2017 2:50 pm
by bolson
From the command line:

Code: Select all

/usr/local/nagios/libexec/check_ping -H localhost -w 1,20% -c 10,40%
sestatus
ls -l /usr/bin/ping
And post the results. Thank you!

Re: Nagios core plugin issue

Posted: Thu Jul 20, 2017 7:05 pm
by tpa
bolson wrote:From the command line:

Code: Select all

/usr/local/nagios/libexec/check_ping -H localhost -w 1,20% -c 10,40%
sestatus
ls -l /usr/bin/ping
And post the results. Thank you!
Hello!
[root@localhost objects]# /usr/local/nagios/libexec/check_ping -H localhost -w 1,20% -c 10,40%
PING OK - Packet loss = 0%, RTA = 0.10 ms|rta=0.102000ms;1.000000;10.000000;0.000000 pl=0%;20;40;0
[root@localhost objects]# sestatus
SELinux status: disabled
[root@localhost objects]# ls -l /usr/bin/ping
-rwxr-xr-x. 1 root root 62088 Nov 7 2016 /usr/bin/ping