NRPE: Command 'check_channels' not defined and NRPE: Command

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
katya
Posts: 224
Joined: Mon Aug 18, 2014 9:07 am

NRPE: Command 'check_channels' not defined and NRPE: Command

Post by katya »

Hi Team,
form some reason on my solaris(unix) remote host i got only on 2 services configured: NRPE: Command 'check_channels' not defined and NRPE: Command 'check_jmxmemory' not defined

on my remote host it configured on nrpe.cfg file:
command[check_jmxmemory]=/usr/local/nagios/libexec/nagios-jmx-plugin-1.2.3/check_jmx -U service:jmx:rmi:///jndi/rmi://10.146.2.38:7780/jmxrmi -O jboss.system:type=ServerInfo -A TotalMemory -w 3247300864 -c 3251495168
command[check_channels]=/usr/local/nagios/libexec/nagios-jmx-plugin-1.2.3/check_jmx -U service:jmx:rmi:///jndi/rmi://10.146.2.38:7780/jmxrmi -O echos.service:name=T.Q1.EBAM3.IN,type=service -A Status -
c "^Started.*|Disabled.*"

and on my Ngaios server itself i have it also in services.cfg file:
define service{
use generic-service
host_name ssbtech01
service_description JMX Memory
check_command check_nrpe!check_jmxmemory
check_interval 1
}
define service{
use generic-service
host_name ssbtech01
service_description Communication Services
check_command check_nrpe!check_channels
check_interval 1
}

so can you please assist why i got this error?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NRPE: Command 'check_channels' not defined and NRPE: Com

Post by rkennedy »

Did you restart the NRPE service on the local machine after adding in the configuration changes? It should be working at this point.

From the solaris machine, what is the output of netstat -nap? I'd like to see what's listening on 5666 or the NRPE port, so we can determine how it's running. Also, please show us the full output of ps -ef.

Lastly, on the Nagios machine, can you show us how the check_nrpe command is defined?

To take Nagios out of the equation, do you receive the same error if you run the check over the CLI? /usr/local/nagios/libexec/check_nrpe -H ip.of.solaris.machine -c check_jmxmemory
Former Nagios Employee
katya
Posts: 224
Joined: Mon Aug 18, 2014 9:07 am

Re: NRPE: Command 'check_channels' not defined and NRPE: Com

Post by katya »

On the remote host:
==================
root@ssbtEch01:/usr/local/nagios/libexec# netstat -nap
Net to Media Table: IPv4
Device IP Address Mask Flags Phys Addr
------ -------------------- --------------- -------- ---------------
vnet0 224.0.0.22 255.255.255.255 01:00:5e:00:00:16
vnet0 10.146.2.31 255.255.255.255 o 00:14:4f:f9:fb:e7
vnet0 10.146.2.13 255.255.255.255 o 00:14:4f:fa:0a:85
vnet0 10.146.2.1 255.255.255.255 o 00:10:db:ff:20:60
vnet0 10.146.2.122 255.255.255.255 o 00:14:4f:f9:e2:da
vnet0 10.146.2.121 255.255.255.255 o 00:14:4f:f8:d0:3c
vnet0 10.146.2.22 255.255.255.255 o 00:14:4f:f9:e2:da
vnet0 10.146.2.21 255.255.255.255 o 00:14:4f:f8:d0:3c
vnet1 10.127.7.233 255.255.255.255 SPLA 00:14:4f:fb:80:33
vnet0 10.146.2.40 255.255.255.255 o 00:14:4f:f9:e2:da
vnet1 10.127.63.246 255.255.255.255 18:ef:63:e9:9b:c2
vnet0 10.146.2.38 255.255.255.255 SPLA 00:14:4f:fb:21:f6
vnet0 10.146.2.37 255.255.255.255 o 00:14:4f:f8:41:e4
vnet1 10.127.63.245 255.255.255.255 o 00:00:0c:07:ac:7f
vnet1 224.0.0.0 240.0.0.0 SM 01:00:5e:00:00:00
vnet0 224.0.0.0 240.0.0.0 SM 01:00:5e:00:00:00


