近视打乒乓球案例:nagios 监控笔记(三)

来源:百度文库 编辑:偶看新闻 时间:2024/04/26 19:22:37
nagios 监控笔记(三) 六、监控mysql服务       1)、在要监控mysql主机上面建立mysql用户,用作mysql监控服务使用。grant all on *.* to test@'%' identified by 'test';       2)、在nagios监控服务器上安装check_mysql_health插件.下载地址:http://www.consol.de/fileadmin/opensource/Nagios/check_mysql_health-2.0.3.tar.gztar zxvf check_mysql_health-2.0.3.tar.gz.rarcd check_mysql_health./configure --prefix=/usr/local/nagiosmake && make installyum install -y perl-DBD-MySQL.i386 perl-DBD-Pg.i386 # check_mysql_health使用需要这二个发安装包 在运行./check_mysql_health出现以下错误提示, [root@file]# ./check_mysql_health    
-bash: ./check_mysql_health: yes: bad interpreter: No such file or directory
解决方法因为check_mysql_health是用perl写的,将check_mysql_health的第一行由原来的#! yes -w修改为#!/usr/bin/perl,这样就OK了
七、nagios监控mysql页面 八、配置nagios声音报警和飞信报警       1)、编辑nagios服务端的cgi.cfg文件[root@nagios ~]# vi /usr/local/nagios/etc/cgi.cfg# under the HTML path (i.e. /usr/local/nagios/share/media/).=host_unreachable_sound=hostdown.wav
host_down_sound=hostdown.wav
service_critical_sound=critical.wav
service_warning_sound=warning.wav
service_unknown_sound=warning.wav
normal_sound=noproblem.wav
#去掉这几项注释,保证/usr/local/nagios/share/media目录下有这些.wav文件,才能正常下行声音报警.
     2)、配置飞信mkdir /usr/local/toolscd /usr/local/toolswget [url]http://www.it-adv.net/fetion/downng/fetion20090318001-linux.tar.gz[/url] tar -xzvf fetion20090318001-linux.tar.gz  wget [url]http://www.it-adv.net/fetion/downng/library_linux.tar.gz[/url]
tar -xzvf library_linux.tar.gz -C /lib
#/usr/local/tools/fetion/fetion --mobile=159******  --pwd=2233*** --to=158*** --msg-gb="messages" 手机能接收到"messages",说明fetion发送短信息成功。 设置权限chown -R nagios.nagios /usr/local/tools 使linux下的fetion发送信息支持中文件,只需要修改--msg-gb=""为--msg-utf8=""