Location: PHPKode > scripts > Database servers down alarm > database-servers-down-alarm/checkdb.php
<?PHP
/**
* Checking DB server state, using as_dbserver_check.php example
*/
require_once('as_dbserver_check.php');

$srv = new CDbChecker(
  'Testing local DBMS server',
  './',
  "Our hosting agreement is 7777/2009, customer ID is 7070\nPlease check our MySQL databse state ASAP !\n");

$srv->SetEmails('hide@address.com','hide@address.com');
$srv->AddServer(DBTYPE_MYSQL,'hostname','myusername','mypassword');
// $srv->AddServer(DBTYPE_POSTGRESQL,'host=pgsql_host port=3444 name=myname','','04:00-05:00'); 
// postgreSQL is down for maintenance from 04 to 05 AM
$srv->CheckDbState();

?>
Return current item: Database servers down alarm