Home » Categories » Products » NSCA » Installation

NSCA Client - NSClient++ 0.3.9

Overview

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 MUST use NSCA version 2.7.2. Newer versions of NSCA server do not work with versions of NSClient++ 0.3.x.

 

Download NSClient++ 0.3.9

32bit Windows

64bit Windows

 

Install NSClient++

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 Next

Tick the box I accept the terms in the License Agreement

Click Next

Accept the default modules and install location

Click Next

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

Click Next

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 (tick the following):

Enable common check plugins

Enable NSCA client

Click Next

Click Install

Wait for NSClient++ to install

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

 

Configure NSClient++

There are a couple of final settings to change in the config file.

 

Open the Run dialog (Windows Key + 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 (NOTE: if a setting or section does not exist in your file, simply add it):

 

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

 

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, Save and Close 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 CPU Load

    • NSClient++ uses checks build into it's CheckSystem module, specfically checkCPU
  • The second one will be for the service named Memory Usage

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

 

Start NSClient++ Service

Open the Run dialog (Windows Key + R)

Type:

services.msc

This opens the Services management console.

Find NSClient++ service

Right click it and select Start

Wait for the service to start

Close the services manangement console when service is started

 

Observe Nagios Log

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%;80;90
[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 (70%), virtual memory: Total: 8T - Used: 62.4M (0%) - Free: 8T (100%), paged bytes: Total: 4G - Used: 658M (16%) - Free: 3.36G (84%), page file: Total: 4G - Used: 658M (16%) - Free: 3.36G (84%)|'physical memory %'=30%;80;90 'physical memory'=616.89MB;1638.04;1842.8;0;2047.55 'virtual memory %'=0%;80;90 'virtual memory'=62.36MB;6710886.3;7549747.09;0;8388607.88 'paged bytes %'=16%;80;90 'paged bytes'=657.86MB;3276.09;3685.6;0;4095.11 'page file
[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%) - Free: 1.4G (70%), virtual memory: Total: 8T - Used: 62.4M (0%) - Free: 8T (100%), paged bytes: Total: 4G - Used: 658M (16%) - Free: 3.36G (84%), page file: Total: 4G - Used: 658M (16%) - Free: 3.36G (84%)|'physical memory %'=30%;80;90 'physical memory'=616.89MB;1638.04;1842.8;0;2047.55 'virtual memory %'=0%;80;90 'virtual memory'=62.36MB;6710886.3;7549747.09;0;8388607.88 'paged bytes %'=16%;80;90 'paged bytes'=657.86MB;3276.09;3685.6;0;4095.11 'page file
[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

NOTE: 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.

 

What about the Host itself?

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 , simply add this to nsc.ini:

[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] Error: External command failed -> PROCESS_HOST_CHECK_RESULT;DC02;0;Everything is working fine|
[1419217864] External command error: Command failed

 

More Examples

Different checks require different modules in NSClient++ to be enabled:

Disks

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

 

WMI Queries

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

 

Nagios Passive Host and Service Definitions

Don't forget to create passive host and service definitions for these inbound NSCA check results.

Here are some to compliment these examples.

 

Summary

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.

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

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

0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
NSCA Server - CentOS 6.5 and Nagios Core 4.0.x
Viewed 5581 times since Mon, Mar 16, 2015
Nagios XI - How to Use the NSCA Addon
Viewed 6650 times since Thu, Jan 28, 2016
NSCA Client - NSClient++ 0.4.1
Viewed 7757 times since Mon, Mar 23, 2015