Bii o ṣe le Ṣafikun Gbalejo Windows si Olupin Abojuto Nagios


Nkan yii ṣe apejuwe bawo ni lati ṣe atẹle awọn iṣẹ Windows “ikọkọ” gẹgẹbi fifuye Sipiyu, lilo Disiki, Lilo iranti, Awọn iṣẹ, ati bẹbẹ lọ Fun eyi, a nilo lati fi addon NSClient ++ sori ẹrọ Windows. Addoni naa ṣe aṣoju laarin ẹrọ Windows ati Nagios ati awọn diigi awọn iṣẹ gangan nipa sisọrọ pẹlu ohun itanna check_nt. Ohun itanna check_nt ti a ti fi sii tẹlẹ lori Server Monitoring Server, ti o ba tẹle itọsọna fifi sori Nagios wa.

A ro pe o ti fi sori ẹrọ tẹlẹ ati tunto olupin Nagios gẹgẹbi awọn itọsọna atẹle wa.

    Bii a ṣe le Fi Nagios 4.0.1 sori RHEL/CentOS 6.x/5.x ati Fedora 19/18/17
  1. Ṣafikun Gbalejo Linux si Server Abojuto Abojuto

Lati ṣetọju Awọn Ẹrọ Windows iwọ yoo nilo lati tẹle awọn igbesẹ lọpọlọpọ wọn si jẹ:

  1. Fi addon NSClient ++ sori ẹrọ Windows.
  2. Tunto Server Server Nagios fun ibojuwo Ẹrọ Windows.
  3. Ṣafikun ogun tuntun ati awọn asọye iṣẹ fun ibojuwo ẹrọ Windows.
  4. Tun Iṣẹ Nagios bẹrẹ.

Lati ṣe itọsọna yii rọrun ati rọrun, diẹ diẹ ninu iṣeto tẹlẹ ti ṣe fun ọ ni fifi sori Nagios.

  1. Itumọ aṣẹ aṣẹ check_nt ti tẹlẹ ṣafikun si faili command.cfg. A lo aṣẹ itumọ yii nipasẹ ohun itanna check_nt lati ṣe atẹle awọn iṣẹ Windows.
  2. Aṣeṣe olupin-windows olupin ti a ṣẹda tẹlẹ ninu faili awọn awoṣe.cfg. Awoṣe yii n gba ọ laaye lati ṣafikun awọn asọye alejo gbigba Windows.

Awọn faili meji ti o wa loke “command.cfg” ati awọn faili “templates.cfg” ni a le rii ni/usr/agbegbe/nagios/ati be be lo/awọn nkan/itọsọna. O le yipada ki o ṣafikun awọn itumọ tirẹ ti o baamu ibeere rẹ. Ṣugbọn, Emi yoo ṣeduro fun ọ lati tẹle awọn ilana ti a ṣalaye ninu nkan yii ati pe iwọ yoo ni abojuto mimojuto awọn ferese rẹ ni o kere ju iṣẹju 20.

Igbesẹ 1: Fifi NSClient ++ Agent sori Ẹrọ Windows

Jọwọ lo awọn itọnisọna isalẹ lati fi sori ẹrọ NSClient ++ Agent lori Ile-iṣẹ Windows Remote. Ni akọkọ ṣe igbasilẹ ẹya iduroṣinṣin tuntun NSClient ++ 0.3.1 awọn faili orisun addon, eyiti o le rii ni ọna asopọ isalẹ.

  1. http://sourceforge.net/projects/nscplus/

Lọgan ti o ba ti ṣe igbasilẹ ẹya iduroṣinṣin tuntun, ṣii awọn faili NSClient ++ sinu titun C:\NSClient ++ liana.

Bayi ṣii aṣẹ aṣẹ MS-DOS lati Ibẹrẹ Ibẹrẹ -> Ṣiṣe -> tẹ 'cmd' ki o tẹ tẹ ki o yipada si itọsọna C:\NSClient ++.

C:\NSClient++

Nigbamii, forukọsilẹ iṣẹ NSClient ++ lori eto pẹlu aṣẹ atẹle.

nsclient++ /install

Lakotan, fi sori ẹrọ systray NSClient ++ pẹlu aṣẹ atẹle.

