FreeBSD 下用nagios来监控网络服务器和网络服务(8)

service_description         mysql

is_volatile               0

check_period             24×7

max_check_attempts         1

normal_check_interval       1

retry_check_interval         1

contact_groups             admins

notification_options         w,u,c,r

notification_interval       960

notification_period         24×7

check_command             check_mysql!100.0,20%!500.0,60%

}

 

define service{

use                   generic-service       ; Name of service template to use

host_name               test_nrpe

service_description         ntp

is_volatile               0

check_period             24×7

max_check_attempts         1

normal_check_interval       1

retry_check_interval         1

contact_groups             admins

notification_options         w,u,c,r

notification_interval       960

notification_period         24×7

check_command             check_ntp!100.0,20%!500.0,60%

}

 

define service{

use                   generic-service       ; Name of service template to use

host_name               test_nrpe

service_description         qmail_smtp

is_volatile               0

check_period             24×7

max_check_attempts         1

normal_check_interval       1

retry_check_interval         1

contact_groups             admins

notification_options         w,u,c,r

notification_interval       960

notification_period         24×7

check_command             check_smtp!100.0,20%!500.0,60%

}

 

define service{

use                   generic-service       ; Name of service template to use

host_name               test_nrpe

service_description         qmail_pop3

is_volatile               0

check_period             24×7

max_check_attempts         1

normal_check_interval       1

retry_check_interval         1

contact_groups             admins

notification_options         w,u,c,r

notification_interval       960

notification_period         24×7

check_command             check_pop!100.0,20%!500.0,60%

}

 

define service{

use                   generic-service       ; Name of service template to use

host_name               test_nrpe

service_description         test_load

is_volatile               0

check_period             24×7

max_check_attempts         1

normal_check_interval       1

retry_check_interval         1

contact_groups             admins

notification_options         w,u,c,r

notification_interval       960

notification_period         24×7

check_command             check_load!100.0,20%!500.0,60%

}

 

define service{

use                   generic-service       ; Name of service template to use

host_name               test_nrpe

service_description         test_disk

is_volatile               0

check_period             24×7

max_check_attempts         1

normal_check_interval       1

retry_check_interval         1

contact_groups             admins

notification_options         w,u,c,r

notification_interval       960

notification_period         24×7

check_command             check_disk!100.0,20%!500.0,60%

}

 

四、检查配置参数并重启nagios

 

 

9)如何在nagios中使用外部命令

vi /usr/local/nagios/etc/nagios.cfg

check_external_commands=1

 

mkdir /usr/local/nagios/var/rw

chown nagios.nagcmd /usr/local/nagios/var/rw

chmod u+rw /usr/local/nagios/var/rw

chmod g+rw /usr/local/nagios/var/rw

chmod g+s /usr/local/nagios/var/rw

 

svc -t /service/nagios/

/usr/local/apache2/bin/apachectl restart

以下文章点击率最高

Loading…


发表评论

邮箱地址不会被公开。 必填项已用*标注