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

16 lines
331 B
PHP

<?php
if($service['service_port']) { $port = $service['service_port']; } else { $port = '23'; }
$check = shell_exec($config['nagios_plugins'] . "/check_telnet -H ".$service['hostname']." -p ".$port);
list($check, $time) = explode("|", $check);
if(strstr($check, "TCP OK - ")) {
$status = '1';
} else {
$status = '0';
}
?>