mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Merge pull request #1040 from f0o/issue-1038
Added TLS/SSL Cert checks based on nagios-plugins
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
$cmd = $config['nagios_plugins'] . "/check_ssl_cert -H ";
|
||||
if( !empty($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, "SSL_CERT OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user