root@ssbtEch01:/usr/local/nagios/libexec# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 0 0 0 Feb 04 ? 0:52 sched
root 5 0 0 Feb 04 ? 14:15 zpool-rpool_ech01
root 6 0 0 Feb 04 ? 0:05 kmem_task
root 1 0 0 Feb 04 ? 1:35 /sbin/init
root 2 0 0 Feb 04 ? 0:00 pageout
root 3 0 0 Feb 04 ? 64:17 fsflush
root 7 0 0 Feb 04 ? 11:51 vmtasks
root 97 0 0 Feb 04 ? 0:01 zpool-LOGS
root 11 1 0 Feb 04 ? 0:17 /lib/svc/bin/svc.startd
root 13 1 0 Feb 04 ? 0:47 /lib/svc/bin/svc.configd
root 288 1 0 Feb 04 ? 0:00 /usr/lib/efcode/sparcv9/efdaemon
root 99 0 0 Feb 04 ? 0:04 zpool-ech01_Jailed
root 107 0 0 Feb 04 ? 0:00 zpool-swap_tech01
root 103 0 0 Feb 04 ? 6:31 zpool-ech01_echos
root 101 0 0 Feb 04 ? 7:53 zpool-ech01_amh
root 105 1 0 Feb 04 ? 0:12 devfsadmd
daemon 382 1 0 Feb 04 ? 0:00 /usr/lib/nfs/lockd
root 322 1 0 Feb 04 ? 0:00 /usr/lib/netsvc/yp/ypbind
root 212 1 0 Feb 04 ? 0:00 /usr/lib/ldoms/ldmad
daemon 314 1 0 Feb 04 ? 0:00 /usr/sbin/rpcbind
root 161 1 0 Feb 04 ? 0:00 /usr/lib/ldoms/drd
daemon 167 1 0 Feb 04 ? 0:00 /usr/lib/crypto/kcfd
daemon 366 1 0 Feb 04 ? 0:00 /usr/lib/nfs/statd
root 421 1 0 Feb 04 ? 0:09 /usr/lib/utmpd
daemon 332 1 0 Feb 04 ? 0:01 /usr/lib/nfs/nfsmapid
root 319 1 0 Feb 04 ? 0:00 /usr/sbin/keyserv
root 244 1 0 Feb 04 ? 0:14 /usr/lib/picl/picld
root 427 11 0 Feb 04 console 0:00 /usr/lib/saf/ttymon -g -d /dev/console -l console -T vt100 -m ldterm,ttcompat -
root 409 1 0 Feb 04 ? 0:08 /usr/lib/inet/inetd start
root 425 424 0 Feb 04 ? 0:00 /usr/sadm/lib/smc/bin/smcboot
root 182 1 0 Feb 04 ? 0:00 /usr/lib/sysevent/syseventd
root 376 1 0 Feb 04 ? 0:28 /usr/sbin/cron
root 349 1 0 Feb 04 ? 0:53 /usr/lib/inet/xntpd
root 413 405 0 Feb 04 ? 0:00 /usr/lib/saf/ttymon
root 197 1 0 Feb 04 ? 8:21 /usr/sbin/nscd
smmsp 572 1 0 Feb 04 ? 0:02 /usr/lib/sendmail -Ac -q15m
root 343 1 0 Feb 04 ? 0:00 /lib/svc/method/iscsi-initiator
daemon 333 1 0 Feb 04 ? 0:01 /usr/lib/nfs/nfs4cbd
root 405 11 0 Feb 04 ? 0:00 /usr/lib/saf/sac -t 300
root 426 424 0 Feb 04 ? 0:00 /usr/sadm/lib/smc/bin/smcboot
root 424 1 0 Feb 04 ? 0:00 /usr/sadm/lib/smc/bin/smcboot
root 512 1 0 Feb 04 ? 0:02 /usr/sbin/vold -f /etc/vold.conf
root 457 1 0 Feb 04 ? 0:27 /opt/puppet/bin/ruby /opt/puppet/sbin/mcollectived --pid=/var/run/pe-mcollectiv
et1 12922 1 0 Feb 04 ? 10:48 /apps/echos/et1/echos/bin/service/bin/./wrapper /apps/echos/et1/echos/bin/servi
root 508 1 0 Feb 04 ? 0:00 /usr/lib/autofs/automountd
root 509 508 0 Feb 04 ? 0:48 /usr/lib/autofs/automountd
root 624 1 0 Feb 04 ? 0:00 /usr/lib/dmi/snmpXdmid -s ssbtEch01
root 539 1 0 Feb 04 ? 1:16 /usr/local/sbin/sshd
root 623 1 0 Feb 04 ? 0:00 /usr/lib/dmi/dmispd
root 540 1 0 Feb 04 ? 0:15 /usr/sbin/syslogd
root 576 1 0 Feb 04 ? 0:16 /usr/lib/sendmail -bl -q15m
root 22796 22793 0 09:07:04 pts/4 0:00 /usr/sbin/quota
root 639 1 0 Feb 04 ? 7:35 /usr/perl5/bin/perl /usr/sfw/lib/webmin/miniserv.pl /etc/webmin/miniserv.conf
echmon 22333 22326 0 09:05:03 pts/2 0:00 bash
root 593 1 0 Feb 04 ? 6:37 /usr/sfw/sbin/snmpd
root 1035 1034 0 Feb 04 ? 0:24 /opt/simpana/Base/cvfwd
root 590 1 0 Feb 04 ? 0:15 /usr/lib/fm/fmd/fmd
root 591 1 0 Feb 04 ? 0:00 /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
katya.ai 6011 6007 0 04:46:04 pts/3 0:00 -bash
root 603 1 0 Feb 04 ? 53:54 /opt/BESClient/bin/BESClient
root 1034 1 0 Feb 04 ? 0:00 /opt/simpana/Base/cvfwd
root 659 658 0 Feb 04 ? 3:43 /opt/opsware/agent/bin/python /opt/opsware/agent/pylibs/shadowbot/daemonbot.pyc
root 658 1 0 Feb 04 ? 0:00 /opt/opsware/agent/bin/python /opt/opsware/agent/pylibs/shadowbot/daemonbot.pyc
et1 12925 12922 0 Feb 04 ? 1705:57 /usr/java7u85/jdk1.7.0_85/bin/sparcv9/java -Dinst=et1 -server -Djava.endorsed.d
noaccess 1173 1 0 Feb 04 ? 12:09 /usr/java/bin/java -server -Xmx128m -XX:+UseParallelGC -XX:ParallelGCThreads=4
root 5971 539 0 04:46:02 ? 0:00 /usr/local/sbin/sshd -R
root 1031 1 0 Feb 04 ? 0:05 /opt/simpana/Base/cvlaunchd
root 1082 1 0 Feb 04 ? 0:30 /opt/simpana/Base/EvMgrC
root 746 1 0 Feb 04 ? 0:00 /usr/dt/bin/dtlogin -daemon
root 1088 1 0 Feb 04 ? 1:10 /opt/simpana/Base/cvd
at1 776 773 0 Feb 04 ? 612:33 /usr/java7/jdk1.7.0_75/bin/sparcv9/java -Dinst=at1tst -server -Djava.endorsed.d
echmon 22794 22788 0 09:07:04 pts/5 0:00 bash
echmon 22793 22323 0 09:07:04 pts/4 0:00 -bash
root 22795 8039 0 09:07:04 pts/3 0:00 ps -ef
et1 12823 1 0 Feb 04 ? 10:27 /apps/echos/et1/echos/bin/service/bin/./wrapper /apps/echos/et1/echos/bin/servi
root 6240 6237 0 04:47:23 pts/1 0:00 bash
at1 773 1 0 Feb 04 ? 10:34 /apps/amh/at1/amh/bin/service/bin/./wrapper /apps/amh/at1/amh/bin/service/bin/.
echmon 22788 22323 0 09:07:04 pts/5 0:00 -bash
nagios 2372 1 0 Feb 06 ? 1:14 /opt/nagios/bin/nrpe -c /etc/nagios/nrpe.cfg -d
et1 12826 12823 0 Feb 04 ? 77:05 /usr/java7u85/jdk1.7.0_85/bin/sparcv9/java -Daggregator -server -Xms1024m -Xmx1
root 6237 6233 0 04:47:21 pts/1 0:00 sudo su -
root 6229 539 0 04:47:16 ? 0:00 /usr/local/sbin/sshd -R
root 8039 8038 0 04:57:18 pts/3 0:00 bash
echmon 22324 22323 0 09:05:02 ? 0:00 /usr/local/sbin/sshd -R
echmon 22326 22323 0 09:05:03 pts/2 0:00 -bash
root 22306 539 0 09:05:00 ? 0:00 /usr/local/sbin/sshd -R
katya.ai 6233 6231 0 04:47:18 pts/1 0:00 -bash
katya.ai 6007 5971 0 04:46:04 ? 0:03 /usr/local/sbin/sshd -R
echmon 22323 22306 0 09:05:02 ? 0:01 /usr/local/sbin/sshd -R
katya.ai 6231 6229 0 04:47:17 ? 0:02 /usr/local/sbin/sshd -R
root 8038 6011 0 04:57:16 pts/3 0:00 sudo su -

