Вы находитесь на странице: 1из 3

NSCA Clien t - NSClien t ++ 0.3.

9
Article Number: 80 | Rating: Unrated | Last Updated: Mon, Feb 22, 2016 at 9:39 PM

O v e r v ie w
This guide will show you how to install NSClient++ 0.3.9 on Microsoft Windows to send NSCA check results to a server running NSCA.

NOTE:

When using NSClient++ 0.3.9 and below, your NSCA server MU S T use NSCA version 2 .7 .2 . Newer versions of NSCA server do not work with versions of NSClient++ 0.3.x.

Do w nlo a d NS C lie nt + + 0 . 3. 9
32bit Windows

64bit Windows

I ns t a ll NS C lie nt + +
IF you already have NSClient++ installed on this computer then you can skip this step, as you can enable the modules as described in the steps further on.

Run the installer you previously downloaded

The welcome page appears

Click N e xt

T ic k the box I a c c e p t the te r ms in the Lic e ns e Ag r e e me nt

Click N e xt

Accept the default modules and install location

Click N e xt

Configuration page, being a fresh install there is nothing to select here

Click N e xt

Allowed hosts

Leave this blank as it's not required for NSCA

NSClient Password

Leave this blank as it's not required for NSCA

Modules to load (tic k the following):

Enable common check plugins

Enable NSCA client

Click N e xt
Click Ins ta ll

Wait for NSClient++ to install

When installer has completed click Finis h (don't tick the box Start service)

C o nf ig ur e NS C lie nt + +
There are a couple of final settings to change in the config file.

Open the Run dialog (W ind o w s Ke y + R )

Type:

notepad "C:\Program Files\NSClient++\nsc.ini"

This opens the config file in Notepad and the options are explained in more detail next.

When you are looking at the config file you'll see lots of options and sections. However the bare minimum required to make NSCA work is as follows (N O T E: if a setting or section does not exis

This section enables all the modules required to make NSCA work.

[modules]
CheckSystem.dll
CheckHelpers.dll
NSCAAgent.dll

This defines that NSClient++ needs to use this config file:

[Settings]
use_file=1
use_file=1

This is where you define the destination NSCA server and the required parameters. The encryption and password must be the same on the NSCA server. The interval parameter is in seconds.

[NSCA Agent]
interval=60
encryption_method=1
password=Passw0rd
nsca_host=10.25.5.58
nsca_port=5667

Here are the actual checks being performed and the results for each of these checks will be submitted to the NSCA server.

[NSCA Commands]
CPU Load = checkCPU warn=80 crit=90 time=5m time=1m time=30s
Memory Usage = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=page

Once you've made any required changes, S a ve and C lo s e the nsc.ini file

To make it clear, the NSCA server will receive two service check results.

The first one will be for the service named C P U Lo a d

NSClient++ uses checks build into it's CheckSystem module, specfically checkCPU

The second one will be for the service named Me mo r y U s a g e

NSClient++ uses checks build into it's CheckSystem module, specfically checkMem

S t a r t NS C lie nt + + S e r v ic e
Open the Run dialog (W ind o w s Ke y + R )

Type:

services.msc

This opens the Services management console.

Find N S C lie nt++ service

Rig ht c lic k it and select S ta r t

Wait for the service to start

Close the services manangement console when service is started

O b s e r v e Na g io s L o g
Now that NSClient++ is configured and running, it will be submitting check results to NSCA at every interval defined in nsc.ini. To watch them arrive:

SSH to your Nagios NSCA server.

Type:

tail -f /usr/local/nagios/var/nagios.log

You should see data like:

[1419217766] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;DC02;CPU Load;0;OK CPU Load ok.|'5m'=0%;80;90 '1m'=0%;80;90 '30s'=0%;80;90
[1419217766] Warning: Passive check result was received for service 'CPU Load' on host 'DC02', but the host could not be found!
[1419217766] Error: External command failed -> PROCESS_SERVICE_CHECK_RESULT;DC02;CPU Load;0;OK CPU Load ok.|'5m'=0%;80;90 '1m'=0%;80;90 '30s'=0
[1419217766] External command error: Command failed

[1419217766] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;DC02;Memory Usage;0;OK: physical memory: Total: 2G - Used: 617M (30%) - Free: 1.4G
[1419217766] Warning: Passive check result was received for service 'Memory Usage' on host 'DC02', but the host could not be found!
[1419217766] Error: External command failed -> PROCESS_SERVICE_CHECK_RESULT;DC02;Memory Usage;0;OK: physical memory: Total: 2G - Used: 617M (30
[1419217766] External command error: Command failed

This confirms that NSClient++ is working.

The errors are simply because there are no services called "CPU Load" or "Memory Usage" for the host localhost

N O T E: Once you add service objects to Nagios for these Passive check results, they will no longer be logged in nagios.log unless you define this in your core nagios.cfg.

W ha t a b o ut t he Ho s t it s e lf ?
When NSCA receives these check results, they are targeted at a host, because all services in Nagios must belong to a host. You can actually submit a check result for the host object itself , sim

[NSCA Commands]
host_check = CheckOK "Everything is working fine"

And you will see these results in nagios.log:

[1419217864] EXTERNAL COMMAND: PROCESS_HOST_CHECK_RESULT;DC02;0;Everything is working fine|


[1419217864] Warning: Passive check result was received for host 'DC02', but the host could not be found!
[1419217864] Warning: Passive check result was received for host 'DC02', but the host could not be found!
[1419217864] Error: External command failed -> PROCESS_HOST_CHECK_RESULT;DC02;0;Everything is working fine|
[1419217864] External command error: Command failed

Mo r e Ex a mp le s
Different checks require different modules in NSClient++ to be enabled:

Dis ks
[modules]
CheckDisk.dll

[NSCA Commands]
Drive Usage = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED

W MI Que r ie s
[modules]
CheckWMI.dll

[NSCA Commands]
Operating System Version = CheckWMI "Query=Select Version,Caption from win32_OperatingSystem"

Na g io s P a s s iv e Ho s t a nd S e r v ic e De f init io ns
Don't forget to create passive host and service definitions for these inbound NSCA check results.

Here are some to compliment these examples.

S umma r y
At this point NSClient++ is now installed and configured. In the example above, it will send check results to the NSCA server 10.25.5.58 every 60 seconds.

Fina l T ho ug ht s
For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/

Posted by: tle a - Mon, Mar 23, 2015 at 8:51 PM. This article has been viewed 3424 times.

Online URL: https://support.nagios.com/kb/article/nsca- client- nsclient- 0- 3- 9- 80.html

Вам также может понравиться