Wishlist: interface graph links

514 views
Skip to first unread message

Frank Mogaddedi

unread,
Mar 8, 2017, 6:07:37 AM3/8/17
to NetBox

I know, I’m needy/wanty this week!

 

I’ve played around with the “Graphs” in the past, but unless I’m missing something, it doesn’t seem to work quite the way I expected it.

 

What I’d like is a link to a graph from an interface – and it brings up the graph for that interface or the graphs of both ends of the connection. Cacti URLs ftw! Maybe a “URL” field in “Edit Interface” that can contain more than one URL?

 

However, it appears as if I can only define one set of graphs, and that’ll get displayed regardless on which interface’s “graph” button I click. So basically it’s one “display graphs” button that then displays all the graphs I have listed in “Extras->Graphs”

 

I realize there was a discussion in https://github.com/digitalocean/netbox/issues/675, and I did read the documentation, but I think I fail at the “understanding” part

 

Let’s say I have two 48-port switches with devices connected to the switch interfaces. It seems that if I define graphs (type Interface) for each port (96), regardless on which switch’s interface’s graph button I click, I see all 96 graphs, which is a little on the overkill side.

 

Or is this where I need to mess with the “Export Templates” and do an active export of a particular connection, in which case “Help! I fell off the learning curve and I can’t get up!”

 

It’s really just an “I want to do this because I’m too lazy to search for the device/port in Cacti” thing.

 

Sorry if I sound confused (which I might be). I blame too many trips to the coffee machine.

 

   Frank

Jeremy Stretch

unread,
Mar 8, 2017, 9:23:25 AM3/8/17
to Frank Mogaddedi, NetBox
You only need to define one graph for each type of graph you want to display. The interface name is available as a template variable within the graph's source URL:

> Source URL: The source of the image to be embedded. The associated object will be available as a template variable named obj.

So, if you might define a graph with the source URL of

    https://my.nms.local/graphs/?node={{ obj.device.name }}&interface={{ obj.name }}&duration=5m

This graph will be shown for every interface. You'd create multiple graphs if you wanted to, for instance, display multiple time periods or different data:

    https://my.nms.local/graphs/?type=throughput&node={{ obj.device.name }}&interface={{ obj.name }}&duration=60m
    https://my.nms.local/graphs/?type=throughput&node={{ obj.device.name }}&interface={{ obj.name }}&duration=24h
    https://my.nms.local/graphs/?type=errors&node={{ obj.device.name }}&interface={{ obj.name }}&duration=60m

Hope that helps.

Jeremy

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/55d73961145a441aab08f6c6394f2164%40WS1-EXCH02.dc.local.
For more options, visit https://groups.google.com/d/optout.

Frank Mogaddedi

unread,
Mar 15, 2017, 5:33:24 AM3/15/17
to Jeremy Stretch, NetBox

Ooooh!!!!

 

Now, that’s slick! Tried it and it works like a charm. Well, I had to do some Cacti-wrangling, but Cacti and I have always had a complicated relationship.

 

Say, just in case that there are other people out there who are as dense as I, could you think perhaps add that example to the docs/graph section?

 

            Frank

 

From: Jeremy Stretch [mailto:jstr...@digitalocean.com]
Sent: Wednesday, March 08, 2017 09:23
To: Frank Mogaddedi <fra...@datachambers.com>
Cc: NetBox <netbox-...@googlegroups.com>
Subject: Re: [netbox-discuss] Wishlist: interface graph links

 

You only need to define one graph for each type of graph you want to display. The interface name is available as a template variable within the graph's source URL:

> Source URL: The source of the image to be embedded. The associated object will be available as a template variable named obj.

So, if you might define a graph with the source URL of

    https://my.nms.local/graphs/?node={{ obj.device.name }}&interface={{ obj.name }}&duration=5m

This graph will be shown for every interface. You'd create multiple graphs if you wanted to, for instance, display multiple time periods or different data:

    https://my.nms.local/graphs/?type=throughput&node={{ obj.device.name }}&interface={{ obj.name }}&duration=60m
    https://my.nms.local/graphs/?type=throughput&node={{ obj.device.name }}&interface={{ obj.name }}&duration=24h
    https://my.nms.local/graphs/?type=errors&node={{ obj.device.name }}&interface={{ obj.name }}&duration=60m


Hope that helps.

 

Jeremy

 

[…]

 

Jeremy Stretch

unread,
Mar 15, 2017, 12:17:43 PM3/15/17
to Frank Mogaddedi, NetBox
Done.

bellwood

unread,
Apr 21, 2017, 9:58:10 AM4/21/17
to NetBox
Frank,

I'd be interested to know how you managed to wrangle Cacti to integrate with Netbox?

While the above examples "helps" i think having some sound documentation of how one would actually integrate with Cacti would be really appreciated.

Thanks =)

Frank Mogaddedi

unread,
Apr 27, 2017, 6:27:53 AM4/27/17
to NetBox

