mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	api: Map LibreNMS OS' to known Oxidized models (#8758)
This commit is contained in:
		
				
					committed by
					
						 Tony Murray
						Tony Murray
					
				
			
			
				
	
			
			
			
						parent
						
							cb9077a983
						
					
				
				
					commit
					08022aae7a
				
			| @@ -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. | 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)` | Route: `/api/v0/oxidized(/:hostname)` | ||||||
|  |  | ||||||
| Input (JSON): | Input (JSON): | ||||||
|   | |||||||
| @@ -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) | 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 | ### Detailed integration information | ||||||
| --- | --- | ||||||
|  |  | ||||||
|   | |||||||
| @@ -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['location']); | ||||||
|         unset($device['sysname']); |         unset($device['sysname']); | ||||||
|         $devices[] = $device; |         $devices[] = $device; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user