Chinaunix首页 | 论坛 | 博客
  • 博客访问: 326627
  • 博文数量: 103
  • 博客积分: 1590
  • 博客等级: 上尉
  • 技术积分: 1075
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-02 10:17
文章分类

全部博文(103)

文章存档

2013年(32)

2012年(7)

2010年(64)

我的朋友

分类: LINUX

2010-02-22 21:40:52

监控平台: /usr/local/nagios/libexec/check_nrpe -H 被监控机 出错如下.
CHECK_NRPE: Error - Could not complete SSL handshake.
在被监控机# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 也会出错.



(good)
cd check_mysql_health-2.1
mkdir -p /usr/local/nagios/mysql_health/states
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios  \
            --with-nagios-group=nagios --with-perl  \
            --with-statefiles-dir=/usr/local/nagios/mysql_health/states
           
        ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios --with-perl --with-statefiles-dir=/usr/local/nagios/mysql_health/states           
make
make install
###
./check_mysql_health --hostname proxy1.kdb --port 3306 --username root --password ipo2008mimi --mode threads-connected
CRITICAL - cannot connect to information_schema. install_driver(mysq
l) failed: Can't locate DBD/mysql.pm in       
下载perl dbi/dbd http://dev.mysql.com/downloads/dbi.html
(rpm包)
##处理


或者
perl -e shell -MCPAN
cpan> install DBI
cpan> install DBD::mysql
cpan> install DBD::mysql  which will also check for (other Perl modules) dependencies
###DBD
vim mysql_config  #socket='/var/lib/mysql/mysql.sock' -->socket='/data/var/mysql.sock'
perl Makefile.PL --mysql_config=/usr/bin/mysql_config
Perl-DBI版本:DBI-1.56
Step 1:  #  cp  DBI-1.56.tar.gz  /usr/local/
Step 2:  #  cd  /usr/local/
Step 3:  #  tar xvzf DBI-1.56.tar.gz
Step 4:  #  cd DBI-1.56
Step 5:  #  perl Makefile.PL
Step 6:  #  make
Step 7:  #  make test
Step 8:  #  make install
Step 9:   #    perl -MDBI –el (测试是否安装成功,若不报错则成功)
3、 Perl-DBD-MySQL 模块安装
Step 1:  #  cp DBD-mysql-4.00.tar.gz /usr/local/
Step 2:  #  cd  /usr/local/
Step 3:  #  tar xvzf DBD-mysql-4.00.tar.gz
Step 4:  #  cd DBD-mysql-4.00
Step 5:  #  perl Makefile.PL
Step 6:  #  make
Step 7:  #  make test
Step 8:  #  make install
 
perl Makefile.PL \
      --libs="-L/mysql目录/lib/mysql -lmysqlclient -lz" \
      --cflags=-I/mysql目录/include/mysql
    make
    make test
    make install
   
   
   
#!/bin/perl
use DBI;
# Connect to target DB
my $dbh = DBI->connect("DBI:mysql atabase=fb;host=puma.kdb","ipo2008","meiguiyuan", {'RaiseError' => 1});
# query
my $sqr = $dbh->prepare("show databases");
$sqr->execute();
while(my $ref = $sqr->fetchrow_hashref()) {
    print "$ref->{'Database'}\n";
}
$dbh->disconnect();
 
阅读(1507) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~