How to make Indirect checks

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.
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: How to make Indirect checks

Post 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
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: How to make Indirect checks

Post 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.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: How to make Indirect checks

Post 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
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: How to make Indirect checks

Post 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!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: How to make Indirect checks

Post 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
Attachments
indirect_check_disk
indirect_check_disk
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: How to make Indirect checks

Post 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.
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: How to make Indirect checks

Post by ziedmahjoub »

i'm only checking if the host is alive or not : (

so jdalrymple any solution ?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: How to make Indirect checks

Post 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.
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: How to make Indirect checks

Post 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 ?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: How to make Indirect checks

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked