Core3 Service Def using nrpe

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
zovy
Posts: 26
Joined: Fri Dec 19, 2014 1:17 pm

Core3 Service Def using nrpe

Post 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
}
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Core3 Service Def using nrpe

Post 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.
Former Nagios employee
zovy
Posts: 26
Joined: Fri Dec 19, 2014 1:17 pm

Re: Core3 Service Def using nrpe

Post by zovy »

Yes I want to append to the disk check to this config. Sorry I didn't make that clear :mrgreen:
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Core3 Service Def using nrpe

Post 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'
}
Be sure to check out our Knowledgebase for helpful articles and solutions!
zovy
Posts: 26
Joined: Fri Dec 19, 2014 1:17 pm

Re: Core3 Service Def using nrpe

Post 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 ...
zovy
Posts: 26
Joined: Fri Dec 19, 2014 1:17 pm

Re: Core3 Service Def using nrpe

Post 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 8-)
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Core3 Service Def using nrpe

Post 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?
Former Nagios Employee.
me.
zovy
Posts: 26
Joined: Fri Dec 19, 2014 1:17 pm

Re: Core3 Service Def using nrpe

Post by zovy »

Safe to close.
Locked