nagios 监控windows环境简要说明

linux客户端需要安装nrpe,windows中的nrpe名字叫 NSClient++或者nscp
服务器端监控windows可以通过三种方式
check_snmp
check_nt  安装完nscp就可以直接调用,命令已集成在module目录的.dll文件中
eg:check_command           check_nt!CPULOAD!-l 5,80,90
check_nrpe 首先需要在nsclient.ini中配置监控命令别名,然后才能在nagios中调用
eg:
windows端
; alias_cpu - Alias for alias_cpu. To configure this item add a section called: /settings/external scripts/alias/alias_cpu
alias_cpu = checkCPU warn=80 crit=90 time=5m time=1m time=30s
Linux 端
[root@majian libexec]# ./check_nrpe -H 192.168.253.129 -c alias_cpu
OK CPU Load ok.|'5m'=14%;80;90 '1m'=2%;80;90 '30s'=1%;80;90

nscp支持的自定义脚本有三种,vbs,bat,ps
在nsclient.ini.ini中添加配置如下:
[/settings/external scripts/scripts]
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\vbs.vbs
bat= scripts\\lib\\bat.bat
;ps1=cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -


将vbs.vbs,bat.bat等脚本放到 script/lib目录中


[root@majian libexec]# ./check_nrpe -H 192.168.253.129 -c vbs
hello majian
[root@majian libexec]# ./check_nrpe -H 192.168.253.129 -c bat
OK: AAAEverything is going to be OK!HELLO
[root@majian libexec]# 

Section: /settings/external scripts/wrappings
Keys:
Key Title Description
vbs VISUAL BASIC WRAPPING
bat BATCH FILE WRAPPING
ps1 POWERSHELL WRAPPING
Sample:

vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\vbs.vbs
bat= scripts\\lib\\bat.bat
ps1=cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -


参考文档:
http://nsclient.org/nscp/wiki/CheckExternalScripts


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14594028/viewspace-1247936/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/14594028/viewspace-1247936/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值