Details
-
Improvement
-
Resolution: Fixed
-
Minor
-
None
-
None
-
Linux observium01 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux
Observium svn revision : 3992
Description
We have different groups of ports that we wanted to see under the ports nav drop down at the top in addition to 'customer','peering' etc. We wanted groups like Management, DRAC, and iSCSI.
We can specify these at the beginning of the port description on the switch using the standard naming types described here : http://www.observium.org/wiki/Interface_Description_Parsing
e.g.
EsxMgmt: ESX133-4
EsxMgmt: ESX134-4
Mgmt: PDU111
Inter: sw111-inter
You then specify an ordered list of the headings expected (so we only get what we want) in config.php as per the below.
$config['int_groups'] = array("EsxData","EsxMgmt","EsxiSCSI","EQL","Mgmt","LAGs","PI","DRAC");
I've patched the navbar.inc.php to pull out this list from the config and populate the drop down, see screenshot. Everything else is already done by the existing code.
I'm happy to edit the wiki page above and add some documentation if this gets approved.
Might be trivial and unusable by some, but thought I would share.
If you change $config['int_groups'] to be an array of key value arrays allows you to be a little more customisable
{ $types[] = strtolower(trim($custom_type['type'])); //newer style allows adding a "type", "title" and "icon" key value pair. }Then changes in the custom_port_parser in port-descr-parser.inc.php as such'
foreach ($config['int_groups'] as $custom_type)
{
if (is_array($custom_type))
else
{ $types[] = strtolower(trim($custom_type)); //assume old flat array style and lob it in }}
and in navbar.inc.php as such'
{ $navbar['ports']['entries'][] = array('url' => generate_url(array('page' => 'iftype', 'type' => is_array($int_type) ? $int_type['type'] : $int_type )), 'image' => is_array($int_type) ? $int_type['icon'] : "images/16/brick_link.png", 'title' => is_array($int_type) ? $int_type['title'] : $int_type); $ifbreak = 1; }foreach ($config['int_groups'] as $int_type)
and define in the config like;
$config['int_groups'] = array(array('type' => 'intercap','icon' => 'images/16/connect.png','title' => 'Intercap'), array('type' => 'regionalbh','icon' => 'images/16/transmit_blue.png','title' => 'Regional Backhaul')); // Enable Custom Port Types
Lets you have a bit more control on the front end
while still being compatible with the old style.