Files
librenms-librenms/includes/services/domain_expire/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

22 lines
480 B
PHP

<?php
#Get check_domain from https://raw.githubusercontent.com/glensc/nagios-plugin-check_domain/master/check_domain.sh
$cmd = $config['nagios_plugins'] . "/check_domain -d ";
if( $service['service_ip'] ) {
$cmd .= $service['service_ip'];
} else {
$cmd .= $service['hostname'];
}
$cmd .= " ".$service['service_param'];
$check = shell_exec($cmd);
list($check, $time) = explode("|", $check);
if(strstr($check, "OK - Domain")) {
$status = '1';
} else {
$status = '0';
}
?>