1、修改 /usr/local/nagios/etc/objects/commands.cfg 添加一个服务名
# check port 4000 define command{ command_name 3306 command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 3306 $ARG2$ }
2、然后修改linux的模板
define service{ use generic-service host_name host service_description db check_command check_3306 max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r }