Академический Документы
Профессиональный Документы
Культура Документы
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.
Click N e xt
Click N e xt
Click N e xt
Click N e xt
Allowed hosts
NSClient Password
Click N e xt
Click Ins ta ll
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.
Type:
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
[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.
NSClient++ uses checks build into it's CheckSystem module, specfically checkCPU
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
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:
Type:
tail -f /usr/local/nagios/var/nagios.log
[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
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"
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.
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.