Page 1 of 1
Core3 Service Def using nrpe
Posted: Thu Oct 01, 2015 9:00 am
by zovy
I've been spoiled using NagiosXI Enterprise and in working with a smaller core3 install I'm having a difficult time getting a particular service check to work on a linux client. I have it working from command line on the core3 server but for the life of me can't seem to get the .cfg definitions right.
/usr/lib/nagios/plugins/check_nrpe -H 10.0.200.112 -c check_disk -a '-w 10% -c 5% -p /dev/sdc1'
DISK OK - free space: /dev/sdc1 1954974 MB (99% inode=99%);| /dev/sdc1=4412MB;1857819;1961031;0;2064244
How can I add the service definition for the host properly for check-disk-sdc1 below?
define host{
use generic-host
host_name client1.internal.local
alias client1
address 10.0.200.112
}
define service{
use generic-service
host_name client1.internal.local
service_description HTTP-Server
check_command check_http
}
Re: Core3 Service Def using nrpe
Posted: Thu Oct 01, 2015 11:54 am
by tmcdonald
zovy wrote:How can I add the service definition for the host properly for check-disk-sdc1 below?
define host{
use generic-host
host_name client1.internal.local
alias client1
address 10.0.200.112
}
define service{
use generic-service
host_name client1.internal.local
service_description HTTP-Server
check_command check_http
}
Is this the correct config? You're asking about a disk check but this is a HTTP service.
Re: Core3 Service Def using nrpe
Posted: Thu Oct 01, 2015 11:57 am
by zovy
Yes I want to append to the disk check to this config. Sorry I didn't make that clear

Re: Core3 Service Def using nrpe
Posted: Thu Oct 01, 2015 2:30 pm
by lmiltchev
You will need to install nagios plugins and NRPE on 10.0.200.112, and define "check_disk" in the "nrpe.cfg", i.e.
Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
then set up a check in nagios, for example:
Code: Select all
define service{
use generic-service
host_name client1.internal.local
service_description Disc Usage
check_command check_nrpe!check_disk!-a '-w 10% -c 5% -p /dev/sdc1'
}
Re: Core3 Service Def using nrpe
Posted: Mon Oct 05, 2015 9:35 am
by zovy
Ugh ... failing miserably at getting this proper. The check returns (No output returned from plugin)
I've gone down the road of your example and found the hard coded local nrpe checks so copied the existing /dev/hda1 line and changed to match what I need:
Code: Select all
command[check_sdc1]=/usr/lib/nagios/plugins/check_disk -w 40% -c 25% -p /dev/sdc1
then in the core3 server changed the host cfg file:
Code: Select all
define service{
use generic-service
host_name client1.internal.local
service_description SDC1
check_command check_nrpe!check_sdc1
}
I did reload the nagios-nrpe-server service on the target machine and have also tested the hard coded /dev/hda1 example with the same result (no output returned from plugin). Frustrating indeed ...
Re: Core3 Service Def using nrpe
Posted: Mon Oct 05, 2015 10:01 am
by zovy
Ha! Found it after bashing my head for a bit. The local NRPE command was expecting an argument from the core server. Thanks for your help it got me on the road to where I need to be

Re: Core3 Service Def using nrpe
Posted: Mon Oct 05, 2015 10:06 am
by hsmith
Glad to hear you're rolling on this one. Is there anything else we can do in this thread, or are we all right to close it out?
Re: Core3 Service Def using nrpe
Posted: Mon Oct 05, 2015 10:09 am
by zovy
Safe to close.