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…

     

如果這文章對你有幫助,請掃左上角微信支付-支付寶,給於打賞,以助博客運營

發表評論

您的電子郵箱地址不會被公開。 必填項已用*標註