Está en la página 1de 6

Nagios 'I ( Configuring The )indows Agent

The Industry Standard in IT Infrastructure Monitoring


Purpose
This document describes the procedures for configuring the Nagios monitoring agent on a target Microsoft Windows desktop or server for the purposes of monitoring that machine with either Nagios XI or Nagios Core.

Target Audience
This document is intended for use by Nagios Administrators and IT desktop support staff who are fami iar with insta ing Windows app ications and configuring Nagios XI or Nagios Core to monitor Windows machines.

Agent Overview
The N!C ient"" agent must be insta ed on the target Windows machine and configured before Nagios can monitor system metrics# services# processes# or performance data on the target machine. If you haven$t insta ed the N!C ient"" agent on the remote machine that you want to monitor# p ease# refer to our documentation on insta ing the XI Windows agent here.

Configuring NSClient++ ver. .!."


%pen the configuration fi e &'N!C.ini( fi e) in a te*t editor for editing. +sua y# the fi e is ocated in, -C,./rogram 0i es.N!C ient" ".N!C.ini-. The fi e has a severa sections# denoted with section name in brackets. 1et$s review the most important sections# and the changes that need to be made. #$odules% This is a ist of modu es to oad at startup. The modu es can be enab ed by uncommenting them &removing the semi2co on '3( in front of the modu e name. #Settings% This section has generic options for N!C ient"". !ome of these settings &such as a owed4hosts) are inherited in the sections be ow so it is probab y a better idea to set them here in the -g oba - section. The most important options under this section are, password: If no password is set everyone will be able to use this service remotely. allowed_hosts: A coma separated list with hosts that are allowed to connect and query data. You need to put the Nagios XI server's I here. If this is empty all hosts will be allowed to query data. !"#A$": N%&lient'' will not resolve the I address of (N% entries if the service is set to startup automatically. )se an I address instead. use_file: *as to be set to + if you want the file to be read ,if set to -. and the use/reg is set to + the registry will be used instead0

Nagios *nterprises+ ,,C P.O. 3o" 0&45 Saint Paul+ MN 44& 0 -SA

-S. &/000/NA1IOS/& Int6l. +& 74&/8 5/9& 8 ;a". +& 74&/8 5/9& !

)e2. www.nagios.co$ *$ail. sales:nagios.co$

Page &
Copyright 5 6788 Nagios 9nterprises# 11C :evision 8.7 ; <une# 678=

Nagios 'I ( Configuring The )indows Agent


#log% The defau t og fi e is 'nsc ient. og(. It is ocated in the same directory as the 'N!C.ini( fi e. >ou can specify whether you want debug messages printed in the og fi e. debug ? 8 fi e ? nsc ient. og #NSClient% +nder this section you can specify the hosts that are a owed to connect to N!C ient"" via N!C ient protoco # if you haven$t done so in the genera '!ettings( section. The port the N!C ient1istener.d wi isten to is a so specified in this section ,default port 1 +23450 as we as the socket timeout. #N<P*% In this section you can specify the hosts# a owed to connect via N:/9# the port number &defau t port ? @AAA)# and a few other options# such as use4ss # a ow4arguments# a ow4nasty4meta4chars# etc. The a ow4arguments option is simi ar to the N:/9 'don$t4b ame4nrpe( option. It determines whether arguments are accepted on the incomint socket. The a ow4nasty4meta4chars a ows N:/9 e*ecution of e*terna commands that have 'nasty( meta characters# such as 'B(# etc. The command4timeout specifies the ma*imum number of seconds that the N:/9 daemon wi a ow p ugins to finish e*ecuting before ki ing them off. #*"ternal Script% The options in the section are simi ar to the ones in the N:/9 section. command/timeout16allow/arguments1+ allow/nasty/meta/chars1+ #*"ternal Scripts% This section contains a ist of scripts and their a iases avai ab e to run from the Check9*terna !cripts modu e. !ynta* is, CcommandB?CscriptB CargumentsB #*"ternal Alias% An a ias is an interna command that has been -wrapped- &to add arguments). A iases are good for defining commands oca y or Dust to simp y the nagios configuration. There is a series of -usefu - a iases pre2defined in the inc uded configuration fi e which is a good p ace to start.

Nagios *nterprises+ ,,C P.O. 3o" 0&45 Saint Paul+ MN 44& 0 -SA

-S. &/000/NA1IOS/& Int6l. +& 74&/8 5/9& 8 ;a". +& 74&/8 5/9& !

)e2. www.nagios.co$ *$ail. sales:nagios.co$

Page 8
Copyright 5 6788 Nagios 9nterprises# 11C :evision 8.7 ; <une# 678=

