wget包,解压,安装
####出现的问题
DBI.pm找不到
解决方式:执行perl进行安装
perl -MCPAN -e shell
install DBI
DBD/mysql.pm找不到
解决方式:安装DBD::mysql
perl -MCPAN -e shell
install DBD:mysql
此时可能会报错,比如mysql_config cant find等,查找此服务器上有没有mysql_config, mysql_config是mysql client所需要的编译文件,所以可能有些服务器上没有此文件。如果找到话,可以配置环境变量或者手动指定位置。
/home/wgx_ldj/lamp/soft/nagios-3.4.1/libexec
cd /home/wgx_ldj/.cpan/sources/authors/id/C/CA/CAPTTOFU/
perl Makefile.PL --mysql_config=/home/wgx_ldj/lamp/soft/nagios-3.4.1/var/mysql_config --testhost=10.127.64.56 --testuser=root --testpassword=123 --testport=3306 --testdb=new_cystat --with-mysql=/usr/bin/mysql
./check_mysql_health --hostname 10.127.64.56 --username root --password 123 --database new_cystats --warning 60 --critical 70 --mode threads-connected