mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Merge pull request #1041 from f0o/issue-1039
Added Domain-Expire check based on Nagios-Plugins
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?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) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "OK - Domain")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user