[SOLVED] Use a specific snmp value in a node label

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Shadok
Posts: 14
Joined: Fri May 28, 2010 7:29 am

[SOLVED] Use a specific snmp value in a node label

Post by Shadok »

Hello,

I'm monitoring an antenna with the "Generic SNMP - enabled host" template.
When i'm looking at the data query, i can see these value for the antenna :

Code: Select all

Index 	Status 	Description 	Name (IF-MIB) 	Alias (IF-MIB) 	Type 	Speed 	Hardware Address 	IP Address  	
1	Up	Ethernet Interface	ifeth0	ifeth0	ethernetCsmacd(6)	100000000	00:09:02:01:23:94	127.0.0.1	
2	Up	Wireless Interface Type T54i [1]	ifw0	ifw0	other(1)	54000000		192.168.25.28
The speed value is coming from the template :

Code: Select all

                <ifSpeed>
                        <name>Speed</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.2.1.2.2.1.5</oid>
                </ifSpeed>
Using the weathermap plugin, I'd like to display the Speed value in a node label, since this value can change regarding the conditions.
Here's what I tried so far :

Code: Select all

NODE test
        TARGET cactihost:13
        ICON images/optibeam_bottom-{node:this:state}.png
        USESCALE none
        POSITION 30 228
        SET  cacti_use_ifspeed 1
        LABEL {node:this:cacti_ifSpeed:%d}
But it doesn't work, I can't get the 54 MB value to be displayed.
Any ideas ?

Regards.
Last edited by Shadok on Mon May 31, 2010 6:48 am, edited 1 time in total.
Shadok
Posts: 14
Joined: Fri May 28, 2010 7:29 am

Post by Shadok »

Ok, i forgot the "SET cacti_use_ifspeed 1" in the default node.
Now with "{node:this:ifSpeed:%d}" i can have the value but since i have two interfaces and so two values for this variable, how can i specify the snmp index ?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

As its a weathermap specific question, moving forums.
Shadok
Posts: 14
Joined: Fri May 28, 2010 7:29 am

Post by Shadok »

I thought i got something working, except for selecting the device interface but i still got a 0 value whatever i try.
Shadok
Posts: 14
Joined: Fri May 28, 2010 7:29 am

Post by Shadok »

Looks like what I'm trying to do can't be done.
I want to access a device snmp data in a node, to grab the ifSpeed value but according to the documentation, you can only target a rrd file and not a device directly.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

That's because a device doesn't have an interface speed. Interfaces have interface speeds. (e.g. DSL router - two interfaces, one with 100Mbit, one with 2Mbit).

So to get the cacti_ifSpeed variable set correctly, you need to use either an rrd target for the correct interface AND enable rrd_use_poller_output, or use the DSstats target instead. Both of those will set cacti_ifSpeed as you want, in 0.97a.

If that's not what you need for colouring the node, then you can also do something like:

TARGET cactihost:32 my-rrd-file.rrd:-:traffic_in
USESCALE somescale in

So that gets you an 'in' value of the device's state, like now, and an 'out' value of the 'traffic_in' value, which you can ignore. But as a side-effect, it will set all the cacti_* values for that interface (as long as you also add 'SET rrd_use_poller_output 1' at the top of the file).
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Shadok
Posts: 14
Joined: Fri May 28, 2010 7:29 am

Post by Shadok »

Thanks for the answer.

I tried using a rrd target.
This make me loose the {node:this:state} variable and I didn't have any value with {node:this:cacti_ifSpeed:%m}. Maybe be cause the rrd I use only store the traffic on the interface ?

Now, when I enable the DDStats plugins, I got some values in the database, but only about traffic_in or traffic_out.

I don't see how this would gave me the current interface speed.
Shadok
Posts: 14
Joined: Fri May 28, 2010 7:29 am

Post by Shadok »

Another option I discovered would be to use a SNMP target.
Once i got the target, how can I display the values on a label ?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Shadok wrote:Thanks for the answer.

I tried using a rrd target.
This make me loose the {node:this:state} variable and I didn't have any value with {node:this:cacti_ifSpeed:%m}. Maybe be cause the rrd I use only store the traffic on the interface ?

Now, when I enable the DDStats plugins, I got some values in the database, but only about traffic_in or traffic_out.

I don't see how this would gave me the current interface speed.
It doesn't directly, but with both dsstats and rrd+poller_output, weathermap knows the Cacti DS ID, and so it is able to fetch data from the Cacti poller cache, which *does* include the interface speed. So you can use dsstats with the ds id of the interface traffic, and you will get cacti_ifSpeed also.

rrd by itself can't do this, and poller_output takes a few polling cycles (I think 3) to start working, so perhaps you just need to wait?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Shadok wrote:I tried using a rrd target.
This make me loose the {node:this:state} variable and I didn't have any value with {node:this:cacti_ifSpeed:%m}. Maybe be cause the rrd I use only store the traffic on the interface ?
The example I gave was *both* cacti state and traffic - you can have multiple targets for a node or link, and the results are summed, which is why I set the second target to put nothing in the 'in' result. You should get the 'side effects' variables from both targets (cacti_state etc from cactihost, and cacti_ifSpeed from the rrd+poller_output).
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Shadok
Posts: 14
Joined: Fri May 28, 2010 7:29 am

Post by Shadok »

Ok, I understand now, I didn't know you could have more than one target.

Thanks :)
Shadok
Posts: 14
Joined: Fri May 28, 2010 7:29 am

Post by Shadok »

Works like a charm now :)
Thanks for the help.
Shadok
Posts: 14
Joined: Fri May 28, 2010 7:29 am

Post by Shadok »

I have another question.
I graphed a specific snmp oid.

SNMPv2-SMI::enterprises.3181.10.3.1.9.0 = INTEGER: 57

Now, I used the same way to call the rrd in weathermap but which variable can I use to display the value in a node label ?

Will {node:this:cacti_snmp_oid} work ?

Thanks.
Shadok
Posts: 14
Joined: Fri May 28, 2010 7:29 am

Post by Shadok »

Found :)
Leddy
Cacti User
Posts: 93
Joined: Sun May 15, 2005 6:55 pm

Post by Leddy »

Howie wrote:So to get the cacti_ifSpeed variable set correctly, you need to use either an rrd target for the correct interface AND enable rrd_use_poller_output
Can you elaborate a little bit on the above as I'm having problems getting this working, (without DSStats).

SET rrd_use_poller_output 1
NODE node00001
INFOURL /cacti/graph.php?rra_id=all&local_graph_id=8
OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=8
TARGET gauge:C:/cacti/rra/dell_powerconnect_6248_traffic_in_139.rrd:-:traffic_in
POSITION 100 375
LABEL {link:this:cacti_ifAlias} {link:this:cacti_ifSpeed}

All I see is [Unknown] [Unknown]. When looking at the debug log I don't see any extra info going into the poller_output table and map creation says I'm referencing an unknown item.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest