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

18 lines
492 B
PHP

<?php
// provide some sane default
if ($service['service_param']) { $nsquery = $service['service_param']; } else { $nsquery = "localhost"; }
if ($service['service_ip']) { $resolver = $service['service_ip']; } else { $resolver = $service['hostname']; }
$check = shell_exec($config['nagios_plugins'] . "/check_dns -H ".$nsquery." -s ".$resolver);
list($check, $time) = explode("|", $check);
if(strstr($check, "DNS OK: ")) {
$status = '1';
} else {
$status = '0';
}
?>