0

i have my monitoring Linux server with

NRPE Plugin for Nagios
Version: 3.2.1

and i installed on the windows machine NSClient++ with this .bat script.

set setupfile="NSCP-0.5.2.35-x64.msi"
msiexec /l install.log /i %setupfile% CONF_CAN_CHANGE="TRUE" ALLOWED_HOSTS="1.2.3.4/32,127.0.0.1/32" CONF_NRPE="TRUE" CONF_CHECKS="TRUE" CONF_NSCLIENT="FALSE" CONF_WEB="FALSE" CONF_NSCA="FALSE" /quiet
copy "nrpe_dh_2048.pem" "C:\Program Files\NSClient++\security\nrpe_dh_2048.pem"
cd "C:\Program Files\NSClient++"
nscp.exe settings --activate-module "NRPEServer" --add-defaults
nscp.exe settings --path "/modules" --key "CheckDisk" --set "enabled"
nscp.exe settings --path "/modules" --key "CheckSystem" --set "enabled"
nscp.exe settings --path "/settings/default" --key "bind to" --set ""
nscp.exe settings --path "/settings/NRPE/server" --key "ssl options" --set "no-sslv2,no-sslv3,no-tlsv1"
nscp.exe settings --path "/settings/NRPE/server" --key "dh" --set "${certificate-path}/nrpe_dh_2048.pem"
nscp.exe settings --path "/settings/NRPE/server" --key "allow arguments" --set "true"
nscp.exe settings --path "/settings/log" --key "level" --set "warning"
net stop nscp
net start nscp

my command looks like:

./check_nrpe --v2-packets-only -H 172.16.0.1 -p 5666 --unknown-timeout --command="Check_drivesize"

How can i filter for disk C: only? or change the warning/critical threshold?

The examples did not work https://docs.nsclient.org/reference/windows/CheckDisk/#check_drivesize_samples

eg.

./check_nrpe --v2-packets-only -H 172.16.0.1 -p 5666 --unknown-timeout --command="Check_drivesize" "crit=free<10%" "drive=c:"

Output:

OK All 3 drive(s) are ok|'C:\ used'=12.46093GB;15.54609;17.48935;0;19.43261 'C:\ used %'=64%;80;90;0;100 'A:\ used'=0B;0;0;0;0 'D:\ used'=0B;0;0;0;0
FaxMax
  • 165
  • 1
  • 2
  • 12

2 Answers2

0

To answer the original question and my question, above.

This need to be set in nsclient.ini.

[/settings/NRPE/server]
allow arguments = true
allow nasty characters = true

Now, it works.

D:\Program Files\NSClient>check_nrpe host=127.0.0.1 port=15666 certificate=security/ca.pem verify=peer-cert allowed-ciph
ers=ALL command=check_drivesize argument="critical=free < 10%" argument="drive=c:"
OK All 1 drive(s) are ok|'c: free'=25.15175GB;0;4.99969;0;49.99706 'c: free %'=50%;0;10;0;100 'c: used'=24.84531GB;39.99
765;0;0;49.99706 'c: used %'=50%;80;0;0;100
Nash A
  • 1
  • 1
0

I think using check_nrpe you need to pass args with -a options:

-a, --args=LIST Optional arguments that should be passed to the command, separated by a space. If provided, this must be the last option supplied on the command line.

in your nrpe.cfg file: command[xxx]=/usr/lib/nagios/plugins/xxx.sh "$ARG1$" "$ARG2$" "$ARG3$"

djv
  • 81
  • 5