Page 4 of 6

Re: How to make Indirect checks

Posted: Mon Apr 13, 2015 10:44 am
by ziedmahjoub
jolson wrote:You will use a 'service check' to define any check that is not the host check. Two host checks cannot be defined on one host. You can read further about service checks and how to define them here: http://nagios.sourceforge.net/docs/3_0/ ... ml#service

Thanks!
i defined it in the host because i though it'll be like the ping one .

its already in a service definition :

Code: Select all

#'disk_usage' service definition
 define service{
      use                   generic-service
      host_name             ala_pc
      service_description   disk_usage
      check_command         check_nrpe!indirect_check_disk
      }
and its the same status UNKNOWN

Re: How to make Indirect checks

Posted: Mon Apr 13, 2015 10:50 am
by jolson
Does the indirect_check_disk command work from the CLI?

check_nrpe -H nsclientHost -t 60 -c indirect_check_disk

You will likely want to set this up as a service check that runs underneath of the host, since a host can only have 1 host check.

Re: How to make Indirect checks

Posted: Mon Apr 13, 2015 11:05 am
by ziedmahjoub
jolson wrote:Does the indirect_check_disk command work from the CLI?

check_nrpe -H nsclientHost -t 60 -c indirect_check_disk
same output from the CLI :

Code: Select all

/usr/local/nagios/libexec$ ./check_nrpe -H 192.168.0.100 -t 60 -c indirect_check_disk
No handler for command: indirect_check_disk
You will likely want to set this up as a service check that runs underneath of the host, since a host can only have 1 host check.
i didn't understand what you want to say

Re: How to make Indirect checks

Posted: Mon Apr 13, 2015 11:40 am
by jolson
Do you have the command 'indirect_check_disk' defined on the host you're using as a proxy? Please SSH to 192.168.0.100:

Code: Select all

ssh <user>@192.168.0.100
and run

Code: Select all

cat /usr/local/nagios/etc/nrpe.cfg
Please show the output of the above to us. Thank you!

Re: How to make Indirect checks

Posted: Tue Apr 14, 2015 3:00 am
by ziedmahjoub
jolson wrote:Do you have the command 'indirect_check_disk' defined on the host you're using as a proxy? Please SSH to 192.168.0.100:

Code: Select all

ssh <user>@192.168.0.100
i added this line in the 192.168.0.100 :
indirect_check_disk=scripts\check_disk.bat 192.168.0.25

it still unknown but the status information : no handler for indirect_check_disk is gone.
jolson wrote:and run

Code: Select all

cat /usr/local/nagios/etc/nrpe.cfg
the server proxy that i'm using as a is windows server 2008 , that command doesn't work.

i think now the problem is that i dont have the script check_disk.bat in the server that i'm using as a proxy

Re: How to make Indirect checks

Posted: Tue Apr 14, 2015 2:21 pm
by jdalrymple
Hi ziedmahjoub,

part of the problem is that the proxy configuration from 1 version of nsclient++ to the next changed a lot. It looks like you're trying to connect to the indirect host as if it were a Linux box, but it is not correct?

Also, you do not need the check_disk.bat on the nsclient++ proxy since that isn't where you're checking disks. That command only needs to reside on the host which has the disk, but even then it is not necessary because nsclient++ itself (I think you're still monitoring a Windows indirect server right?) has the disk check built in.

Re: How to make Indirect checks

Posted: Wed Apr 15, 2015 2:41 am
by ziedmahjoub
i'm only checking if the host is alive or not : (

so jdalrymple any solution ?

Re: How to make Indirect checks

Posted: Wed Apr 15, 2015 3:11 pm
by jdalrymple
ziedmahjoub wrote:i'm using NSClient++ 0.4.1.105
Can we get you to upgrade to the current stable, at least on host B? During the 4.1 time the developer was making huge changes to the config syntax and it was poorly documented. The current stuff is better documented.


Before you do the upgrade (if you can) be sure to grab a backup of the entire <c:\program files\nsclient++> directory in case the installer breaks anything that we have to go back to and fix.

If you can't upgrade I'll have to setup a lab with a machine running that specific version to test with. It may even be advisable to speak with the developer about setting up proxying on that version, but I expect he'll just suggest you upgrade too.

Re: How to make Indirect checks

Posted: Thu Apr 16, 2015 3:56 am
by ziedmahjoub
ok jdalrymple i upgraded it , and when i saw it there is no [/settings/external scripts/scripts] section .

do you want to see the config file ?

Re: How to make Indirect checks

Posted: Thu Apr 16, 2015 2:55 pm
by tgriep
In Box293's guide, this section will add the missing settings in your INI file. Did you run this on the host that the Nagios system can access?
Open a command prompt with Administrator rights and type the following commands:

cd "\Program Files\NSClient++\"

nscp settings --activate-module CheckExternalScripts --add-defaults

nscp settings --path "/settings/NRPE/server" --key "allow arguments" --set true

nscp settings --path "/settings/external scripts" --key "allow arguments" --set true

nscp settings --path "/settings/external scripts/scripts" --key check_ping --set "scripts\\check_ping.bat $ARG1$"

Then restart the NSClient++ service

nscp service --stop
nscp service --start
You could post your ini file if you like.