<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Smemorando &#187; check_nt</title>
	<atom:link href="http://www.smemorando.com/tag/check_nt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smemorando.com</link>
	<description>la libertà non esiste, siamo tutti schiavi</description>
	<lastBuildDate>Wed, 02 Jun 2010 08:10:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Nagios NSClient++ per monitorare server Windows</title>
		<link>http://www.smemorando.com/2009/10/02/nagios-nsclient-per-monitorare-server-windows/</link>
		<comments>http://www.smemorando.com/2009/10/02/nagios-nsclient-per-monitorare-server-windows/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 18:58:07 +0000</pubDate>
		<dc:creator>Cristian</dc:creator>
				<category><![CDATA[Nagios]]></category>
		<category><![CDATA[check_nt]]></category>
		<category><![CDATA[check_nt_logon_errors]]></category>
		<category><![CDATA[check_nt_paging_file_useage]]></category>
		<category><![CDATA[check_nt_sql_server_connections]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[NSClient++]]></category>

		<guid isPermaLink="false">http://www.smemorando.com/?p=177</guid>
		<description><![CDATA[NSClient++ è un agent per server windows disponibile per sistemi X32, X64 ed Itanium che permette a Nagios di eseguire innumerevoli check a servizi, processi e molto altro. Una volta scaricata dal sito nsclient.org la versione corretta per il vostro sistema ed installata, basta personalizzare il file nsc.ini presente nella directory in cui è stato [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">NSClient++ è un agent per server windows disponibile per sistemi X32, X64 ed Itanium che permette a Nagios di eseguire innumerevoli check a servizi, processi e molto altro.</p>
<p style="text-align: justify;">Una volta scaricata dal sito <a href="http://nsclient.org/nscp/downloads" target="_blank" onclick="pageTracker._trackPageview('/outgoing/nsclient.org/nscp/downloads?referer=');">nsclient.org</a> la versione corretta per il vostro sistema ed installata, basta personalizzare il file nsc.ini presente nella directory in cui è stato installato l&#8217;agent così da attivare i moduli aggiuntivi necessario ed impostare una password di sicurezza che non è obbligatoria ma a mio avviso vivamente consigliata.</p>
<p style="text-align: justify;">E&#8217; bene anche controllare le impostazioni del servizio che è stato creato NSClientpp e inpostare sul Log On il flag su Local System account e Allow service to interact with desktop.</p>
<p style="text-align: center;"><a title="NSClient" href="http://www.smemorando.com/wp-content/uploads/2009/10/nsclient1-1024x497.gif" target="_blank"><img class="aligncenter size-large wp-image-185" title="nsclient" src="http://www.smemorando.com/wp-content/uploads/2009/10/nsclient1-1024x497.gif" alt="nsclient" width="531" height="257" /></a></p>
<p style="text-align: center;"><a title="NSClient" href="http://www.smemorando.com/wp-content/uploads/2009/10/nsclient2-1024x497.gif" target="_blank"><img class="aligncenter size-large wp-image-186" title="nsclient" src="http://www.smemorando.com/wp-content/uploads/2009/10/nsclient2-1024x497.gif" alt="nsclient" width="531" height="257" /></a></p>
<p style="text-align: justify;">Io ho installato una versione un pò vecchia, ho visto che ora c&#8217;è la 0.3.7&#8230;</p>
<p>Per attivare i moduli basta decommentare le righe associate ai moduli di cui si ha bisogno all&#8217;interno del file nsc.ini.</p>
<p>di seguito la parti minime da personalizzare sul file nsc.ini che comunque con l&#8217;ultima versione del client dovrebbe poter essere possibile impostare già dalla gui di installazione:</p>
<p><strong>[modules]<br />
;# NSCLIENT++ MODULES<br />
;# A list with DLLs to load at startup.<br />
;  You will need to enable some of these for NSClient++ to work.<br />
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !<br />
; *                                                               *<br />
; * N O T I C E ! ! ! &#8211; Y O U   H A V E   T O   E D I T   T H I S *<br />
; *                                                               *<br />
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !<br />
FileLogger.dll<br />
CheckSystem.dll<br />
CheckDisk.dll<br />
NSClientListener.dll<br />
NRPEListener.dll<br />
SysTray.dll<br />
CheckEventLog.dll<br />
CheckHelpers.dll<br />
;CheckWMI.dll<br />
;<br />
; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS!<br />
;RemoteConfiguration.dll<br />
; NSCA Agent is a new beta module use with care!<br />
NSCAAgent.dll<br />
; LUA script module used to write your own &#8220;check deamon&#8221; (sort of) early beta.<br />
LUAScript.dll<br />
; Script to check external scripts and/or internal aliases, early beta.<br />
CheckExternalScripts.dll<br />
; Check other hosts through NRPE extreme beta and probably a bit dangerous! <img src='http://www.smemorando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
NRPEClient.dll<br />
; Extreamly early beta of a task-schedule checker<br />
CheckTaskSched.dll</strong></p>
<p><strong>[Settings]<br />
;# OBFUSCATED PASSWORD<br />
;  This is the same as the password option but here you can store the password in an obfuscated manner.<br />
;  *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the<br />
;  password. Its just a bit harder to do it at first glance.<br />
;obfuscated_password=Jw0KAUUdXlAAUwASDAAB<br />
;<br />
;# PASSWORD<br />
;  This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly.<br />
password=</strong><span style="text-decoration: line-through;">QUI INSERISCO LA PASSWORD A PROTEZIONE DELL&#8217;AGENT</span><br />
<strong>;<br />
;# ALLOWED HOST ADDRESSES<br />
;  This is a comma-delimited list of IP address of hosts that are allowed to talk to the all daemons.<br />
;  If leave this blank anyone can access the deamon remotly (NSClient still requires a valid password).<br />
;  The syntax is host or ip/mask so 192.168.0.0/24 will allow anyone on that subnet access<br />
allowed_hosts=</strong><span style="text-decoration: line-through;">QUI INSERISCO L&#8217;IP DEL MIO SERVER NAGIOS</span><br />
&#8230;&#8230;&#8230;.</p>
<p>Ora che lato windows abbiamo ultimato la configurazione è necessario definire l&#8217;host, i servizi da monitorare ed inserire nei check presenti sul file command.cfg la password messa a protezione del client NSclient installato sul server windows.</p>
<p>Di seguito tutte le definizioni da inserire nei file di configurazione lato Nagios.</p>
<p>Riga da aggiungere nel file degli hosts.cfg <em>(che dovrà essere a sua volta incluso nel file di configurazione di nagios.cfg)</em></p>
<p><strong># Definizioni host 192.168.1.101<br />
define host{<br />
host_name                         192.168.1.101<br />
alias                                      192.168.1.101<br />
address                               192.168.1.101<br />
check_command            check-host-alive<br />
check_interval                5<br />
retry_interval                 1<br />
max_check_attempts  5<br />
check_period                  24&#215;7<br />
contact_groups              admins<br />
process_perf_data        0<br />
retain_nonstatus_information    0<br />
notification_interval           30<br />
notification_period             24&#215;7<br />
notification_options           d,u,r<br />
parents                                     192.168.1.1<br />
}<br />
</strong></p>
<p>Righe da aggiungere o modificare se già presenti nel file services.cfg</p>
<p><strong># Create a service for monitoring CPU USAGE<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     CPU Load<br />
check_command           check_nt!CPULOAD!-l 5,80,90<br />
}</strong></p>
<p><strong># Create a service for monitoring ping<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     PING<br />
check_command           check-host-alive<br />
}</strong></p>
<p><strong># Create a service for monitoring MEMORY USAGE<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     Memory Usage<br />
check_command           check_nt!MEMUSE!-w 80 -c 90<br />
}</strong></p>
<p><strong># Create a service for monitoring C:\ disk usage<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     C:\ Drive Space<br />
check_command           check_nt!USEDDISKSPACE!-l c -w 85 -c 95<br />
}</strong></p>
<p><strong># Create a service for monitoring S:\ disk usage<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     S:\ Drive Space<br />
check_command           check_nt!USEDDISKSPACE!-l s -w 85 -c 95<br />
}</strong></p>
<p><strong># Create a service for monitoring sql server connections<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     SQL Server connection<br />
check_command           check_nt_sql_server_connections<br />
}</strong></p>
<p><strong># Create a service for monitoring paging file useage<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     Utilizza file paging<br />
check_command           check_nt_paging_file_useage<br />
}</strong></p>
<p><strong># Create a service for monitoring error logs<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     Error logs<br />
check_command           check_nt_logon_errors<br />
}</strong></p>
<p><strong># Create a service for monitoring W3SVC service<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     W3SVC<br />
check_command           check_nt!SERVICESTATE!-d SHOWALL -l W3SVC<br />
}</strong></p>
<p><strong># Create a service for monitoring IIS Admin Service<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     IIS Admin Service<br />
check_command           check_nt!SERVICESTATE!-d SHOWALL -l IISADMIN<br />
}</strong></p>
<p><strong># Create a service for monitoring HTTS SSL service<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     HTTP SSL<br />
check_command           check_nt!SERVICESTATE!-d SHOWALL -l HTTPFilter<br />
}</strong></p>
<p><strong># Create a service for monitoring Windows TIME service<br />
define service{<br />
use                     generic-service<br />
host_name               192.168.1.101<br />
service_description     Servizio Windows TIME<br />
check_command           check_nt!SERVICESTATE!-d SHOWALL -l W32Time<br />
}</strong></p>
<p>righe da aggiungere o modificare se già presenti nel file commands.cfg</p>
<p><strong># &#8216;check_nt&#8217; command definition<br />
define command{<br />
command_name    check_nt<br />
command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s </strong><span style="text-decoration: line-through;">PASSWORD INSERITA NEL FILE NSC.INI</span><strong> -v $ARG1$ $ARG2$<br />
}</strong></p>
<p><strong># &#8216;check_nt&#8217; command definition per error log<br />
define command{<br />
command_name     check_nt_logon_errors<br />
command_line     $USER1$/check_nt -H $HOSTADDRESS$ -s </strong><span style="text-decoration: line-through;">PASSWORD INSERITA NEL FILE NSC.INI</span> <strong>-p 12489 -v COUNTER -l &#8220;\\Server\\Errors Logon&#8221;,&#8221;Logon Errors since last reboot is %.f&#8221; -w 50 -c 150<br />
}</strong></p>
<p><strong>#Paging File Usage<br />
define command{<br />
command_name     check_nt_paging_file_useage<br />
command_line     $USER1$/check_nt -H $HOSTADDRESS$ -s</strong> <span style="text-decoration: line-through;">PASSWORD INSERITA NEL FILE NSC.INI</span> <strong>-p 12489 -v COUNTER  -l &#8220;\\Paging File(_Total)\\% Usage&#8221;,&#8221;Paging file usage is %.2f %%&#8221; -w 30 -c 60<br />
}</strong></p>
<p><strong>#SQL Server Connections<br />
define command{<br />
command_name     check_nt_sql_server_connections<br />
command_line     $USER1$/check_nt -H $HOSTADDRESS$ -s</strong> <span style="text-decoration: line-through;">PASSWORD INSERITA NEL FILE NSC.INI</span> <strong>-p 12489 -v COUNTER -l &#8220;\\SQLServer:General Statistics\\User Connections&#8221;,&#8221;SQL Server Connections are %.f&#8221; -w 1500 -c 2000<br />
}</strong></p>
<p style="text-align: justify;">In conclusione una volta installato e configurato NSClient, definito il nuovo host, i nuovi services e i nuovi commands sui rispettivi file di configurazione  richiamati  dal file di configurazione di Nagios basta fare un  /etc/init.d/nagios reload e se non ci sono errori si dovrebbe ottenere qualcosa del genere.</p>
<p style="text-align: center;"><strong><a title="Nagios check_nt" href="http://www.smemorando.com/wp-content/uploads/2009/10/nagios.gif" target="_blank"><img class="aligncenter size-full wp-image-202" title="nagios" src="http://www.smemorando.com/wp-content/uploads/2009/10/nagios.gif" alt="nagios" width="576" height="461" /></a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smemorando.com/2009/10/02/nagios-nsclient-per-monitorare-server-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
