nagios监控windows服务器远程桌面3389端口

来源:互联网 发布:出租车司机滴滴软件 编辑:程序博客网 时间:2024/06/05 23:39

添加check_3389脚本插件

vim  /opt/nagios/nagiosweb/libexec/check_3389
#!/bin/sh
/opt/nagios/nagiosweb/libexec/check_tcp -H $1 -p 3389 -t 3 > /dev/null
if [[ $? == 0 ]]
   then
   echo "CRITICAL:3389 open"
   exit  2
else
   echo "OK:3389 close"
   exit  0
fi


-------------------------------------------------------------------

添加监控命令

vim /opt/nagios/nagiosweb/etc/objects/commands.cfg

define command{
        command_name    check_3389
        command_line    $USER1$/check_3389 $HOSTADDRESS$
        }

 

-------------------------------------------------------------------------

添加nagios监控服务和主机
define host{
        use             windows-server  ;
        host_name       kan34   ;
        alias           kan34   ;
        address         118.26.230.34 ;
        }

 

define service{
        use                     generic-service
        host_name       kan34   ; The name we're giving to this host
        service_description     TCP3389
        check_command           check_3389
        }

页面效果如下

原创粉丝点击