![](https://secure.gravatar.com/avatar/df9b784677192515acddc09de982fde9.jpg?s=120&d=mm&r=g)
Hi,
Looking at the navbar code, the peering and transit groups together is a comma separated list of ports in the href that's passed :
if ($config['int_peering'] && $config['int_transit']) { echo('<li><a href="iftype/type=peering,transit/"><img src="images/16/world_link.png" border="0" align="absmiddle" /> Peering & Transit</a></li>'); $ifbreak = 1; }
So it should work if one of the values in the int_groups array is just "peering,transit" I would think.
I'm going to be extending it shortly to allow for display names in the nav bar and icons to be passed through as well. This will mean changing the way the config is passed unfortunately but it'll be more useful afterwards.
regards,
Paul
On 15/05/2013 08:43, Robert Williams wrote:
Hi Paul,
That’s excellent thanks! I've just extended that array to include all our (already labelled, thankfully) ports for various service types and it's worked brilliantly.
One question, I don't suppose there is an 'easy' way to add a category which is made of up two other port types? Like with the default "Peering & Transit" group?
Cheers :)
Robert Williams Custodian Data Centre Email: Robert@CustodianDC.com http://www.CustodianDC.com
-----Original Message----- From: observium [mailto:observium-bounces@observium.org] On Behalf Of Paul Orrock Sent: 15 May 2013 06:00 To: Observium Network Observation System Subject: Re: [Observium] Custom port service type?
Hi,
I've just supplied a patch to the nav bar (commit 4004) that will pick up anything you put followed by a colon and display it as a group under the ports menu. So I have a bunch of ports which have descriptions which start
ESXData: Inter: Mgmt:
etc and now those headings appear as groups under the port menu automatically when you add them to the config file with
$config['int_groups'] = array("EsxData","EsxMgmt","Inter");
If your existing ports don't start with something like that then you'll need to create a custom port description parser which will pull out the type from however you have it laid out in your port descriptions.
I took the opportunity to re-label all my 330 ports into a better structure and just use the standard parser but the custom parser is easy enough if you can write regular expressions.
regards,
Paul
On 15/05/2013 02:08, Jason Lixfeld wrote:
On 2013-05-14, at 5:59 PM, Tom Laermans tom.laermans@powersource.cx wrote:
On 14/05/2013 23:45, Jason Lixfeld wrote:
My port naming convention for core ports doesn't follow the "Core:" spec required by Observium. Is it possible to specify a custom type, or perhaps change the default? I'd love to see my core ports with a click of the Ports drop-down hopefully by avoiding having to reconfigure over 400 port descriptions. I can't see anything in defaults.inc.php and I'm not well enough versed in php to really know how to go about looking through the php code to try and find the answer. My google-fu is failing me too, so any pointers would be greatly appreciated.
You can write a custom parser and set it in the config:
$config['port_descr_parser'] = "includes/port-descr-parser.inc.php"; # Parse port descriptions into fields
Take a look at that file, make a copy of it, and edit to your needs. It's not the prettiest code, heh - just opened it for the first time.
Basically, the variables used there are the ones you can fill, particularly $type should be filled. $this_port['ifAlias'] is your interface description which you can parse in any way you like.
I don't get it :( Observium shows core ports in the Ports > Core if the interface description starts with "Core:". I don't see any reference to Core: in that file to change it to reflect what my core facing interface descriptions say. _______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium _______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium