nagios监控windows USBKEY
1、安裝NSClient++
安裝輸入Nagios服務IP地址
密碼可為空
勾選Enable common check plugins
? ?Enable nsclient server (check_nt)
Enable NRPE server (check_nrpe)
默認配置實現監控硬盤空間、CPU負載、內存等信息:
被監控端(Windows服務器)配置自帶防火墻例外或者關閉自帶防火墻,開放TCP 5666和TCP 12489端口。
Nagios服務器端:
2、配置/usr/local/nagios/etc/nagios.cfg,將如下一行前面的注釋取消:
cfg_file=/usr/local/nagios/etc/objects/windows.cfg 添加如下
define service{
? ? ? ?use ? ? ? ? ? ? ? ? ? ? generic-service
? ? ? ?host_name ? ? ? ? ? ? ? winserver
? ? ? ?service_description ? ? check_key
? ? ? ?check_command ? ? ? ? ? check_nrpe!check_key ? ?####check_key這個參數是在windows客戶端定義
? ? ? ?}
cfg_file=/usr/local/nagios/etc/objects/commands.cfg ? 添加如下
# 'check_nt' command definition
define command{
? ? ? ?command_name ? ?check_nt
? ? ? ?command_line ? ?$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
? ? ? ?}
# 'check_nrpe' command definition
define command{
? ? ? ?command_name ? ?check_nrpe
? ? ? ?command_line ? ?$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
? ? ? ?}
3、NSClient++參數設置
[modules] ? ? ##開啟模塊,
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
SysTray.dll
CheckEventLog.dll
CheckHelpers.dll
CheckWMI.dll
script_dir="C:\Program Files\NSClient++\scripts\"
[Settings]
use_file=1
allowed_hosts=192.168.20.137
[NSClient]
port=12489
allowed_hosts=192.168.20.137
[NRPE]
port=5666
allowed_hosts=192.168.20.137
[Script Wrappings]
vbs=cscript.exe T:30 NoLogo scripts\lib\wrapper.vbs %SCRIPT% %ARGS%
ps1=cmd /c echo scripts\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
bat=scripts\%SCRIPT% %ARGS%
[External Scripts]
check_es_long=scripts\long.bat
check_es_ok=scripts\ok.bat
check_es_nok=scripts\nok.bat
check_vbs_sample=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs
check_powershell_warn=cmd /c echo scripts\powershell.ps1 | powershell.exe -command -
[NRPE Handlers]
check_key=scripts\check_key.bat $ARG1$
nrpe_ok=scripts\ok.bat
4、把目錄filechack的所有文件放到c:\windows\system32\
filechac是查找文件的程序
轉載于:https://blog.51cto.com/teazj/1341652
總結
以上是生活随笔為你收集整理的nagios监控windows USBKEY的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 你需要的不是重构,而是理清业务逻辑(转)
- 下一篇: C语言初学者代码中的常见错误与瑕疵(9)