nrpe - commands not found.

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

nrpe - commands not found.

Postby PitchforkSolutions » Wed Aug 11, 2021 10:29 pm

Greetings

I have recently installed Nagios on a Centos 8 VM following the instructions here: https://www.linuxtechi.com/install-nagi ... -centos-8/

Fired it up and sure enough - monitoring localhost perfectly.

Feeling adventurous (always a bad sign) I tried them to set up monitoring of an Ubuntu 20 machine on the same network. I used the article (by the same author) located here: https://www.linuxtechi.com/add-windows- ... ios-server (Linux instructions start about half way down the page).

And this is where I hit a snag.

In nagios.cfg I uncommented the following

Code: Select all
# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:

cfg_dir=/usr/local/nagios/etc/servers
#cfg_dir=/usr/local/nagios/etc/printers
#cfg_dir=/usr/local/nagios/etc/switches
#cfg_dir=/usr/local/nagios/etc/routers


and in the etc/servers I created the file pfs-do-m01.cfg which contains the following:

Code: Select all
define host{
            use                     linux-server
            host_name               pfs-do-m01
            alias                   pfs-do-m01
            address                 192.168.0.128

}

define hostgroup{
            hostgroup_name          linux-server
            alias                   Linux Servers
            members                 pfs-do-m01
}

define service{
            use                     local-service
            host_name               pfs-do-m01
            service_description     Ping
            check_command           check_nrpe!check_ping

}

define service{
            use                     local-service
            host_name               pfs-do-m01
            service_description     SWAP Usage
            check_command           check_nrpe!check_swap

}

define service{
            use                     local-service
            host_name               pfs-do-m01
            service_description     Root / Partition
            check_command           check_nrpe!check_root

}

define service{
            use                     local-service
            host_name               pfs-do-m01
            service_description     Current Users
            check_command           check_nrpe!check_users
}

define service{
            use                     local-service
            host_name               pfs-do-m01
            service_description     Total Processes
            check_command           check_nrpe!check_total_procs
}

define service{
            use                     local-service
            host_name               pfs-do-m01
            service_description     Current Load
            check_command           check_nrpe!check_load
}


I restarted the nagios service and immediately saw this:
Image

The messages chopped of the end of the image read:

Code: Select all
NRPE: Command 'check_ping' not defined
NRPE: Command 'check_root' not defined
NRPE: Command 'check_swap' not defined


