2014-06-27 12:31:48 +00:00
|
|
|
class CheckPostgres < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Monitor Postgres databases"
|
2015-07-20 10:01:54 +00:00
|
|
|
homepage "https://bucardo.org/wiki/Check_postgres"
|
|
|
|
url "https://bucardo.org/downloads/check_postgres-2.22.0.tar.gz"
|
2015-07-19 15:01:46 +00:00
|
|
|
sha256 "29cd8ea0a0c0fcd79a1e6afb3f5a1d662c1658eef207ea89276ddb30121b85a8"
|
2014-06-27 12:31:48 +00:00
|
|
|
|
|
|
|
head "https://github.com/bucardo/check_postgres.git"
|
|
|
|
|
2014-06-27 14:00:00 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-07-19 17:23:34 +00:00
|
|
|
sha256 "0186b2c9fc3156aeb1d4bae0bd31eb83a8a611d71fa1d4190675c453cf813c15" => :yosemite
|
|
|
|
sha256 "2a0e2935a4e46e12ac58fd2257f2ab771a265dafe90f96a82ace5309506fe3c1" => :mavericks
|
|
|
|
sha256 "ad3e8c1a33a93f60b7a94f24a33cea5f7a6b22dfce01df1464235380ebd5acf9" => :mountain_lion
|
2014-06-27 14:00:00 +00:00
|
|
|
end
|
|
|
|
|
2014-06-27 12:31:48 +00:00
|
|
|
depends_on :postgresql
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "perl", "Makefile.PL", "PREFIX=#{prefix}"
|
|
|
|
system "make", "install"
|
|
|
|
mv bin/"check_postgres.pl", bin/"check_postgres"
|
|
|
|
inreplace [bin/"check_postgres", man1/"check_postgres.1p"], "check_postgres.pl", "check_postgres"
|
|
|
|
rm_rf prefix/"Library"
|
|
|
|
rm_rf prefix/"lib"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
# This test verifies that check_postgres fails correctly, assuming
|
|
|
|
# that no server is running at that port.
|
2014-05-04 19:12:41 +00:00
|
|
|
output = shell_output("#{bin}/check_postgres --action=connection --port=65432", 2)
|
2015-07-19 15:01:46 +00:00
|
|
|
assert_match /POSTGRES_CONNECTION CRITICAL/, output
|
2014-06-27 12:31:48 +00:00
|
|
|
end
|
|
|
|
end
|