nsclient++ SysTray

Ṣii Oluṣakoso Iṣẹ Windows ki o tẹ ọtun lori NSClient lọ si Awọn ohun-ini ati lẹhinna ‘Wọle Lori’ taabu ki o tẹ apoti ayẹwo ti o sọ “Gba iṣẹ laaye lati ṣe pẹlu tabili”. Ti ko ba gba laaye tẹlẹ, jọwọ ṣayẹwo apoti lati gba laaye si.

Ṣii faili NSC.INI ti o wa ni C:\NSClient ++ liana ati uncomment gbogbo awọn modulu ti a ṣalaye ni apakan “awọn modulu”, ayafi fun CheckWMI.dll ati RemoteConfiguration.dll.

[modules]
;# NSCLIENT++ MODULES
;# A list with DLLs to load at startup.
;  You will need to enable some of these for NSClient++ to work.
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
; *                                                               *
; * N O T I C E ! ! ! - Y O U   H A V E   T O   E D I T   T H I S *
; *                                                               *
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
SysTray.dll
CheckEventLog.dll
CheckHelpers.dll
;CheckWMI.dll
;
; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS!
;RemoteConfiguration.dll
; NSCA Agent is a new beta module use with care!
;NSCAAgent.dll
; LUA script module used to write your own "check deamon" (sort of) early beta.
;LUAScript.dll
; Script to check external scripts and/or internal aliases, early beta.
;CheckExternalScripts.dll
; Check other hosts through NRPE extreme beta and probably a bit dangerous! :)
;NRPEClient.dll

Uncomment awọn “laaye_hosts” ni apakan “Eto” ki o ṣalaye adiresi IP ti Oluṣakoso Abojuto Nagios rẹ tabi fi silẹ ni ofo lati gba eyikeyi awọn ọmọ-ogun laaye lati sopọ.

[Settings]
;# ALLOWED HOST ADDRESSES
;  This is a comma-delimited list of IP address of hosts that are allowed to talk to the all daemons.
;  If leave this blank anyone can access the deamon remotly (NSClient still requires a valid password).
;  The syntax is host or ip/mask so 192.168.0.0/24 will allow anyone on that subnet access
allowed_hosts=172.16.27.41

Uncomment “ibudo” ni apakan “NSClient” ati ṣeto si ibudo aiyipada ‘12489 '. Rii daju lati ṣii ibudo '12489' lori Firewall Windows.

[NSClient]
;# NSCLIENT PORT NUMBER
;  This is the port the NSClientListener.dll will listen to.
port=12489

Lakotan bẹrẹ iṣẹ NSClient ++ pẹlu aṣẹ atẹle.

nsclient++ /start

Ti o ba ti fi sii ati tunto rẹ daradara, o yẹ ki o wo aami tuntun ninu atẹ eto ni iyipo ofeefee pẹlu ‘M’ dudu dudu ninu.

Igbesẹ 2: Tito leto Server Server ati Ṣafikun Awọn ogun Windows

Bayi Wọle sinu Server Server Nagios ki o ṣafikun diẹ ninu awọn asọye ohun ni awọn faili iṣeto ni Nagios lati ṣetọju ẹrọ Windows tuntun. Ṣii faili windows.cfg fun ṣiṣatunkọ pẹlu olootu Vi.

 vi /usr/local/nagios/etc/objects/windows.cfg

Apẹẹrẹ asọye ogun Windows ti a ti ṣalaye tẹlẹ fun ẹrọ Windows, o le yipada ni irọrun asọye alejo bi host_name, inagijẹ, ati awọn aaye adirẹsi si awọn iye to yẹ ti ẹrọ Windows rẹ.

###############################################################################
###############################################################################
#
# HOST DEFINITIONS
#
###############################################################################
###############################################################################

# Define a host for the Windows machine we'll be monitoring
# Change the host_name, alias, and address to fit your situation

define host{
        use             windows-server  ; Inherit default values from a template
        host_name       winserver       ; The name we're giving to this host
        alias           My Windows Server       ; A longer name associated with the host
        address         172.31.41.53    ; IP address of the host
        }

