Added ability to disable icmp check on devices

This commit is contained in:
laf
2015-10-07 21:19:27 +00:00
parent 795297e908
commit e21ee0d8d8
2 changed files with 31 additions and 22 deletions
+2
View File
@@ -195,6 +195,8 @@ $config['snmp']['v3'][0]['cryptopass'] = '';
$config['snmp']['v3'][0]['cryptoalgo'] = 'AES'; $config['snmp']['v3'][0]['cryptoalgo'] = 'AES';
// AES | DES // AES | DES
// Devices must respond to icmp by default
$config['icmp_check'] = true;
// Autodiscovery Settings // Autodiscovery Settings
$config['autodiscovery']['xdp'] = true; $config['autodiscovery']['xdp'] = true;
+7
View File
@@ -490,6 +490,8 @@ function isSNMPable($device) {
function isPingable($hostname, $address_family = AF_INET, $device_id = FALSE) { function isPingable($hostname, $address_family = AF_INET, $device_id = FALSE) {
global $config; global $config;
if ($config['icmp_check'] === true) {
$fping_params = ''; $fping_params = '';
if(is_numeric($config['fping_options']['retries']) || $config['fping_options']['retries'] > 1) { if(is_numeric($config['fping_options']['retries']) || $config['fping_options']['retries'] > 1) {
$fping_params .= ' -r ' . $config['fping_options']['retries']; $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['last_ping_timetaken'] = $status['avg'];
} }
$response['db'] = $status; $response['db'] = $status;
}
else {
$response['result'] = true;
$response['last_ping_timetaken'] = 0;
}
return($response); return($response);
} }