Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Jun 28, 2017 5:27 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Graphing SNMP String with Weathermap
PostPosted: Mon Oct 31, 2016 6:08 am 
Offline
Cacti User

Joined: Mon May 31, 2010 9:26 am
Posts: 125
Hello,
I'm trying to display a snmp string on weathermap but cant figure it out exactly, what should the LABEL be.

NODE MODULE_TYPE
LABEL {node:this:snmp_out_raw}
LABELFONT 113
LABELOUTLINECOLOR none
LABELBGCOLOR none
TARGET snmp:{map:community}:172.25.232.33:1.3.6.1.2.1.47.1.1.1.1.2.1044
USESCALE CHANGE
POSITION 200 200

snmpwalk -v2c -c test 172.25.232.1 1.3.6.1.2.1.47.1.1.1.1.2.1044
SNMPv2-SMI::mib-2.47.1.1.1.1.2.1044 = STRING: "1000BaseBX10D Gi1/3"

I want go graph the "1000BaseBX10D" part.

Log from weathermap :

ProcessTargets: NODE MODULE_TYPE, target: snmp:{map:community}:172.25.232.33:1.3.6.1.2.1.47.1.1.1.1.2.1044 on config line 902 of /var/www/html/cacti/plugins/weathermap/configs/test was not recognised as a valid TARGET [WMWARN08]


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Mon Oct 31, 2016 6:16 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
You need to specify an OID for the in and out values, even if you aren't using them. Since you are using 'out' in the label, your TARGET should be:

Code:
TARGET snmp:{map:community}:172.25.232.33:-:1.3.6.1.2.1.47.1.1.1.1.2.1044


To say that you don't care about the in value (the extra '-' in the middle).

Also, Weathermap currently only supports SNMPv1 - 2c & 3 should be in the next version. It's written but not yet tested. It should work with 0.98 if you feel brave: https://github.com/howardjones/network-weathermap/blob/database-refactor/lib/datasources/WeatherMapDataSource_snmpv2c.php. You would need to change the target to snmp2c: instead of snmp:

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Mon Oct 31, 2016 7:12 am 
Offline
Cacti User

Joined: Mon May 31, 2010 9:26 am
Posts: 125
Great, thank you Howie.


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Mon Oct 31, 2016 8:07 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
Just a quick follow-up. I just tested with 0.98 version and the SNMP2c plugin from github, and that works as expected:

Code:
WIDTH 400
HEIGHT 400

NODE n1
   POSITION 200 200
   TARGET snmp2c:public:127.0.0.1:.1.3.6.1.2.1.1.7.0:.1.3.6.1.2.1.1.6.0
   LABEL {node:this:snmp_out_raw}


Attachments:
weathermap.png
weathermap.png [ 2.11 KiB | Viewed 1149 times ]

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)
Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Mon Oct 31, 2016 3:41 pm 
Offline
Cacti User

Joined: Mon May 31, 2010 9:26 am
Posts: 125
Hi,
Not quite related to weathermap or maybe....
I'm trying to graph some values from my layer3 switch :

Optical Optical
Temperature Voltage Current Tx Power Rx Power
Port (Celsius) (Volts) (mA) (dBm) (dBm)
---------- ----------- ------- -------- -------- --------
Gi1/1 25.0 3.34 5.9 -6.4 -12.2

snmpwalk returns those values, but its missing a dot :

[[email protected] ~]# snmpwalk -v2c -c test 172.25.232.33 1.3.6.1.4.1.9.9.91.1.1.1.1.4.1022
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.1022 = INTEGER: 33
[[email protected] ~]# snmpwalk -v2c -c test 172.25.232.33 1.3.6.1.4.1.9.9.91.1.1.1.1.4.1023
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.1023 = INTEGER: 59
[[email protected] ~]# snmpwalk -v2c -c test 172.25.232.33 1.3.6.1.4.1.9.9.91.1.1.1.1.4.1024
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.1024 = INTEGER: -65

How can I insert a "." between my values ?


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Mon Oct 31, 2016 5:00 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
Code:
TARGET 0.1*snmp2c:test:172.25.232.33:1.3.6.1.4.1.9.9.91.1.1.1.1.4.1022:-

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Mon Oct 31, 2016 5:27 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
Howie wrote:
Code:
TARGET 0.1*snmp2c:test:172.25.232.33:1.3.6.1.4.1.9.9.91.1.1.1.1.4.1022:-


If it's for a Cacti graph, you use CDEFs to do this.

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Tue Nov 01, 2016 6:15 am 
Offline
Cacti User

Joined: Mon May 31, 2010 9:26 am
Posts: 125
Tried snmp2c but no joy so far, am I missing something ?


