Merge pull request #351 from paulgear/vyos-support

Basic recognition of VyOS
This commit is contained in:
Neil Lathwood
2014-11-22 15:42:09 +00:00
5 changed files with 35 additions and 2 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+14 -1
View File
@@ -22,6 +22,8 @@ $config['os_group'][$os_group]['over'][1]['text'] = "Memory Usage";
$os = "generic";
$config['os'][$os]['text'] = "Generic Device";
// Linux-based routers/switches
$os = "vyatta";
$config['os'][$os]['text'] = "Vyatta";
$config['os'][$os]['type'] = "network";
@@ -30,7 +32,18 @@ $config['os'][$os]['over'][0]['graph'] = "device_bits";
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
$config['os'][$os]['over'][1]['graph'] = "device_processor";
$config['os'][$os]['over'][1]['text'] = "Processor Usage";
$config['os'][$os]['over'][2]['graph'] = "device_mempool";
$config['os'][$os]['over'][2]['graph'] = "device_ucd_memory";
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
$os = "vyos";
$config['os'][$os]['text'] = "VyOS";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['ifname'] = 1;
$config['os'][$os]['over'][0]['graph'] = "device_bits";
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
$config['os'][$os]['over'][1]['graph'] = "device_processor";
$config['os'][$os]['over'][1]['text'] = "Processor Usage";
$config['os'][$os]['over'][2]['graph'] = "device_ucd_memory";
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
// Linux-based OSes here please.
+1 -1
View File
@@ -5,4 +5,4 @@ if (!$os)
if (preg_match("/^Vyatta/", $sysDescr)) { $os = "vyatta"; }
}
?>
?>
+9
View File
@@ -0,0 +1,9 @@
<?php
if (!$os || $os == "vyatta") {
if (preg_match("/^Vyatta VyOS/", $sysDescr) || preg_match("/^VyOS/", $sysDescr)) {
$os = "vyos";
}
}
?>
+11
View File
@@ -0,0 +1,11 @@
<?php
# Remove Vyatta prefix
$device['sysDescr'] = str_replace("Vyatta ", "", $device['sysDescr']);
# Version is second remaining word in sysDescr
list(,$version) = explode(" ", $device['sysDescr']);
$features = "";
?>