1、修改 /usr/local/nagios/etc/objects/commands.cfg  添加一个服务名

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

2、然后修改linux的模板

define service{
use generic-service
host_name host
service_description db
check_command check_3306
max_check_attempts
normal_check_interval
retry_check_interval
check_period 24x7
notification_interval
notification_period 24x7
notification_options w,u,c,r
}
05-11 22:15