11/01/2016 01:05:02 PM - WEATHERMAP: Poller[0] WARNING: [Map 1] testing: ReadData: NODE node3, target: snmp2c:test:172.25.232.33:-:1.3.6.1.4.1.9.9.91.1.1.1.1.4.1022 on config line 79 of /var/www/html/v3/plugins/weathermap/configs/testing had no valid data, according to WeatherMapDataSource_snmpv2c

NODE node3
LABEL Node 3
LABEL {node:this:outpercent:%d}
POSITION 502 500
ICON 93 24 box
TARGET 0.1*snmp2c:test:172.25.232.33:-:1.3.6.1.4.1.9.9.91.1.1.1.1.4.1022

11/01/2016 01:05:02 PM - WEATHERMAP: Poller[0] WARNING: [Map 1] testing: ReadData: NODE node4, target: snmp2c:test:172.25.232.33:-:1.3.6.1.4.1.9.9.91.1.1.1.1.4.1022 on config line 90 of /var/www/html/v3/plugins/weathermap/configs/testing had no valid data, according to WeatherMapDataSource_snmpv2c


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Tue Nov 01, 2016 6:39 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
No, that looks right. If the format is wrong, you get the "not recognised as a valid TARGET" message. This is the snmp2c plugin saying that it couldn't fetch data, so that means it was loaded, and did recognise the target as a valid formatted one.

Things I'd try:

1) Try without the 0.1* just in case (this shouldn't make any difference, but lets solve one thing at a time :-) )

2) Try with a . on the front of the OID - technically it's not formatted correctly without one, but most things don't care.

3) Try with debug logging? You'll get more information about what's going on inside the snmp plugin (grep for 'ReadData' lines)

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Tue Nov 01, 2016 7:01 am 
Offline
Cacti User

Joined: Mon May 31, 2010 9:26 am
Posts: 125
Tried first all points on your list :).

Weird is, on another machine with version 0.97 and snmp v1 its working(with 0.1*snmp:test:172.25.232.33).

ReadData for NODE node4:
11/01/2016 01:55:02 PM - WEATHERMAP: Poller[0] DEBUG: [[email protected]:922] [Map 1] testing: ReadData: New Target: 0.1*snmp2c:cscAstral:172.25.232.33:-:1.3.6.1.4.1.9.9.91.1.1.1.1.4.1022
11/01/2016 01:55:02 PM - WEATHERMAP: Poller[0] DEBUG: [[email protected]:538] [Map 1] testing: Trace: ProcessString(snmp2c:cscAstral:172.25.232.33:-:1.3.6.1.4.1.9.9.91.1.1.1.1.4.1022, node:node4)
11/01/2016 01:55:02 PM - WEATHERMAP: Poller[0] DEBUG: [[email protected]:939] [Map 1] testing: Will multiply result by 0.1
11/01/2016 01:55:02 PM - WEATHERMAP: Poller[0] DEBUG: [[email protected]_snmpv2c.php:45] [Map 1] testing: Timeout changed to 0 microseconds.
11/01/2016 01:55:02 PM - WEATHERMAP: Poller[0] DEBUG: [[email protected]_snmpv2c.php:46] [Map 1] testing: Will abort after 0 failures for a given host.
11/01/2016 01:55:02 PM - WEATHERMAP: Poller[0] DEBUG: [[email protected]_snmpv2c.php:47] [Map 1] testing: Number of retries changed to 0.
11/01/2016 01:55:02 PM - WEATHERMAP: Poller[0] DEBUG: [[email protected]_snmpv2c.php:93] [Map 1] testing: SNMP2c ReadData: Got and
11/01/2016 01:55:02 PM - WEATHERMAP: Poller[0] DEBUG: [[email protected]_snmpv2c.php:102] [Map 1] testing: SNMP2c ReadData: Returning (NULL,NULL,1478001302)
11/01/2016 01:55:02 PM - WEATHERMAP: Poller[0] WARNING: [Map 1] testing: ReadData: NODE node4, target: snmp2c:cscAstral:172.25.232.33:-:1.3.6.1.4.1.9.9.91.1.1.1.1.4.1022 on config line 90 of /var/www/html/v3/plugins/weathermap/configs/testing had no valid data, according to WeatherMapDataSource_snmpv2c


I tried even with snmp v1 , same result. Same conf(snmpv1) on 0.97 is working properly and displaying what I want.


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Tue Nov 01, 2016 9:57 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
That's interesting! I'll see if I can add some more logging.

What's the device? Anything unusual?

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Tue Nov 01, 2016 11:31 am 
Offline
Cacti User

Joined: Mon May 31, 2010 9:26 am
Posts: 125
No, its a Cisco 6500 Multilayer Switch.


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Tue Nov 01, 2016 11:36 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
OK, well those definitely work for me :-) I haven't tried with 0.98 on our own prod yet though :oops:

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group