Monitoring Windows with NSClient

Features

CheckSystem module

This module provides these check commands:

  • CheckCPU
  • CheckUpTime
  • CheckServiceState
  • CheckProcState
  • CheckMem
  • CheckCounter

CheckDisk module

This module provides these check commands:

  • CheckFileSize
  • CheckDriveSize
  • CheckFile
  • CheckFile2

CheckEventLog module

This module provides these check commands:

  • CheckEventLog

Windows side configuration

To enable modules, edit file C:\Program Files\NSClient++\NSC.ini, under [modules], set:

[modules]
NRPEListener.dll
CheckWMI.dll
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
CheckEventLog.dll
CheckHelpers.dll
CheckExternalScripts.dll
...

To make check_nrpe usable, under [NRPE] section, set:

...
[NRPE]
...
allow_arguments=1
allow_nasty_meta_chars=1
...

Check commands definition

Disk

Raw check command:

/usr/lib/nagios/plugins/check_nrpe -u \
 -H 192.168.0.28 \
 -c CheckDriveSize \
 -a Drive="C" MaxWarnUsed=80% MaxCritUsed=90%

Output:

OK: All drives within bounds.|'C: %'=30%;80;90; 'C:'=12.25G;31.99;35.99;0;39.99;

Definition:

define command{
   command_name    check_nsc_diskspace
   command_line    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckDriveSize -a Drive=$ARG2$ MaxWarnUsed=$ARG3$ MaxCritUsed=$ARG4$
}

#Usage example: check_nsc_diskspace!5666!C!85%!95%

CPU Load

Raw check command:

/usr/lib/nagios/plugins/check_nrpe -u \
 -H 192.168.0.28 \
 -c CheckCPU -a warn=95% crit=99% time=15m

Output:

OK CPU Load ok.|'15m'=0%;95;99;

Definition:

define command{
   command_name    check_nsc_cpu
   command_line    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckCPU -a warn=$ARG2$ crit=$ARG3$ time=$ARG4$
}

#Usage example: check_nsc_cpu!5666!95%!99%!15m

Memory

Raw check command:

/usr/lib/nagios/plugins/check_nrpe -u  \
 -H 192.168.0.28  \
 -c CheckMem \
 -a type=virtual MaxWarn="80%" MaxCrit="90%" ShowAll

Output:

OK: virtual memory: 54.2M|'virtual memory %'=2%;80;90; 'virtual memory'=54.2M;1638.;1843.08;0;2047.87;

Definition:

define command{
   command_name    check_nsc_mem
   command_line    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckMem -a type=$ARG2$ MaxWarn=$ARG3$ MaxCrit=$ARG4$ ShowAll
}

#Usage example: check_nsc_mem!5666!virtual!80%!90%

Service

Raw check command:

/usr/lib/nagios/plugins/check_nrpe -u  \
 -H 192.168.0.28  \
 -c CheckServiceState \
 -a "Spooler"=started ShowAll

Output:

OK: Spooler: started

Definition:

define command{
   command_name    check_nsc_service
   command_line    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckServiceState -a $ARG2$=$ARG3$ ShowAll
}

#Usage example: check_nsc_service!5666!Spooler!started

Process

Raw check command:

/usr/lib/nagios/plugins/check_nrpe -u  \
 -H 192.168.0.28  \
 -c CheckProcState \
 -a avgnt.exe=started ShowAll

Output:

CRITICAL: avgnt.exe: stopped (critical)

Definition:

define command{
   command_name    check_nsc_prcoess
   command_line    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckProcState -a $ARG2$=$ARG3$ ShowAll
}

#Usage example: check_nsc_prcoess!5666!avgnt.exe!started

Counter

Raw check command:

/usr/lib/nagios/plugins/check_nrpe -u  \
 -H 192.168.0.28  \
 -c CheckCounter \
 -a "Counter=\\Memory\\Pages Input/sec" MaxWarn=10 MaxCrit=20 ShowAll

Output:

OK: \Memory\Pages Input/sec: 0|'\Memory\Pages Input/sec'=0;10;20;

Definition:

define command{
   command_name    check_nsc_counter
   command_line    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckCounter -a "Counter=$ARG2$" ShowAll MaxWarn=$ARG3$ MaxCrit=$ARG4$
}

#Usage example: check_nsc_counter!5666!\\Memory\\Pages Input/sec!10!20

All in one definition

; assume $USER3$ set to default nrpe port tcp 5666

define command{
        command_name                    check_nsc_counter
        command_line                    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckCounter -a Counter=$ARG2$ MaxWarn=$ARG3$ MaxCrit=$ARG4$ ShowAll
        ;command_example                        !$USER3$!\Memory\Pages Input/sec!10!20
}

define command{
        command_name                    check_nsc_cpu
        command_line                    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckCPU -a warn=$ARG2$ crit=$ARG3$ time=$ARG4$
        ;command_example                        !$USER3$!95%!99%!15m
}

define command{
        command_name                    check_nsc_diskspace
        command_line                    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckDriveSize -a Drive=$ARG2$ MaxWarnUsed=$ARG3$ MaxCritUsed=$ARG4$
        ;command_example                        !$USER3$!C!85%!95%
}

define command{
        command_name                    check_nsc_mem
        command_line                    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckMem -a type=$ARG2$ MaxWarn=$ARG3$ MaxCrit=$ARG4$ ShowAll
        ;command_example                        !$USER3$!virtual!80%!90%
}

define command{
        command_name                    check_nsc_prcoess
        command_line                    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckProcState -a $ARG2$=$ARG3$ ShowAll
        ;command_example                        !$USER3$!avgnt.exe!started
}

define command{
        command_name                    check_nsc_service
        command_line                    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -p $ARG1$ -c CheckServiceState -a $ARG2$=$ARG3$ ShowAll
        ;command_example                        !$USER3$!Spooler!started
}

Reference

HOW TO: Be Reminded When Your Computer Resources Are Running Low in Windows Server 2003
nagios/monitoring_windows_with_nsclient.txt · Last modified: 2011-11-07 16:27 by admin
Back to top
GNU Free Documentation License 1.3
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0