Nagios 'I ( Configuring The )indows Agent


#NSCA Agent% There are severa options avai ab e for configuring the N!CA modu e. The 'interva ( is the time in seconds between each report back to the nagios server. The 'nsca4host( is the N!CA &Nagios) server to report resu ts to. nsca/host17Nagios XI server I 8 The 'nsca4port( is the N!CA server port &port @AAE is the defau t port). nsca/port1966: The 'encryption4method( has to be the same as the decryption method used on the N!CA &Nagios) serverF >ou can se ect a number# corresponding to the encryption a gorithm you wou d ike to use. The 'password( has to be the same as on the N!CA &Nagios) serverF password17some password8 #NSCA Co$$ands% This is a ist of commands to run and submit each time we report back to the N!CA server. There are some 'pre2defined( commands. If you wou d ike to use them# a you wi need to do is to un2comment them. This is Dust a basic overview of the most common configuration options. 0or more information on configuring N!C ient"" ver. 7.=.*# p ease# go to, http,GGwww.nsc ient.orgGnscpGwikiGdocGconfigurationG7.=.*

Configuring NSClient++ ver. .5."


The configuration fi e in N!C ient"" ver. 7.H.* has been renamed from 'N!C.ini( to 'nsc ient.ini(. +sua y# the fi e is ocated in, -C,./rogram 0i es.N!C ient"".nsc ient.ini-. When you open the configuration fi e in a te*t editor# you wi notice that it has ess options set by defau t# compared to the 'o d( N!C.ini fi e. >ou can fi the fi e in with a avai ab e options by opening a I%! Command /rompt# and running the fo owing commands, cd ;&:< rogram =iles<N%&lient''> nscp settings ??generate ??add?defaults @load?all Note: Not all of the modules are supported. yet so don't get alarmed if you see some A=ailed to register plugin> errors. Bhe Ansclient.ini> file should now be populated with all of the available configuration options. #=$odules% >ou can enab eGdisab e a modu e by setting its va ue to '8( or '7(# for e*amp e, &hecC(isC 1 + &hecC"ventDog 1 + %EB &lient 1 %cheduler 1 +

Nagios *nterprises+ ,,C P.O. 3o" 0&45 Saint Paul+ MN 44& 0 -SA

-S. &/000/NA1IOS/& Int6l. +& 74&/8 5/9& 8 ;a". +& 74&/8 5/9& !

)e2. www.nagios.co$ *$ail. sales:nagios.co$

Page !
Copyright 5 6788 Nagios 9nterprises# 11C :evision 8.7 ; <une# 678=

Nagios 'I ( Configuring The )indows Agent


#=settings=default% As in the 'N!C.ini( fi e &ver. 7.=.*)# here you can set 'a owed hosts(# 'password(# etc. There are some additiona options as we , cache allowed hosts: You can set this to Atrue> if you want hostnames to be cached for improving speed. inboF: Bhe default channel to post incoming messages on. timeout: Bimeout when reading pacCets on incoming socCets. If the data has not arrived within this time we will bail out. use ssl )sed to enableGdisable %%D encryption #=settings=e"ternal scripts=alias% This section contains a ist of a iases that are avai ab e. An a ias is an interna command that has been -wrapped- &to add arguments). Je carefu so you don$t create oops &ie check4 oop?check4a# check4a?check4 oop). #=settings=N<P*=server% The options that can be configured here are, allow arguments: Bhis option determines whether or not we will allow clients to specify arguments to commands that are eFecuted. port: ort to use for N$ " ,the default port is 96660. allow nasty characters: Bhis option determines whether or not we will allow clients to specify nasty ,as in HIJ87';<KLMN0 characters in arguments. #=settings=NSCA=server% These are the most common y used options in this section, encryption: Bhe Aencryption/method> has to be the same as the decryption method used on the N%&A ,Nagios0 serverO Bhe available encryptions are: -1No "ncryption ,not safe0 +1XP$ 21("% Q1("%?"("Q 31&A%B?+24 61XB"A 41!lowfish 51Bwofish ++1$&2 +31A"% +91A"% +61A"% 2-1%erpent 2Q1RP%B

Nagios *nterprises+ ,,C P.O. 3o" 0&45 Saint Paul+ MN 44& 0 -SA

-S. &/000/NA1IOS/& Int6l. +& 74&/8 5/9& 8 ;a". +& 74&/8 5/9& !

)e2. www.nagios.co$ *$ail. sales:nagios.co$

Page 5
Copyright 5 6788 Nagios 9nterprises# 11C :evision 8.7 ; <une# 678=

