2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
2011-04-03 17:09:09 +00:00
|
|
|
// provide some sane default
|
|
|
|
|
if ($service['service_param']) { $dbname = $service['service_param']; } else { $dbname = "mysql"; }
|
|
|
|
|
|
|
|
|
|
$check = shell_exec($config['nagios_plugins'] . "/check_mysql -H ".$service['hostname']." ".$dbname);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2016-02-25 14:30:40 -06:00
|
|
|
list($check, $time) = explode("|", $check);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2015-07-05 00:47:51 +02:00
|
|
|
if(strstr($check, "Uptime:") || strstr($check, "MySQL OK")) {
|
2011-09-20 09:55:11 +00:00
|
|
|
$status = '1';
|
|
|
|
|
} else {
|
|
|
|
|
$status = '0';
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|