服务器维护,服务器代维,安全设置,漏洞扫描,入侵检测服务

运维之家

 找回密码
 注册
搜索
查看: 4933|回复: 0

用nagios监控指定的端口

[复制链接]
dirtysea 发表于 2011-11-15 04:50:46 | 显示全部楼层 |阅读模式
某一台服务器需要监控4000端口
修改 /usr/local/nagios/etc/objects/commands.cfg  添加一个服务名


# check port 4000
define command{
        command_name    4000
        command_line    $USER1$/check_tcp -H $HOSTADDRESS$ -p 4000 $ARG2$
        }


然后修改linux的模板

vim  /usr/local/nagios/etc/objects/web1.cfg   添加一段

# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.
define service{
        use                             local-service         ; Name of service template to use
        host_name                     web1
        service_description            4000
        check_command                  4000
                is_volatile                     0
        check_period                    24x7
        max_check_attempts              2
        normal_check_interval           1
        retry_check_interval            1
        contact_groups                  admins
        notification_options            w,u,c,r
        notification_interval           960
        notification_period             24x7
        }


您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|运维之家

GMT+8, 2024-4-20 21:01 , Processed in 0.101284 second(s), 14 queries .

Powered by Dirtysea

© 2008-2020 Dirtysea.com.

快速回复 返回顶部 返回列表