Nagios 'I ( Configuring The )indows Agent


performance data: %end performance data bacC to nagios ,set this to - to remove all performance data0. password: assword to use. ort: ort to use for N%&A ,the default port is 966:0. This is Dust a basic overview of the most common configuration options. 0or more information on configuring N!C ient"" ver. 7.H.*# p ease# go to, http,GGwww.nsc ient.orgGnscpGwikiGdocGconfigurationG7.H.*

3asic Trou2leshooting Tips


The most common prob ems# regarding the use of N!C ient"" with Nagios are, 8. Misconfiguration in N!C.iniGnsc ient.ini fi e# which may inc ude the fo owing, Modu es that you need to use are sti commented out /assword is not set or a wrong password is used on the Nagios side Nagios server$s I/ is not added to the 'a owed4hosts( ine The 'a ow4arguments?7(# and you are trying to pass arguments The 'Check9*terna !cripts.d ( is commented out# but you are trying to run a script >ou forgot to restart the N!C ient"" service after modifying the config fi e & N!C.iniGnsc ient.ini) 6. 0irewa issues, Make sure a ports that need to be open can be access from the Nagios server &port 86HKL for N!C ient""# port @AAA for N:/9# and port @AAE for N!CA) >ou can test if port is accessib e by using te net or nc# for e*amp e, telnet 7client/I 8 7port/number8 nc ?Sv 7client/I 8 7port/number8 If the port is not accessib e you wi see a 'Connection refused( message. Note: If you don't have telnet or nc installed on the Nagios server. you can install them by running in terminal: yum install telnet nc ?y =. To troub eshoot issues# you can review the nsc ient"" og fi e &nsc ient. og). The fi e is usua y ocated in 'C,./rogram 0i es.N!C ient" ".(. >ou can open it in a te*t editor &Notepad# or better yet ; Notepad"") for review. >ou can run a check from your Nagios server against the c ient machine and then check the nsc ient. og for errors. H. A good way to find and so ve prob ems is to run nsc ient"" in -test- mode. This is done by stopping the service and starting it in -testmode. >ou can do this from the I%! Command /rompt &you may need to run it as administratorF), In ver .!.". net stop nsclientpp cd ;c:< rogram =iles<N%&lient''; nsclient'' Gtest To e*it the 'test( mode and start the service# run, eFit net start nsclientpp

Nagios *nterprises+ ,,C P.O. 3o" 0&45 Saint Paul+ MN 44& 0 -SA

-S. &/000/NA1IOS/& Int6l. +& 74&/8 5/9& 8 ;a". +& 74&/8 5/9& !

)e2. www.nagios.co$ *$ail. sales:nagios.co$

Page 4
Copyright 5 6788 Nagios 9nterprises# 11C :evision 8.7 ; <une# 678=

Nagios 'I ( Configuring The )indows Agent


In ver .5.". net stop nscp cd ;c:< rogram =iles<N%&lient''; nscp test To e*it the 'test( mode and start the service# run, eFit net start nscp Whi e you are in a 'test( mode# you can run a check from the Nagios server against the c ient machine# and observe the output for errors. @. +pgrading the N!C ient"" version is fair y easy but many users have issues with converting the configuration fi es. According to Michae Medin# there are two options &Muote from http,GGnsc ient.orgGnscpGdiscussionGmessageG6L8A), )se the old configuration format ,rename the file to nsc.ini0 &onvert it to the new format If you decide to go with option one ,use the old format0 you have to understand it will not be supported indefinately and there are a lot of features you will not be able to use. Bo do this simply rename the file to nsc.ini and maCe sure there is no nsclient.ini avalible then it will be used as?is. If you go with option two ,convert0 there are built?in tools to convert the configuration file for you but they are 59T not +--T so if you have done customSations it is a good idea to looCit over to maCe sure it is still as you eFpect it. &onverting it liCe so: rename nsclient.ini to nsc.ini maCe sure you do not have nsclient.ini run: nscp settings ??migrate?to ini checC generated nsclient.ini for issues bacCup and delete nsc.ini A. If you are sti having issues with using Nagios with N!C ient""# p ease# post your Muestions on the Nagios !upport 0orum. Thank youF

Nagios *nterprises+ ,,C P.O. 3o" 0&45 Saint Paul+ MN 44& 0 -SA

-S. &/000/NA1IOS/& Int6l. +& 74&/8 5/9& 8 ;a". +& 74&/8 5/9& !

)e2. www.nagios.co$ *$ail. sales:nagios.co$

Page 7
Copyright 5 6788 Nagios 9nterprises# 11C :evision 8.7 ; <une# 678=

También podría gustarte