api: Map LibreNMS OS' to known Oxidized models (#8758)

This commit is contained in:
Neil Lathwood 2018-05-25 04:08:44 +01:00 committed by Tony Murray
parent cb9077a983
commit 08022aae7a
3 changed files with 12 additions and 0 deletions

View File

@ -876,6 +876,8 @@ Output:
List devices for use with Oxidized. If you have group support enabled then a group will also be returned based on your config.
> LibreNMS will automatically map the OS to the Oxidized model name if they don't match.
Route: `/api/v0/oxidized(/:hostname)`
Input (JSON):

View File

@ -14,6 +14,8 @@ Then you can procede to the LibreNMS Web UI and go to Oxidized Settings in the E
To have devices automatically added, you will need to configure oxidized to pull them from LibreNMS [Feeding Oxidized](#feeding-oxidized)
LibreNMS will automatically map the OS to the Oxidized model name if they don't match. this means you shouldn't need to use the model_map config option within Oxidized.
### Detailed integration information
---

View File

@ -1264,6 +1264,14 @@ function list_oxidized()
}
}
// We remap certain device OS' that have different names with Oxidized models
$models = [
'arista_eos' => 'eos',
'vyos' => 'vyatta',
];
$device['os'] = str_replace(array_keys($models), array_values($models), $device['os']);
unset($device['location']);
unset($device['sysname']);
$devices[] = $device;