nagios+centreon添加监控服务
generic-service 为服务模板,以后的配置基本都用到它。
以下操作均是监控本机,也可换成别的,被监控机,需要安装nagios-plugins和nrpe。
Command_name:check_ping
Command_line: $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $ARG3$
generic-service 为服务模板,以后的配置基本都用到它。
Check Command:check_ping
Args:!200,50%!400,100%!2
如果你的没显示,重启一下ndo2db 服务:
/etc/init.d/ndo2db restart
ps -aux |grep ndo2db
wget http://shawnflynn.com/wp-content/uploads/2008/08/check_cputar.gz
tar -axf check_cputar.gz -C /usr/local/nagios/libexec/
chmod +x /usr/local/nagios/libexec/check_cpu.sh
chown nagios:nagios /usr/local/nagios/libexec/check_cpu.sh
Command_name:check_cpu
Command_line:$USER1$/check_cpu.sh -s $ARG1$ -w $ARG2$ -c $ARG3$
Check Command:check_cpu
Args:!5!80!95
报警部分(可选,也可以在服务模板里配置。)
wget http://shawnflynn.com/wp-content/uploads/2008/08/check_memtar.gz
tar -axf check_memtar.gz -C /usr/local/nagios/libexec/
chmod +x /usr/local/nagios/libexec/check_mem.sh
chown nagios:nagios /usr/local/nagios/libexec/check_mem.sh
Command_name:check_mem
Command_line:$USER1$/check_mem.sh --raw -w $ARG1$ -c $ARG2$
Check Command:check_mem
Args:!90!95
报警部分(可选,也可以在服务模板里配置。)
Command_name: check_disk
Command_line: $USER1$/check_disk -w $ARG1$ -c $ARG2$
Check Command:check_disk
Args:!20!10
cp -a /usr/bin/uptime /usr/local/nagios/libexec/check_uptime
chown nagios.nagios /usr/local/nagios/libexec/check_uptime
chmod +x /usr/local/nagios/libexec/check_uptime
Command_name: check_uptime
Command_line: $USER1$/check_uptime
Check Command:check_uptime
Command_name: check_total_procs
Command_line: $USER1$/check_procs -w $ARG1$ -c $ARG2$
Check Command:check_total_procs
Args:!200!250
Command_name: check_zombie_procs
Command_line: $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s Z
Check Command:check_zombie_procs
Args:!15!25
Command_name: check_http
Command_line: $USER1$/check_http -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
Check Command:check_http
Args:!5!10
mysql> grant usage ON *.* to nagios@'localhost' identified by 'nagios';
Command_name: check_mysql
Command_line: $USER1$/check_mysql -H $HOSTADDRESS$ -P $ARG1$ -u $ARG2$ -p $ARG3$
Check Command:check_mysql
Args:!3306!nagios!nagios
如出现此错误,说明centoren没有权限访问mysql。
  | MySQL |
  | CRITICAL |
6m 14s |
12/12/2013 01:11:43 |
3/3 (H) |
Access denied for user 'nagios'@'master-perofu.com' (using password: YES) |
解决办法:
只需重新给予相应的权限,即'nagios'@'master-perofu.com'
mysql> grant usage ON *.* to nagios@'master-perofu.com' identified by 'nagios';
Query OK, 0 rows affected (0.00 sec)
如果图片看不清楚,这个真没办法了,大家自己动手,应该也能完成上面的操作。