NSClient++ 是 Nagios 監(jiān)控系統(tǒng)在 Windows 下的客戶端軟件。Nagios是一個(gè)監(jiān)視系統(tǒng)運(yùn)行狀態(tài)和網(wǎng)絡(luò)信息的監(jiān)視系統(tǒng)。Nagios能監(jiān)視所指定的本地或遠(yuǎn)程主機(jī)以及服務(wù),同時(shí)提供異常通知功能等
Nagios可運(yùn)行在Linux/Unix平臺(tái)之上,同時(shí)提供一個(gè)可選的基于瀏覽器的WEB界面以方便系統(tǒng)管理人員查看網(wǎng)絡(luò)狀態(tài),各種系統(tǒng)問題,以及日志等等。
Nagios主要功能特點(diǎn):
- 監(jiān)視網(wǎng)絡(luò)服務(wù) (SMTP, POP3, HTTP, NNTP, PING等)
- 監(jiān)視主機(jī)資源 (進(jìn)程, 磁盤等)
- 簡單的插件設(shè)計(jì)可以輕松擴(kuò)展Nagios的監(jiān)視功能
- 服務(wù)等監(jiān)視的并發(fā)處理
- 錯(cuò)誤通知功能 (通過email, pager, 或其他用戶自定義方法)
- 可指定自定義的事件處理控制器
- 可選的基于瀏覽器的WEB界面以方便系統(tǒng)管理人員查看網(wǎng)絡(luò)狀態(tài),各種系統(tǒng)問題,以及日志等等
- 可以通過手機(jī)查看系統(tǒng)監(jiān)控信息
更新日志:
NSClient++ 0.4.3.77 發(fā)布,此版本修復(fù)了一些問題,更新了文檔,添加了一些小的新特性!NSClient++ 0.4.3 beta 1 (build 40) 發(fā)布,此版本可能是可用性改進(jìn)最大的一次更新,作為一個(gè)小版本發(fā)布,但是 WEB-UI 方面的改進(jìn)非常大!
Web UI
無論是新用戶還是高級(jí)用戶都可以很方便的配置 NSClient++:
改進(jìn)的新 “測試模式”
重寫了 WEB 測試客戶端。
NRPE 增強(qiáng)
NRPE 實(shí)例默認(rèn)啟用多個(gè)包分支,提高了安全和認(rèn)證的用戶體驗(yàn)。提供了一個(gè)命令行客戶端來配置 NRPE:
nscp nrpe install Enabling NRPE via SSH from: 127.0.0.1 NRPE is currently reasonably secure using ${certificate-path}/certificate.pem and ${certificate-path}/certificate_key.pem. Arguments are NOT allowed.
重大改進(jìn):不再開箱支持 NRPE legacy
JSON!
所有的 protobuf 信息可以支持映射到對應(yīng)的 protobuf 信息,這意味著你可以使用 JSON 代替 protobuf。
Windows 下 NSClient++ 的安裝配置:
1.解壓到: C:\NSClient++
2.修改nsc.ini文件: allowed_hosts=192.168.X.X
3.注冊NSCient++的服務(wù): nsclient++ /install
4.在服務(wù)列表中找到NSClientpp的服務(wù)。雙擊打開該服務(wù)的配置窗口側(cè)在登錄分頁中將“允許服務(wù)與桌面交互”勾選上。
5.重啟NSClientapp服務(wù)。
配置
#############Windows Nsclient############
define service{
use generic-service
hostgroup_name windows-servers
service_description Uptime
check_command check_nt!UPTIME --> 系統(tǒng)運(yùn)行時(shí)間
}
define service{
use generic-service
hostgroup_name windows-servers
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90 --> 系統(tǒng)運(yùn)行負(fù)載
}
define service{
use generic-service
hostgroup_name windows-servers
service_description Memory Usage
check_command check_nt!MEMUSE!-w 90 -c 95 --> 系統(tǒng)內(nèi)存占用量
}
define service{
use generic-service
hostgroup_name windows-servers
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90 -->系統(tǒng)C盤磁盤空間
}
define service{
use generic-service
hostgroup_name windows-servers
service_description D:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l d -w 80 -c 90 -->系統(tǒng)D盤磁盤空間
define service{
use generic-service
host_name 192.168.185.4
service_description MMLogOrder
check_command check_nt!PROCSTATE!-d SHOWALL -l MakeMM.exe -->系統(tǒng)管理器中MakeMM.exe進(jìn)程存活性
}
排錯(cuò):
有一臺(tái)WINDOWS機(jī)器配好監(jiān)控后顯示下圖
nsclient++ 安裝" action-data="http%3A%2F%2Fs10.sinaimg.cn%2Fbmiddle%2F6d26f0a2gbfbcd9fe8069%26690" action-type="show-slide" style="margin: 0px; padding: 0px; border: 0px; list-style: none;" _src="http://pic.cr173.com/up/2015-1/2015012609222644748.jpg">
命令行測試發(fā)現(xiàn)
[root@all-wap service]# /usr/lib64/nagios/plugins/check_nt -H 192.168.145.3 -p 12489 -s xxx -v UPTIME
NSClient - ERROR: Could not get value
遠(yuǎn)程(cmd --> mstsc)登錄后執(zhí)行下列命令發(fā)現(xiàn)(紅色部分顯示countername 沒找到,貌似語言字符集問題)
C:\NSClient++>nsclient++ /test
d \PDHCollector.cpp(123) Found countername: CPU: \????(_total)\????
d \NSClient++.cpp(773) Loading plugin: NRPE server...
d \PDHCollector.cpp(124) Found countername: UPTIME: \????\????
d \PDHCollector.cpp(125) Found countername: MCL: \????\????
d \PDHCollector.cpp(126) Found countername: MCB: \????\????
e \PDHCollector.cpp(133) Failed to open performance counters: \????(_total)\???
: PdhAddCounter failed: -1073738824: 在系統(tǒng)上找不到指定的對象。
d \PDHCollector.cpp(169) We aparently failed to load counters trying to use def
ult (English) counters or those configured in nsc.ini
e \PDHCollector.cpp(178) Failed to open performance counters: \Memory\Commit Li
it: PdhAddCounter failed: -1073738824: The specified object is not found on the
system.
e \PDHCollector.cpp(212) No performance counters were found we will not wait fo
the end instead...
d \NSClient++.cpp(773) Loading plugin: NSClient server...
e \Socket.h(645) bind failed: 10048: 通常每個(gè)套接字地址(協(xié)議/網(wǎng)絡(luò)地址/端口)只允
許使用一次。
d \NSClient++.cpp(773) Loading plugin: SystemTray...
###################################
執(zhí)行下列命令解決
C:\NSClient++>lodctr /R
<-- lodctr命令備注:
lodctr /R:<Backup-FileName>
使用 <Backup-FileName> 還原 perf 注冊表字符串和信息
lodctr /R
基于當(dāng)前情況從頭開始重建 perf 注冊表字符串和信息
-->
C:\NSClient++>"NSClient++.exe" -stop
Stopping service.
C:\NSClient++>"NSClient++.exe" -start
Starting NSClientpp
重啟后在監(jiān)控主機(jī)上測試顯示獲取數(shù)據(jù)成功
[root@all-wap service]# /usr/lib64/nagios/plugins/check_nt -H 192.168.145.3 -p 12489 -s xxx -v UPTIME
System Uptime - 6 day(s) 0 hour(s) 7 minute(s)