NRPE: Command check_rootpart not defined


I’m trying to check disk space on a Linux host. I’m getting a CRITICAL error:

NRPE: Command check_rootpart not defined

The only place check_rootpart shows up is in /etc/nagios/checkcommands.cfg

define command{
command_name check_remote_disk
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_rootpart

I believe there are disk space checks for other hosts that are working. I had considered changing check_rootpart to check_disk to match the entry I created in the nrpe.cfg on the remote host, but I’m afraid that would break other, currently-working checks. I do not see check_rootpart defined in nrpe.cfg, so I’m pretty much stumped here.


To solve my own problem, and leave an answer behind…

On the remote host, nrpe couldn’t find the check_disk plugin. That wasn’t built with nrpe (dunno why:?::?:slight_smile: so I copied it from another host. Still didn’t work. So, I manually ran it:

[root@ftp src]# /usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /dev/mapper/VolGroup00-LogVol00
/usr/lib/nagios/plugins/check_disk: error while loading shared libraries: cannot open shared object file: No such file or directory is a symlink to, so… why not symlink to it as well? Worked like a champ! I got the same error about, but another symlink fixed that. So I’m in business!


Well, even though the plugin works right, and reports the correct info, the emailed alerts still say NRPE: Command check_rootpart not defined I could still use some assistance with this.


You need to tell the NRPE daemon on the remote client what check_rootpart actually is… Like in the NRPE documentation:

[blockquote]a) Remote Host Configuration
You can use the check_swap plugin to monitor swap usage on the machine. Assuming you followed the
installation instructions in this document, the check_swap plugin should already be installed in
Login as the nagios user on the remote host.
Run the check_swap plugin manually and tweak the command line options to specify the desired warning and
critical free swap space thresholds. Make sure the full command line returns the expected output you want from
the plugin. For this example, let’s say you want a critical alert if swap free space is less than 10% and a warning if
free space is less than 20%. Here’s the command line that would accomplish that:
/usr/local/nagios/libexec/check_swap -w 20% -c 10%
Now that you know the command line that should be execute, open the NRPE configuration file.
vi /usr/local/nagios/etc/nrpe.cfg
Add a new check_swap command definition that uses the command line from above and save the file.
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%
If you’re running the NRPE daemon as a standalone daemon you’ll need to restart it. If you’re running it under the
inetd/xinetd superserver you don’t need to do anything more.

except you probably want something like

command[check_rootpart]=/usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /dev/mapper/VolGroup00-LogVol00