The quick answer is: poorly J

 

In Netbox, I define a graph called “traffic”, type “Interface”, some weight and the source URL pointing to my cacti server like this:

 

            http://cactiserver.domain.com/cacti_xlate/netbox.php?HOST={{obj.device.name}}&PORT={{obj.name}}

 

 

I attached a tar-gzipped file (and bcc-ed you directly, if the google group doesn’t like attachments) containing my hack.

It’s a hack. It’s ugly, but it does the trick. Note that there I do some fancy port-name translation that don’t seem to make sense, but I have Extreme switches with ports like “1:12”, and I didn’t put those exact names as ports into Netbox, so I have to translate them.

I also searched for the proper graph_template_id  / data_template_id that I want to use in the cacti database before plugging those numbers straight into the query (see functions.php)

 

It’s messy but it kinda works. Cacti doesn’t have an API (I think there’s some plugin which I haven’t looked at, though), and I’m on my way to replace cacti with LibreNMS (a fork of Observium). A ton of graphs for my switches right out-of-the-box, graphs look a bit different, but it DOES have a proper API.

 

Good luck,

 

            Frank

           

 

From: netbox-...@googlegroups.com [mailto:netbox-...@googlegroups.com] On Behalf Of bellwood
Sent: Friday, April 21, 2017 09:58
To: NetBox <netbox-...@googlegroups.com>
Subject: Re: [netbox-discuss] Wishlist: interface graph links

 

Frank,

--

You received this message because you are subscribed to the Google Groups "NetBox" group.

To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To post to this group, send email to netbox-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/d4826594-3759-42c0-abea-1681b9714efc%40googlegroups.com.

netbox-cacti.tgz

Krish

unread,
Jun 23, 2020, 3:16:14 PM6/23/20
to NetBox
Hi

I am new to netbox trying to integrate graphs rendered by CACTI.

I followed the procedure provided in the netbox documentation but its not working as expected or may be its my understanding thats not in sync with the context its referred to.

I found this thread close to my requirement so I am posting it here.

> Source URL: The source of the image to be embedded. The associated object will be available as a template variable named obj.

So, if you might define a graph with the source URL of

    https://my.nms.local/graphs/?node={{ obj.device.name }}&interface={{ obj.name }}&duration=5m

This graph will be shown for every interface. You'd create multiple graphs if you wanted to, for instance, display multiple time periods or different data:

    https://my.nms.local/graphs/?type=throughput&node={{ obj.device.name }}&interface={{ obj.name }}&duration=60m
    https://my.nms.local/graphs/?type=throughput&node={{ obj.device.name }}&interface={{ obj.name }}&duration=24h
    https://my.nms.local/graphs/?type=errors&node={{ obj.device.name }}&interface={{ obj.name }}&duration=60m

Kindly help me to understand how to setup graph specific to a device/device interface. do I need to include like {{ obj.device.name == 'my device name' }} &interface={{ obj.name == 'my device intface name' }} ?

Thanks
On Thursday, April 27, 2017 at 6:27:53 AM UTC-4, Frank M wrote:

The quick answer is: poorly J

 

In Netbox, I define a graph called “traffic”, type “Interface”, some weight and the source URL pointing to my cacti server like this:

 

            http://cactiserver.domain.com/cacti_xlate/netbox.php?HOST={{obj.device.name}}&PORT={{obj.name}}

 

 

I attached a tar-gzipped file (and bcc-ed you directly, if the google group doesn’t like attachments) containing my hack.

It’s a hack. It’s ugly, but it does the trick. Note that there I do some fancy port-name translation that don’t seem to make sense, but I have Extreme switches with ports like “1:12”, and I didn’t put those exact names as ports into Netbox, so I have to translate them.

I also searched for the proper graph_template_id  / data_template_id that I want to use in the cacti database before plugging those numbers straight into the query (see functions.php)

 

It’s messy but it kinda works. Cacti doesn’t have an API (I think there’s some plugin which I haven’t looked at, though), and I’m on my way to replace cacti with LibreNMS (a fork of Observium). A ton of graphs for my switches right out-of-the-box, graphs look a bit different, but it DOES have a proper API.

 

Good luck,

 

            Frank

           

 

From: netbox-...@googlegroups.com [mailto:netbox-...@googlegroups.com] On Behalf Of bellwood
Sent: Friday, April 21, 2017 09:58
To: NetBox <netbox-...@googlegroups.com>
Subject: Re: [netbox-discuss] Wishlist: interface graph links

 

Frank,

 

I'd be interested to know how you managed to wrangle Cacti to integrate with Netbox?

 

While the above examples "helps" i think having some sound documentation of how one would actually integrate with Cacti would be really appreciated.

 

Thanks =)

--
You received this message because you are subscribed to the Google Groups "NetBox" group.

To unsubscribe from this group and stop receiving emails from it, send an email to netbox-...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages