--- pgsql.monitor 2002/07/10 10:05:14 1.4 +++ pgsql.monitor 2002/07/10 12:04:01 1.5 @@ -1,28 +1,27 @@ #!/usr/bin/perl -w # -# $Id: postgresql.monitor,v 1.3 2001/05/03 11:44:21 severin Exp $ -# $Revision: 1.3 $ -# $Author: severin $ -# -#Usage: postresql.monitor [options] -# -# --database= indicates the database to which is connected -# --username= DB-User which is used to connect to the DB -# --password= DB-Password which is used to connect to the DB -# --host= Host of the Database (optional,default=localhost) -# --port= Port on which you want to connect (optional,default=5432) +# Monitor multiple postgresql databases on different hosts +# +# Based on postgresql.monitor 1.3 +# by Severin Luftensteiner +# +#Usage: postresql.monitor username[:password]\@host/database ... # # a monitor to determine if a PostgreSQL database server is operational # # Rather than use tcp.monitor to ensure that your SQL server is responding -# on the proper port, this attempts to connect to and list the databases -# on a given database server. +# on the proper port, this attempts to connect to and count all tables +# in given database on given server. +# +# You can use this monitor along with fping+args which also knows how to +# ping hosts in that user@host/dabase format. # # This monitor requires the perl5 DBI, DBD::mSQL and DBD::mysql modules, # available from CPAN (http://www.cpan.org) # # Copyright (C) 2001, CubIT IT Solutions # Written by Severin Luftensteiner +# Copyright (C) 2002, Dobrica Pavlinusic # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,11 +39,8 @@ # use DBI; -use Getopt::Long; use strict; -my %options; - if (! @ARGV) { print <