mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 08:01:38 +02:00
Added ability to disable icmp check on devices
This commit is contained in:
@@ -195,6 +195,8 @@ $config['snmp']['v3'][0]['cryptopass'] = '';
|
||||
$config['snmp']['v3'][0]['cryptoalgo'] = 'AES';
|
||||
// AES | DES
|
||||
|
||||
// Devices must respond to icmp by default
|
||||
$config['icmp_check'] = true;
|
||||
|
||||
// Autodiscovery Settings
|
||||
$config['autodiscovery']['xdp'] = true;
|
||||
|
||||
@@ -490,6 +490,8 @@ function isSNMPable($device) {
|
||||
function isPingable($hostname, $address_family = AF_INET, $device_id = FALSE) {
|
||||
global $config;
|
||||
|
||||
if ($config['icmp_check'] === true) {
|
||||
|
||||
$fping_params = '';
|
||||
if(is_numeric($config['fping_options']['retries']) || $config['fping_options']['retries'] > 1) {
|
||||
$fping_params .= ' -r ' . $config['fping_options']['retries'];
|
||||
@@ -515,6 +517,11 @@ function isPingable($hostname, $address_family = AF_INET, $device_id = FALSE) {
|
||||
$response['last_ping_timetaken'] = $status['avg'];
|
||||
}
|
||||
$response['db'] = $status;
|
||||
}
|
||||
else {
|
||||
$response['result'] = true;
|
||||
$response['last_ping_timetaken'] = 0;
|
||||
}
|
||||
return($response);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user