check_postgres脚本集检查数据库健康情况

check_postgres.pl是一个Perl脚本,用于对Postgres数据库进行多种检查,包括与pgbouncer、pgAgent等工具的集成。用户可以从bucardo.org下载并安装该脚本,以确保数据库健康状况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

作者:阎书利

check_postgres.pl是一个 Perl 脚本,它针对一个或多个 Postgres 数据库运行许多不同的测试检查。使用 psql 程序收集信息。
check_postgres涉及方面比较广泛,不仅有常规方面检查,同时也涉及一些主流工具的检查,如:pgbouncer、pgAgent、slony、bucardo等。

可以去如下网站下载脚本
https://bucardo.org/check_postgres/

[postgres@t1ysl ~]$ ll
total 208
-rw-r--r-- 1 postgres dba 209715 Aug 10  2021 check_postgres.tar.gz
[postgres@t1ysl ~]$ tar -xf check_postgres.tar.gz
[postgres@t1ysl ~]$ ll
total 208
drwxr-xr-x 3 postgres dba    289 Feb  4  2020 check_postgres-2.25.0
-rw-r--r-- 1 postgres dba 209715 Aug 10  2021 check_postgres.tar.gz

安装所需环境

[root@t1ysl ~]# yum install perl-DBI perl-DBD-Pg perl-DBD-Pg-tests perl-Time-HiRes -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn

安装

[root@t1ysl check_postgres-2.25.0]# perl Makefile.PL
Configuring check_postgres 2.25.0
Checking if your kit is complete...
Warning: the following files are missing in your kit:
    MYMETA.json
    MYMETA.yml
Please inform the author.
Writing Makefile for check_postgres
[root@t1ysl check_postgres-2.25.0]# make
cp check_postgres.pl blib/script/check_postgres.pl
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/check_postgres.pl
Manifying blib/man1/check_postgres.1p
[root@t1ysl check_postgres-2.25.0]# make install
Appending installation info to /usr/lib64/perl5/perllocal.pod

[root@t1ysl check_postgres-2.25.0]# mkdir -p /opt/check_postgres/bin
[root@t1ysl check_postgres-2.25.0]# chown postgres:postgres /opt/check_postgres/ -R
[root@t1ysl check_postgres-2.25.0]# su - postgres
Last login: Mon Jul 26 06:16:02 CST 2021 on pts/1
[postgres@t1ysl ~]$ cd
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值