Awọn iṣẹ atẹle ni a ti ṣafikun tẹlẹ ati muu ṣiṣẹ ni faili windows.cfg. Ti o ba fẹ lati ṣafikun diẹ ninu awọn itumọ iṣẹ miiran ti o nilo lati ni abojuto, o le fi awọn asọye wọnyẹn rọrun si faili iṣeto kanna. Rii daju lati yi orukọ olupin pada fun gbogbo awọn iṣẹ wọnyi pẹlu orukọ host_awọn asọye ni igbesẹ ti o wa loke.

define service{
	use			generic-service
	host_name		winserver
	service_description	NSClient++ Version
	check_command		check_nt!CLIENTVERSION
	}

Add the following service definition to monitor the uptime of the Windows server.

define service{
	use			generic-service
	host_name		winserver
	service_description	Uptime
	check_command		check_nt!UPTIME
	}

Add the following service definition to monitor the CPU utilization on the Windows server and generate a CRITICAL alert if the 5-minute CPU load is 90% or more or a WARNING alert if the 5-minute load is 80% or greater.

define service{
	use			generic-service
	host_name		winserver
	service_description	CPU Load
	check_command		check_nt!CPULOAD!-l 5,80,90
	}

Add the following service definition to monitor memory usage on the Windows server and generate a CRITICAL alert if memory usage is 90% or more or a WARNING alert if memory usage is 80% or greater.

define service{
	use			generic-service
	host_name		winserver
	service_description	Memory Usage
	check_command		check_nt!MEMUSE!-w 80 -c 90
	}

Add the following service definition to monitor usage of the C:\ drive on the Windows server and generate a CRITICAL alert if disk usage is 90% or more or a WARNING alert if disk usage is 80% or greater.

define service{
	use			generic-service
	host_name		winserver
	service_description	C:\ Drive Space
	check_command		check_nt!USEDDISKSPACE!-l c -w 80 -c 90
	}

Add the following service definition to monitor the W3SVC service state on the Windows machine and generate a CRITICAL alert if the service is stopped.

define service{
	use			generic-service
	host_name		winserver
	service_description	W3SVC
	check_command		check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
	}

Add the following service definition to monitor the Explorer.exe process on the Windows machine and generate a CRITICAL alert if the process is not running.

define service{
	use			generic-service
	host_name		winserver
	service_description	Explorer
	check_command		check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
	}

Ni ikẹhin, ṣoki faili windows.cfg ni /usr/local/nagios/etc/nagios.cfg.

 vi /usr/local/nagios/etc/nagios.cfg
# Definitions for monitoring a Windows machine
cfg_file=/usr/local/nagios/etc/objects/windows.cfg

Lakotan, ṣayẹwo awọn faili atunto Nagios fun eyikeyi erros.

 /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check

Ti ilana ijerisi ba ju eyikeyi awọn ifiranṣẹ aṣiṣe, ṣatunṣe awọn aṣiṣe wọnyẹn titi ilana ijerisi yoo pari laisi awọn ifiranṣẹ aṣiṣe eyikeyi. Ni kete ti o ba ṣatunṣe awọn aṣiṣe wọnyẹn, tun bẹrẹ iṣẹ Nagios.

 service nagios restart

Running configuration check...done.
Stopping nagios: done.
Starting nagios: done.

O n niyen. Nisisiyi lọ si wiwo wẹẹbu Abojuto ti Nagios ni\"http:// Your-server-IP-address/nagios" tabi\"http:// FQDN/nagios" ati Pese orukọ olumulo\"nagiosadmin" ati ọrọ igbaniwọle. Ṣayẹwo pe Latọna jijin A fi kun Ogun Windows ati pe o n ṣe abojuto.

O n niyen! fun bayi, ninu nkan ti n bọ mi Emi yoo fi ọ han bi o ṣe le ṣafikun Itẹwe ati Awọn iyipada si Server Monitoring Nagios. Ti o ba ni awọn iṣoro eyikeyi lakoko fifi Windows ogun si Nagios. Jọwọ ṣe asọye awọn ibeere rẹ nipasẹ apakan asọye, titi di igba naa ki o duro si linux-console.net fun iru iru awọn nkan ti o niyelori diẹ sii.