nrpe check_disk

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
crechet51
Posts: 24
Joined: Mon Aug 05, 2019 9:41 am

nrpe check_disk

Post by crechet51 »

Hello.
I have a ubuntu-server that I want to use as a monitoring server.

I installed nagios and nrpe on it.

Code: Select all

# /usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.15
I need to check the remaining disk space on remote PCs.

Locally, the command looks something like this:

Code: Select all

# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
DISK OK - free space: / 14223 MB (72.35% inode=94%);| /=5433MB;15738;17705;0;19673
However, on the remote host (with nagios + nrpe installed):

Code: Select all

# ./check_nrpe -H remotehost -t 30 -c check_disk -a '30 10 /'
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
Wherein:

Code: Select all

# /usr/local/nagios/libexec/check_nrpe -H remotehost
NRPE v2.15
That is, nrpe on the remote pc responds on server's requests.

I think that the matter is in the disk check command. How exactly does the check_disk call happen? Do I need an alias for this? Or what? :roll:

Thank you in advance.
crechet51
Posts: 24
Joined: Mon Aug 05, 2019 9:41 am

Re: nrpe check_disk

Post by crechet51 »

Found a problem.

It turns out that I did not describe the commands in commands.cfg
However, now a second problem has appeared - on the monitoring web page:

Code: Select all

NRPE: Command 'check_disk' not defined
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nrpe check_disk

Post by scottwilkerson »

Can you show the check_disk command you defined in the nrpe.cfg on the remote server?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: nrpe check_disk

Post by mbellerue »

Excellent that you got it moved forward! Can you post your command definition, and your service definition? We'll see if there's something in there stopping it from running correctly.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
crechet51
Posts: 24
Joined: Mon Aug 05, 2019 9:41 am

Re: nrpe check_disk

Post by crechet51 »

Hello scottwilkerson and mbellerue.

Both on the server and on the remote PC, nagios.cfg pulls the commands from commands.cfg

In the commands.cfg check_disk is:

Code: Select all

define command {
    command_name    check_disk
    command_line    /usr/local/nagios/libexec/check_disk -w 10% -c 5% -p /
}
Am I doing something wrong?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nrpe check_disk

Post by scottwilkerson »

crechet51 wrote:Both on the server and on the remote PC, nagios.cfg pulls the commands from commands.cfg
that's not how check_nrpe works

When you run

Code: Select all

./check_nrpe -H remotehost -t 30 -c check_disk
the nagios server reaches out to remotehost on port 5666 (the NRPE port) and asks it to execute the command defined in it's nrpe.cfg that starts like

Code: Select all

command[check_disk]=...
If it is not found, you will get an error like

Code: Select all

NRPE: Command 'check_disk' not defined
It will often look something like this

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
you would execute this like

Code: Select all

./check_nrpe -H remotehost -t 30 -c check_disk -a '-w 20% -c 10% -p /'
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
crechet51
Posts: 24
Joined: Mon Aug 05, 2019 9:41 am

Re: nrpe check_disk

Post by crechet51 »

Yes! Thanks guys, you're right.

I just needed to enter the command in nrpe.cfg

Thanks a lot! :D
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nrpe check_disk

Post by scottwilkerson »

crechet51 wrote:Yes! Thanks guys, you're right.

I just needed to enter the command in nrpe.cfg

Thanks a lot! :D
Glad you got it working!

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked