Você está na página 1de 12

Commercial in Confidence Page 1

Installation of NSClient++
Windows Monitoring Service
Commercial in Confidence Page 2
Acceptance and Release Notice
This is a managed document. All copies of this document preceding this release are
obsolete and shall be destroyed.
Version Status:
Release
Number
Author(s)
Date Reason for Version
0.1 19/05/2008 First Draft
0.2 2/06/2008 Revision
0.3 6/03/2009 Revision
Commercial in Confidence Page 3
Table of Contents
1 Overview....................................................................................................... 4
1.1 NSClient++ .....................................................Error! Bookmark not defined.
2 Installing NSClient++................................................................................... 5
3 NSClient++ Configuration............................................................................. 8
4 Customised Checks ..................................................................................... 10
5 NSCLient++ as a Proxy Checker.................................................................. 11
References ....................................................................................................... 12
Commercial in Confidence Page 4
1 Overview
NSClient++ is a simple yet powerful and secure monitoring daemon for Windows
operating systems. It is built for Nagios.
The structure of the daemon is a simple NT service that loads plug-ins to an internal
stack. The plug-ins can then request data (poll performance data) from the other plug-
ins through the internal stack.
NSClient++ can be extended in two ways: you can either write your own plug-in or you
can execute an external script (as of now batch/exe/*). Writing your own plug-in is, of
course, the most powerful way but requires knowledge of C++ or other languages which
can produce DLLs and interface with regular C programs (generally, every other language
available, but there is some simple API helpers for C/C++ as well as descriptions).
Commercial in Confidence Page 5
2 Prerequistes
Once NSClient++ is installed, for proper operation, the Monsvr needs to communicate
with it via your internal network.
The Monsvr communicates with NSClient++ on TCP port 5666. The Monsvr initiates all
traffic.
Commercial in Confidence Page 6
3 Installing NSClient++
Run the self-extracting Winzip file, accept the default location and press the "Unzip
button. This will extract the files to c:\Program Files\NSClient++
Open up Windows Explorer to the C:\Program Files\NSClient++ folder and run the
"Install NSClient++ Service link. The NSClient++ is now installed as a system service.
Commercial in Confidence Page 7
Now start the Windows Service, either by running the "Start NSClient++ Service
program or through normal Windows methods.
Commercial in Confidence Page 8
4 NSClient++ Configuration
The main NSClient++ configuration is contained in a simple text file "NSC.ini. You will
not need to change any of this to make NSClient++ operational. You may, however, wish
to restrict the IP Addresses of clients that can connect to the NSClient++. In order to do
this you will need to adjust the "allowed_hosts setting in "NSC.ini (approx line 56 in the
file).
The "allowed_hosts setting can be set to a list of IP Addresses or a list of IP subnets that
are valid for access. You may wish to set this to the IP address of your Monsvr(s).
The NSClient++ is preconfigured with numerous commonly used Windows system and
application checks. Additional to the internally available commands, NSClient++ can run
external plugins to perform additional checks. The configuration is a simple text file is
contained in the "V2_nrpe_commands.ini file within the "C:\Program
Files\NSClient++\cfg folder.
Some of the built-in preconfigured checks include:
CPU Utilisation
Memory Utilisation
Disk Utilisation
Server Uptime
Windows Service Status
Windows Process Status
Event Log checking
File size checks
Folder size checks
Generic WMI Queries
The initially configured external plugins include checks for:
Commercial in Confidence Page 9
Generic configuration information about CPUs, Networks, Disks etc (probably not that
useful for monitoring)
CPU, Memory, Disk and Network Utilisation (useful in a proxy configuration - see
below)
Service and Process Checks
Swapping, Disk transfer and print queue information
Microsoft Exchange Checks, queue sizes for various components
Microsoft IIS Checks, various
Microsoft SQL Checks, various
Commercial in Confidence Page 10
5 Customised Checks
It is possible to develop your own scripts/programs to perform customised checks within
the Windows environment and have NSClient++ execute them on your behalf. All of the
checks are executed by Nagios on the Monsvr according to the parameters that you have
configured for the various checks.
In order to execute your plugin it must be added to the configuration file and the
NSClient++ service restarted.
Custom scripts/programs must conform to the plugin development guidelines available
from http://nagios.sourceforge.net/docs/3_0/pluginapi.html
In summary the plugins must:
Accept various parameters as required to control the checks (there may be no
parameters required)
Output a single line of status information. Multi-line output is possible as described at
http://nagios.sourceforge.net/docs/3_0/pluginapi.html
Use exit codes of:
0 (Zero) for OK
1 for WARNING
2 for CRITICAL
3 for UNKNOWN
Commercial in Confidence Page 11
6 NSCLient++ as a Proxy Checker
Whilst you can run many checks using NSClient++ on the host that it is installed on, it is
also possible to use a single Windows host as a gateway to the remainder of your
Windows environment.
Largely the built-in checks are designed to check the host that NSClient++ is installed on
and the initial set of external plugins are designed to check any reachable Windows host.
In the diagram below you can see how this works.
The NSClient++ is installed on a Windows host. The Monsvr initiates all of the checks as
required and collects the results. The NSClient server performs the checks of itself and of
the other hosts in the environment and passes the results back to the Monsvr.
The advantage of this approach is that NSClient++ is installed in fewer locations and is
hence easier to manage. The disadvantage of this approach is that you are reliant on a
single (or perhaps a few) instances of NSClient++ to perform all of your checks for you.
Commercial in Confidence Page 12
References
NSClient++ Site: http://trac.nakednuns.org/nscp/
NSClient++ Check Commands (built-in):
http://trac.nakednuns.org/nscp/wiki/CheckCommands

Você também pode gostar