feature: Support for up/down detection of ping only devices.

* Added support for ping only devices.

* Renamed sql-schema/206 to 207.

* Discovery tried to detect the OS when it shouldn't.

* Updated db_schema.yaml

* Added ping icon.

* Don't show unused graphs and tabs when SNMP is disabled.

* Allow the user to specify OS of ping only devices.

* Removing custom OS now changes it to 'ping'.

* Removed unnecessary use of mres().

* UI select box for SNMP enable/disable.

* Hide device_ping_perf if ping is disable on device.

* Fixed SNMP settings update status messages.

* Added functionality to add ping only devices via the web ui.

* Added ping only option to addhost.php

* Added ping only support to snmp-scan.py

* Moved sql 208 to 211

* Fixed scrutinizer issues.

* Fixed broken ossearch.

* Added ping only support to the API.

* Updated API doc.

* Added (optional) to OS and hardware description. Hid Port Settings, Applications, Modules, Storage, Processors, Memory and Components from the edit menu

* Style fix.

* Updated ping icon.

* clean() instead of mres(). More escaping. Better help in snmp-scan.py and addhost.php

* Fixed scrutinizer issue.

* Always try SNMP in snmp-scan.py, new option for it in addhost.php. Slice instead of chunk in ajax_ossuggest.php. Other minor style changes.

* Updated sql modifications to insert the new column in the same place as in db_schema.yaml.
This commit is contained in:
Zmegolaz
2017-10-28 05:59:25 +02:00
committed by Tony Murray
parent a81ce594c7
commit f8d7ccfe0d
20 changed files with 578 additions and 249 deletions

View File

@ -271,6 +271,7 @@ function add_device()
// Default status & code to error and change it if we need to.
$status = 'error';
$code = 500;
$additional = array();
// keep scrutinizer from complaining about snmpver not being set for all execution paths
$snmpver = 'v2c';
if (empty($data)) {
@ -284,7 +285,14 @@ function add_device()
$transport = $data['transport'] ? mres($data['transport']) : 'udp';
$poller_group = $data['poller_group'] ? mres($data['poller_group']) : 0;
$force_add = $data['force_add'] ? true : false;
if ($data['version'] == 'v1' || $data['version'] == 'v2c') {
$snmp_disable = ($data['snmp_disable']);
if ($snmp_disable) {
$additional = array(
'os' => $data['os'] ? mres($data['os']) : 'ping',
'hardware' => $data['hardware'] ? mres($data['hardware']) : '',
'snmp_disable' => 1,
);
} elseif ($data['version'] == 'v1' || $data['version'] == 'v2c') {
if ($data['community']) {
$config['snmp']['community'] = array($data['community']);
}
@ -309,7 +317,7 @@ function add_device()
}
if (empty($message)) {
try {
$device_id = addHost($hostname, $snmpver, $port, $transport, $poller_group, $force_add);
$device_id = addHost($hostname, $snmpver, $port, $transport, $poller_group, $force_add, 'ifIndex', $additional);
$code = 201;
$status = 'ok';
$message = "Device $hostname ($device_id) has been added successfully";