Class postgres_monitor

Description

A monitor class to check if Postgres is up and about. You need to specify a database and a user (and if required, a password) which can be use to test-connect to Postgres. Optionally you can specify the host and port number if connection is over TCP.

Located in /monitor-defs.php (line 526)

generic_monitor
   |
   --postgres_monitor
Variable Summary
 mixed $dbid
 mixed $dbname
 mixed $host
 mixed $password
 mixed $port
 mixed $user
Method Summary
 postgres_monitor postgres_monitor (string $dbname, string $user, [string $password = ""], [string $host = ""], [string $port = ""])
 boolean check ()
Variables
mixed $dbid = false (line 531)

Database connection resource ID

mixed $dbname = "" (line 534)

Name of the database to connect to

mixed $host = "" (line 543)

For TCP connections: hostname to connect to

mixed $password = "" (line 540)

Password of username to connect as

mixed $port = "" (line 546)

For TCP connections: port to connect to

mixed $user = "" (line 537)

Username to connect as

Methods
Constructor postgres_monitor (line 556)

Define a new Postgres monitor object.

postgres_monitor postgres_monitor (string $dbname, string $user, [string $password = ""], [string $host = ""], [string $port = ""])
  • string $dbname: Name of the Postgres database
  • string $user: Username to connect as
  • string $password: User password, if required
  • string $host: Hostname for TCP connections
  • string $port: Port number for TCP connections
check (line 569)

Make the check, as to whether we can connect to the Postgres DB.

If not then return false, else return true.

  • return: True if Postgres could be connected to.
boolean check ()

Documentation generated by phpDocumentor 1.3.0RC3