添加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
}
页面效果如下
