Files
librenms-librenms/includes/services/mysql/check.inc
Tony Murray 9f22b18dc8 Split is removed in PHP7, replace with explode as none were using it as a regex.
Also fix two array keys without quotes in include/syslog.php
Fixes #2205
2016-02-25 14:34:06 -06:00

17 lines
396 B
PHP

<?php
// 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);
list($check, $time) = explode("|", $check);
if(strstr($check, "Uptime:") || strstr($check, "MySQL OK")) {
$status = '1';
} else {
$status = '0';
}
?>