Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Apr 19, 2019 1:43 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
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: 139
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: 5300
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 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!)


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: 139
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: 5300
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 2500 times ]

_________________
Weathermap 0.98 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!)
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: 139
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: 5300
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 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!)


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: 5300
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 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!)


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: 139
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: 5300
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 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!)


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: 139
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: 5300
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 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!)


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: 139
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: 5300
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 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!)


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Tue Sep 19, 2017 10:07 am 
Offline

Joined: Tue Jan 24, 2017 7:19 am
Posts: 8
Location: Bydgoszcz, Poland
I decided to write in this thread.
I have 5 ups in 2 DC and I want to build weathermap with all 5 ups showing important parameters.

I started from one of them:
Code:
NODE node_ups1_zop_co1
   LABEL I1(out):{node:this:snmp_in_raw}A
   NOTES Prad wyjsciowy 1
   LABELOUTLINECOLOR none
   LABELBGCOLOR none
   TARGET snmp:public:10.32.69.2:.1.3.6.1.4.1.4555.1.1.5.1.4.6.1.3.0.0:-
   USESCALE none in percent
   POSITION 550 380

NODE node_ups1_zop_co2
   LABEL I2(out):{node:this:snmp_in_raw}A
   NOTES Prad wyjsciowy 2
   LABELOUTLINECOLOR none
   LABELBGCOLOR none
   TARGET snmp:public:10.32.69.2:.1.3.6.1.4.1.4555.1.1.5.1.4.6.1.3.0.1:-
   USESCALE none in percent
   POSITION node_ups1_zop_co1 0 25

NODE node_ups1_zop_co3
   LABEL I3(out):{node:this:snmp_in_raw}A
   NOTES Prad wyjsciowy 3
   LABELOUTLINECOLOR none
   LABELBGCOLOR none
   TARGET snmp:public:10.32.69.2:.1.3.6.1.4.1.4555.1.1.5.1.4.6.1.3.0.2:-
   USESCALE none in percent
   POSITION node_ups1_zop_co1 0 50

NODE node_ups1_zop_vi1
   LABEL U1(in):{node:this:snmp_in_raw}V
   NOTES Napiecie wejsciowe 1
   LABELOUTLINECOLOR none
   LABELBGCOLOR none
   TARGET snmp:public:10.32.69.2:.1.3.6.1.4.1.4555.1.1.5.1.3.3.1.2.0.0:-
   USESCALE none in percent
   POSITION node_ups1_zop_co1 0 75

and so on.

It doesn't looks good, but it works well. Later I'll present the data in a table.
I wanted to show ups status too.
UPS website interface presents dynamic visualisation of status. Look at the attachment.
Attachment:
ups status.PNG
ups status.PNG [ 8.25 KiB | Viewed 1278 times ]


UPS status represents oid with integer value
Code:
p032000netmon:~# snmpwalk -v1 -c public 10.32.69.2 .1.3.6.1.4.1.4555.1.1.5.1.4.1.0
SNMPv2-SMI::enterprises.4555.1.1.5.1.4.1.0 = INTEGER: 3

Possible values: Syntax: Integer { standby (1), none (2), normal (3), bypass (4), battery (5)....

This is part of config file
Code:
SCALE UPSSTATUS 0    0.4   192 192 192
SCALE UPSSTATUS 0.5  1.5   132 140 142
SCALE UPSSTATUS 1.6  2.5   163   1  82
SCALE UPSSTATUS 2.6  3.5     2 210  74
SCALE UPSSTATUS 3.6  4.5   209 183  77


NODE node_ups1_status
   LABELBGCOLOR 250 235 215
   ICON images/ups_status_{node:this:inscaletag}.png
   TARGET snmp:public:10.32.69.2:.1.3.6.1.4.1.4555.1.1.5.1.4.1.0:-
   USESCALE none in percent
   POSITION node_ups1_zop_co1 0 300

I made 5 pngs: ups_status_1.png, ups_status_2.png, ups_status_3.png, ups_status_4.png and ups_status_.png.
It doesn't work. Weathermap displays ups_status_.png not ups_status_3.png which refers to actual value.

What is wrong, where is the bug?


Top
 Profile  
 
 Post subject: Re: Graphing SNMP String with Weathermap
PostPosted: Tue Sep 19, 2017 10:45 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5300
Location: United Kingdom
inscaletag refers to the text after the colour, on the scale lines. You don't have that, so it's an empty string.

Code:
SCALE UPSSTATUS 1.6  2.5   163   1  82  2

would be one way to fix that. You may as well use the word 'none' at that point, to make it easier to understand what is going on though, or even the name of the png file in its entirety.

Code:
SCALE UPSSTATUS 1.6  2.5   163   1  82 ups_status_none.png

NODE xx
    ICON images/{node:this:inscaletag}

_________________
Weathermap 0.98 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!)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests


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