on the Nagios server:
==================
-bash-4.1# ls -la check_nrpe
-rwxrwxr-x. 1 nagios nagios 75453 Oct 23 2014 check_nrpe
-bash-4.1# pwd
/usr/local/nagios/libexec

-bash-4.1# ./check_nrpe
Incorrect command line arguments supplied

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.15
Last Modified: 09-06-2013
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required

Usage: check_nrpe -H <host> [ -b <bindaddr> ] [-4] [-6] [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]

Options:
-n = Do no use SSL
-u = Make socket timeouts return an UNKNOWN state instead of CRITICAL
<host> = The address of the host running the NRPE daemon
<bindaddr> = bind to local address
-4 = user ipv4 only
-6 = user ipv6 only
[port] = The port on which the daemon is running (default=5666)
[timeout] = Number of seconds before connection times out (default=10)
[command] = The name of the command that the remote daemon should run
[arglist] = Optional arguments that should be passed to the command. Multiple
arguments should be separated by a space. If provided, this must be
the last option supplied on the command line.

Note:
This plugin requires that you have the NRPE daemon running on the remote host.
You must also have configured the daemon to associate a specific plugin command
with the [command] option you are specifying here. Upon receipt of the
[command] argument, the NRPE daemon will run the appropriate plugin command and
send the plugin output and return code back to *this* plugin. This allows you
to execute plugins on remote hosts and 'fake' the results to make Nagios think
the plugin is being run locally.