I'm guessing that for some reason check_nrpe has some incompatibility with other commands in /usr/local/nagios/libexec, the contents of which are here:
Code: Select all
-rwxr-xr-x. 1 nagios nagiosxi 215632 Aug 12 10:10 check_apt
-rwxr-xr-x. 1 nagios nagiosxi   2346 Aug 12 10:10 check_breeze
-rwxr-xr-x. 1 nagios nagiosxi 221728 Aug 12 10:10 check_by_ssh
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_clamd -> check_tcp
-rwxr-xr-x. 1 nagios nagiosxi 162560 Aug 12 10:10 check_cluster
-r-sr-xr-x. 1 root   nagiosxi 218688 Aug 12 10:10 check_dhcp
-rwxr-xr-x. 1 nagios nagiosxi 213512 Aug 12 10:10 check_dig
-rwxr-xr-x. 1 nagios nagiosxi 375896 Aug 12 10:10 check_disk
-rwxr-xr-x. 1 nagios nagiosxi  10134 Aug 12 10:10 check_disk_smb
-rwxr-xr-x. 1 nagios nagiosxi 236800 Aug 12 10:10 check_dns
-rwxr-xr-x. 1 nagios nagiosxi 113168 Aug 12 10:10 check_dummy
-rwxr-xr-x. 1 nagios nagiosxi   5066 Aug 12 10:10 check_file_age
-rwxr-xr-x. 1 nagios nagiosxi   6504 Aug 12 10:10 check_flexlm
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_ftp -> check_tcp
-rwxr-xr-x. 1 nagios nagiosxi 215056 Aug 12 10:10 check_hpjd
-rwxr-xr-x. 1 nagios nagiosxi 355496 Aug 12 10:10 check_http
-r-sr-xr-x. 1 root   nagiosxi 256696 Aug 12 10:10 check_icmp
-rwxr-xr-x. 1 nagios nagiosxi 170856 Aug 12 10:10 check_ide_smart
-rwxr-xr-x. 1 nagios nagiosxi  15275 Aug 12 10:10 check_ifoperstatus
-rwxr-xr-x. 1 nagios nagiosxi  13422 Aug 12 10:10 check_ifstatus
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_imap -> check_tcp
-rwxr-xr-x. 1 nagios nagiosxi   6985 Aug 12 10:10 check_ircd
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_jabber -> check_tcp
-rwxr-xr-x. 1 nagios nagiosxi 205216 Aug 12 10:10 check_load
-rwxr-xr-x. 1 nagios nagiosxi   7068 Aug 12 10:10 check_log
-rwxr-xr-x. 1 nagios nagiosxi  25575 Aug 12 10:10 check_mailq
-rwxr-xr-x. 1 nagios nagiosxi 166808 Aug 12 10:10 check_mrtg
-rwxr-xr-x. 1 nagios nagiosxi 169640 Aug 12 10:10 check_mrtgtraf
-rwxr-xr-x. 1 nagios nagiosxi 188192 Aug 12 10:10 check_nagios
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_nntp -> check_tcp
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_nntps -> check_tcp
-rwxr-xr-x. 1 root   root      55488 Aug 12 11:17 check_nrpe
-rwxr-xr-x. 1 nagios nagiosxi 224144 Aug 12 10:10 check_nt
-rwxr-xr-x. 1 nagios nagiosxi 227752 Aug 12 10:10 check_ntp
-rwxr-xr-x. 1 nagios nagiosxi 215568 Aug 12 10:10 check_ntp_peer
-rwxr-xr-x. 1 nagios nagiosxi 214376 Aug 12 10:10 check_ntp_time
-rwxr-xr-x. 1 nagios nagiosxi 245880 Aug 12 10:10 check_nwstat
-rwxr-xr-x. 1 nagios nagiosxi   9468 Aug 12 10:10 check_oracle
-rwxr-xr-x. 1 nagios nagiosxi 196672 Aug 12 10:10 check_overcr
-rwxr-xr-x. 1 nagios nagiosxi 229040 Aug 12 10:10 check_ping
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_pop -> check_tcp
-rwxr-xr-x. 1 nagios nagiosxi 230152 Aug 12 10:10 check_procs
-rwxr-xr-x. 1 nagios nagiosxi 189264 Aug 12 10:10 check_real
-rwxr-xr-x. 1 nagios nagiosxi   9679 Aug 12 10:10 check_rpc
-rwxr-xr-x. 1 nagios nagiosxi   1630 Aug 12 10:10 check_sensors
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_simap -> check_tcp
-rwxr-xr-x. 1 nagios nagiosxi 257088 Aug 12 10:10 check_smtp
-rwxr-xr-x. 1 nagios nagiosxi 267776 Aug 12 10:10 check_snmp
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_spop -> check_tcp
-rwxr-xr-x. 1 nagios nagiosxi 188720 Aug 12 10:10 check_ssh
-rwxr-xr-x. 1 nagios nagiosxi  12544 Aug 12 10:10 check_ssl_validity
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_ssmtp -> check_tcp
-rwxr-xr-x. 1 nagios nagiosxi 168024 Aug 12 10:10 check_swap
-rwxr-xr-x. 1 nagios nagiosxi 238816 Aug 12 10:10 check_tcp
-rwxr-xr-x. 1 nagios nagiosxi 188664 Aug 12 10:10 check_time
lrwxrwxrwx. 1 root   root          9 Aug 12 10:10 check_udp -> check_tcp
-rwxr-xr-x. 1 nagios nagiosxi 201728 Aug 12 10:10 check_ups
-rwxr-xr-x. 1 nagios nagiosxi 158192 Aug 12 10:10 check_uptime
-rwxr-xr-x. 1 nagios nagiosxi 156792 Aug 12 10:10 check_users
-rwxr-xr-x. 1 nagios nagiosxi   3270 Aug 12 10:10 check_wave
-rwxr-xr-x. 1 nagios nagiosxi 147784 Aug 12 10:10 negate
-rwxr-xr-x. 1 nagios nagiosxi 145808 Aug 12 10:10 remove_perfdata
-rwxr-xr-x. 1 nagios nagiosxi 142432 Aug 12 10:10 urlize
-rwxr-xr-x. 1 nagios nagiosxi   1914 Aug 12 10:10 utils.pm
-rwxr-xr-x. 1 nagios nagiosxi   2791 Aug 12 10:10 utils.sh


but as a Nagios noob I have no idea where to start looking.

Any suggestions would be gratefully accepted.

TIA

Nigel.
PitchforkSolutions
 
Posts: 2
Joined: Wed Aug 11, 2021 5:30 pm

Re: nrpe - commands not found.

Postby gormank » Thu Aug 12, 2021 10:19 am

Commands define the plugins that run and their arguments.
Try doing a grep include on /usr/local/nagios/etc/nrpe.cfg and define an include directory. This is typically /usr/local/nagios/etc/nrpe/. If your plugins are in nrpe.cfg and commented, you can uncomment them. If they aren't I'd add them to a .cfg file in /usr/local/nagios/etc/nrpe/.
The commands need to be defined on the host where the plugins run.
I set up check_ping as the host check, which will turn the host green.
gormank
 
Posts: 913
Joined: Tue Dec 02, 2014 12:00 pm

Re: nrpe - commands not found.

Postby PitchforkSolutions » Thu Aug 12, 2021 4:42 pm

Hi All

It appears that what I actually needed was a glass of red wine and the nrpe documentation.

I discovered via trial and error that the "command not found" was being generated at the client end (ie the remote host being monitored).

I also discovered that the nrpe from the Ubuntu distro was not compiled with the necessary flags so I am limited to using commands on the remote end that already have parameters associated with them. Once I updated the commands in the "etc/servers" file to match the ones in the remote end, things started to fall into place.

Thanks for the assist - I couldn't cancel this post as it was being checked by an admin.

Regards

Nigel.
PitchforkSolutions
 
Posts: 2
Joined: Wed Aug 11, 2021 5:30 pm


Return to Community Support

Who is online

Users browsing this forum: No registered users and 23 guests