이 문서에서는 Windows를 모니터링하는 방법을 설명합니다. 머신 '비공개 CPU 로드와 같은 서비스 , 디스크 사용량 , 메모리 사용량, 서비스 등. 이를 위해 NSClient++를 설치해야 합니다. Windows의 애드온 기계. 애드온은 Windows 사이에서 프록시 역할을 합니다. 기계 및 Nagios check_nt와 통신하여 실제 서비스를 모니터링합니다. 플러그인. check_nt Nagios 모니터링 서버에 플러그인이 이미 설치되어 있습니다. , 저희 Nagios를 팔로우하셨다면 설치 가이드.
Nagios를 이미 설치하고 구성했다고 가정합니다. 다음 지침에 따라 서버를 운영하세요.
- RHEL/CentOS 6.x/5.x 및 Fedora 19/18/17에 Nagios 4.0.1을 설치하는 방법
- Nagios 모니터링 서버에 Linux 호스트 추가
Windows 컴퓨터를 모니터링하려면 다음과 같은 몇 가지 단계를 수행해야 합니다.
- Windows 시스템에 NSClient++ 애드온을 설치합니다.
- Windows 머신 모니터링을 위해 Nagios 서버를 구성합니다.
- Windows 시스템 모니터링을 위한 새로운 호스트 및 서비스 정의를 추가합니다.
- Nagios 서비스를 다시 시작하세요.
이 가이드를 간단하고 쉽게 만들기 위해 Nagios에서 몇 가지 구성이 이미 완료되었습니다. 설치.
- check_nt 명령 정의가 command.cfg에 이미 추가되었습니다. 파일. 이 정의 명령은 check_nt에서 사용됩니다. Windows 서비스를 모니터링하는 플러그인.
- Windows 서버 호스트 템플릿 templates.cfg에 이미 생성되었습니다. 파일. 이 템플릿을 사용하면 새로운 Windows 호스트 정의를 추가할 수 있습니다.
위의 두 파일 “command.cfg ' 및 'templates.cfg ” 파일은 /usr/local/nagios/etc/objects/에서 찾을 수 있습니다. 디렉토리. 요구 사항에 맞게 정의를 수정하고 추가할 수 있습니다. 하지만 이 문서에 설명된 지침을 따르는 것이 좋습니다. 그러면 20분 이내에 Windows 호스트를 성공적으로 모니터링할 수 있습니다. .
1단계:Windows 시스템에 NSClient++ 에이전트 설치
NSClient++ 에이전트를 설치하려면 아래 지침을 따르세요. 원격 Windows 호스트에서 . 먼저 최신 안정 버전인 NSClient++ 0.3.1을 다운로드하세요. 애드온 소스 파일은 아래 링크에서 확인하실 수 있습니다.
- http://sourceforge.net/projects/nscplus/
최신 안정 버전을 다운로드한 후 NSClient++의 압축을 푸세요. 파일을 새 C:\NSClient++ 디렉터리입니다.
이제 MS-DOS를 엽니다. 시작 화면의 명령 프롬프트 –> 실행 –> 'cmd를 입력하세요. '를 누르고 Enter를 누르고 C:\NSClient++로 변경합니다. 디렉터리입니다.
C:\NSClient++
다음으로 NSClient++를 등록하세요. 다음 명령을 사용하여 시스템에 서비스를 제공하세요.
nsclient++ /install
마지막으로 NSClient++ 시스템 트레이를 설치합니다. 다음 명령을 사용하세요.
nsclient++ SysTray
Windows 서비스 관리자를 엽니다. NSClient를 마우스 오른쪽 버튼으로 클릭하세요. 속성으로 이동하세요. 그런 다음 '로그온 ' 탭을 클릭하고 '서비스가 데스크톱과 상호작용하도록 허용' 확인란을 클릭합니다. “. 아직 허용되지 않은 경우 확인란을 선택하여 허용하세요.
NSClient++ 설치 NSC.INI를 엽니다. C:\NSClient++에 있는 파일 디렉토리를 열고 '모듈에 정의된 모든 모듈의 주석 처리를 제거합니다. ” 섹션(CheckWMI.dll 제외) 및 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
'allowed_hosts의 주석 처리를 제거하세요. '를 '설정에서 ” 섹션을 클릭하고 IP 주소를 정의합니다. Nagios 모니터링 서버 또는 모든 호스트가 연결할 수 있도록 비워두세요.
[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
'포트의 주석 처리를 해제하세요. ''를 'NSClient에서 ” 섹션을 선택하고 기본 포트 '12489로 설정합니다. '. '12489를 열어야 합니다. Windows 방화벽의 ' 포트 .
[NSClient] ;# NSCLIENT PORT NUMBER ; This is the port the NSClientListener.dll will listen to. port=12489
마지막으로 NSClient++를 시작합니다. 다음 명령으로 서비스를 받으세요.
nsclient++ /start
올바르게 설치 및 구성되면 시스템 트레이에 검정색 'M이 있는 노란색 원 안에 새 아이콘이 표시됩니다. ' 안에.
2단계:Nagios 서버 구성 및 Windows 호스트 추가
이제 Nagios 서버에 로그인하세요. 객체 정의를 추가하세요. 나기오스에서 새로운 Windows를 모니터링하기 위한 구성 파일 기계. windows.cfg를 엽니다. Vi로 편집할 파일 편집자.
[root@tecmint]# vi /usr/local/nagios/etc/objects/windows.cfg
Windows 시스템에 대해 이미 정의된 샘플 Windows 호스트 정의이므로 host_name과 같은 호스트 정의를 간단히 변경할 수 있습니다. , 별칭 및 주소 필드를 Windows의 적절한 값으로 설정 기계.
###############################################################################
###############################################################################
#
# 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
} 다음 서비스는 이미 windows.cfg에 추가되어 활성화되어 있습니다. 파일. 모니터링해야 하는 다른 서비스 정의를 더 추가하려면 해당 정의를 동일한 구성 파일에 간단히 추가하면 됩니다. host_name을 변경하세요. host_name을 사용하는 모든 서비스에 대해 위 단계에서 정의했습니다.
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
} 마지막으로 windows.cfg의 주석 처리를 제거합니다. /usr/local/nagios/etc/nagios.cfg에 있는 파일 .
[root@tecmint]# vi /usr/local/nagios/etc/nagios.cfg
# Definitions for monitoring a Windows machine cfg_file=/usr/local/nagios/etc/objects/windows.cfg
마지막으로 Nagios를 확인합니다. 모든 오류에 대한 구성 파일입니다.
[root@tecmint]# /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
확인 프로세스에서 오류 메시지가 표시되면 오류 메시지 없이 확인 프로세스가 완료될 때까지 해당 오류를 수정하세요. 해당 오류를 수정한 후 Nagios 서비스를 다시 시작하세요.
[root@tecmint]# service nagios restart Running configuration check...done. Stopping nagios: done. Starting nagios: done.
그게 다야. 이제 "http://Your-server-IP-address/nagios의 Nagios 모니터링 웹 인터페이스로 이동합니다. ” 또는 “http://FQDN/nagios ” 및 사용자 이름 “nagiosadmin을 제공합니다. ” 및 비밀번호. 원격 Windows 호스트를 확인하세요. 추가되어 모니터링 중입니다.
Nagios 모니터 Windows 호스트 그게 다야! 지금은 다음 기사에서 프린터를 추가하는 방법을 보여 드리겠습니다. 및 스위치 Nagios 모니터링 서버로 . Windows를 추가하는 데 어려움이 있는 경우 Nagios 호스트 . 댓글 섹션을 통해 질문에 대해 댓글을 달아주세요. 그때까지 Tecmint.com을 계속 지켜봐 주시기 바랍니다. 이런 귀중한 기사가 더 많이 나오길 바랍니다.