LinuxEye - Linux系统教程

LinuxEye - Linux系统教程

当前位置: 主页 > Linux配置 >

nagios监控windows主机配置

时间:2012-09-25 11:25来源:CU 编辑:admin 点击:
1.首先在要监控的windows主机上安装NSClient++( http://pan.baidu.com/share/link?shareid=61858uk=3053463922 ) 在Allowed hosts中输入监控端的ip。 在防火墙中添加12489端口的例外: 在监控端执行命令测试,

1.首先在要监控的windows主机上安装NSClient++

NSClient++下载地址:http://pan.baidu.com/share/link?shareid=61858&uk=3053463922#

 
在Allowed hosts中输入监控端的ip。
 
在防火墙中添加12489端口的例外:
 
在监控端执行命令测试,如果返回数据,表示NSClient++安装正常:
# /usr/local/nagios/libexec/check_nt -H xxx.xxx.xxx.xxx -p 12489 -v UPTIME
System Uptime - 5 day(s) 1 hour(s) 34 minute(s)
 

2.在监控端配置对windows主机的各种系统资源的监控配置:

1)首先在nagios.cfg中配置相关的配置文件的位置

...
cfg_file=/usr/local/nagios/etc/objects/windows.cfg
...

2)配置上面定义的windows.cfg文件,定义要监控的host和service

...
define host{
        use             windows-server  ; 使用windows-server模板
        host_name       winserver       ; 定义主机名
        alias           My Windows Server       ; 定义主机别名
        address         xxx.xxx.xxx.xxx   ; 定义监控机的ip
        }
 
define service{
        use                     generic-service
        host_name               winserver
        service_description     NSClient++ Version
        check_command           check_nt!CLIENTVERSION
        }
 
define service{
        use                     generic-service
        host_name               winserver
        service_description     Uptime
        check_command           check_nt!UPTIME
        }
...
 

3)配置完成后使用命令检查配置文件是否有错:

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

4)没有错误报告的话,重启nagios服务

service nagios restart
 

3.使用http://ip/nagios进行访问,查看监控状态

转载请保留固定链接: https://linuxeye.com/configuration/813.html

------分隔线----------------------------
标签:nagios监控windows
栏目列表
推荐内容