PHP Classes

File: checkdb.php

Recommend this page to a friend!
  Classes of Alexander Selifonov   Database servers down alarm   checkdb.php   Download  
File: checkdb.php
Role: Example script
Content type: text/plain
Description: using sample
Class: Database servers down alarm
Send alarm messages when databases are down
Author: By
Last change:
Date: 14 years ago
Size: 616 bytes
 

Contents

Class file image Download
<?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('admin@mycompany.ru','support@my-provider.net');
$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();

?>