from the remote host:
===================
root@ssbtEch01:/usr/local/nagios/libexec# /usr/local/nagios/libexec/check_nrpe -H 10.146.2.38 -c check_jmxmemory
CHECK_NRPE: Error - Could not complete SSL handshake.

from:nagios server:
===================
-bash-4.1# /usr//local/nagios/libexec/check_nrpe -H 10.146.2.38 -c check_jmxmemory
NRPE: Command 'check_jmxmemory' not defined
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NRPE: Command 'check_channels' not defined and NRPE: Com

Post by rkennedy »

Got it.
katya wrote:On the remote host:
nagios 2372 1 0 Feb 06 ? 1:14 /opt/nagios/bin/nrpe -c /etc/nagios/nrpe.cfg -d

from the remote host:
===================
root@ssbtEch01:/usr/local/nagios/libexec# /usr/local/nagios/libexec/check_nrpe -H 10.146.2.38 -c check_jmxmemory
CHECK_NRPE: Error - Could not complete SSL handshake.

from:nagios server:
===================
-bash-4.1# /usr//local/nagios/libexec/check_nrpe -H 10.146.2.38 -c check_jmxmemory
NRPE: Command 'check_jmxmemory' not defined
I would not expect it to work on the remote host, so that's fine. THe important part here is where your nrpe.cfg is running from - please post /etc/nagios/nrpe.cfg for us to review.
Former Nagios Employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NRPE: Command 'check_channels' not defined and NRPE: Com

Post by tmcdonald »

Just checking in since we have not heard from you in a while. Did @rkennedy's post clear things up or has the issue otherwise been resolved?
Former Nagios employee
Locked