weathermap to show int status instead of traffic utilization

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Author
Message
User avatar
Howie
Cacti Guru User
Posts: 5336
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: weathermap to show int status instead of traffic utiliza

#61 Post by Howie » Thu Nov 03, 2016 2:50 pm

The target prefix is snmp3: not snmpv3: (same for snmp2c: not snmpv2c: )

The rest looks OK, assuming Cacti has a device 61 and it speaks SNMPv3 :-)
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!)

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: weathermap to show int status instead of traffic utiliza

#62 Post by Pucho » Thu Nov 03, 2016 3:10 pm

Howie wrote:The target prefix is snmp3: not snmpv3: (same for snmp2c: not snmpv2c: )

The rest looks OK, assuming Cacti has a device 61 and it speaks SNMPv3 :-)
You're too fast! haven't read my edit hehehe

Fixed that I'm getting

11/04/2016 09:07:27 AM - WEATHERMAP: Poller[0] WARNING: [Map 43] snmp.conf: ReadData: NODE snmpv2, target: snmp2c:xxxxxh2:x.y.z.22:1.3.6.1.2.1.1.3:- had no valid data, according to WeatherMapDataSource_snmpv2c [WMWARN70]
11/04/2016 09:07:24 AM - WEATHERMAP: Poller[0] WARNING: [Map 43] snmp.conf: ReadData: NODE node05268, target: snmp3:xxxxxxr6:x.y.z.5:1.3.6.1.2.1.1.3:- had no valid data, according to WeatherMapDataSource_snmpv3 [WMWARN70]

I did snmpget from the box and I'm getting sysuptime value.

EDIT: I've probably missed the .0

Does this mean that the import stuff worked?
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

User avatar
Howie
Cacti Guru User
Posts: 5336
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: weathermap to show int status instead of traffic utiliza

#63 Post by Howie » Thu Nov 03, 2016 3:19 pm

I think I need to add some more debug logging to make it clearer what is happening. Atreides had a similar problem, but it worked fine for me with my test devices (random Cisco switch and my Ubuntu server).

But looking at the code, the import variable is named:

Code: Select all

                $import = $map->get_hint("snmpv3_" . $profile_name . "_import");
So snmpv3_core_import in your case. This is a little confusing, so I'll probably change that soon to be snmp3 also. But that should be the next step for you. Also, the xxxx part of your snmp3: target should be that same name 'core' - it looks like it might not be?
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!)

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: weathermap to show int status instead of traffic utiliza

#64 Post by Pucho » Thu Nov 03, 2016 3:42 pm

Sorry for the confusion, this is my current test setup

SET snmpv3_devicer6_import 61 --> is this right?
SET snmpv2c_deviceh2_import 24 --> is this right?
SET snmpv3_xyz_import 145 --> is this right?


Node configs

#devicer6
TARGET snmp3:devicer6:10.10.10.5:1.3.6.1.2.1.1.3.0:-
Result: had no valid data, according to WeatherMapDataSource_snmpv3 [WMWARN70]

#deviceh2
TARGET snmp2c:deviceh2:10.10.10.22:1.3.6.1.2.1.1.3.0:-
Result: had no valid data, according to WeatherMapDataSource_snmpv2c [WMWARN70]

#device xyz
TARGET snmp3:xyz:10.10.10.253:1.3.6.1.4.1.9.9.171.1.2.3.1.16.11882496:-
Result: had no valid data, according to WeatherMapDataSource_snmpv3 [WMWARN70]

EDIT: added a different oid (IF-MIB::ifOperStatus.2 = 1.3.6.1.2.1.2.2.1.8.2) to test with same result.

Btw, couldn't find the import stuff on this WeatherMapDataSource_snmpv2c.php
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

User avatar
Howie
Cacti Guru User
Posts: 5336
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: weathermap to show int status instead of traffic utiliza

#65 Post by Howie » Thu Nov 03, 2016 5:05 pm

v2c doesn't have the import stuff - there is only one setting: community.

v3 has 6 settings, so it's worth avoiding a crazy long target string, and also allows you to keep the details out of the config file. Typical v3 users care more about security, too :-) It also makes it easier to re-use them, since often a group of devices have the same settings.

So, for v3, you define a profile, either by importing one, or setting the 6 separate variables:

Code: Select all

                SET snmpv3_PROFILE1_import 66
OR
                SET snmpv3_PROFILE1_username username
                SET snmpv3_PROFILE1_seclevel authPriv
                SET snmpv3_PROFILE1_authproto SHA
                SET snmpv3_PROFILE1_authpass password
                SET snmpv3_PROFILE1_privproto AES
                SET snmpv3_PROFILE1_privpass otherpassword
and then put that profile name (PROFILE1) where you would put the community in v1 and v2c.

So it sounds like we still need more debug logging to understand what is going on - I'll add that and update this thread when I have.
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!)

User avatar
Howie
Cacti Guru User
Posts: 5336
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: weathermap to show int status instead of traffic utiliza

#66 Post by Howie » Fri Nov 04, 2016 3:23 pm

OK - new version for SNMPv3 is done:

* every path has logging in DEBUG logging mode.

* all variables are snmp3_ prefix now.

If you don't already have it, you'll need the php json module loaded for the debug logging.
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!)

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: weathermap to show int status instead of traffic utiliza

#67 Post by Pucho » Sun Nov 06, 2016 7:56 pm

Howie wrote:OK - new version for SNMPv3 is done:

* every path has logging in DEBUG logging mode.

* all variables are snmp3_ prefix now.

If you don't already have it, you'll need the php json module loaded for the debug logging.
I've re done the testing map with the new commits and snmp3 import is working. Probably my mistake, sorry about that.

I can now see running the debug that the import works fine. I see weathermap is getting the right snmp value for each port I'm polling.

Can you have a look at this config?

NODE snmp3_uptime
LABEL {node:this:bandwidth_in:%3T}
TARGET snmp3:devicer6:10.10.10.10:1.3.6.1.2.1.1.3.0:-
POSITION 473 262

The import looks to work fine and the snmpget as well, but I'm not getting anything on the label. See attached file with debug output.

Are you planning to add the import feature for snmp2c ?

Cheers,
Attachments
snmp3_import_debug.txt
(6.68 KiB) Downloaded 85 times
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: weathermap to show int status instead of traffic utiliza

#68 Post by Pucho » Tue Nov 08, 2016 4:51 pm

Still can't get anything on the map and wm is not showing any errors this time.

I tried the legacy snmp2 and works fine. Any idea? some obvious thing I'm not seing?
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

User avatar
Howie
Cacti Guru User
Posts: 5336
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: weathermap to show int status instead of traffic utiliza

#69 Post by Howie » Wed Nov 09, 2016 3:31 am

Sorry - I didn't see your reply before. The only thing I can see from the logs is that it's quite a big number (maybe a 64-bit counter), but I don't think that should be a problem. I will experiment later today.
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!)

User avatar
Howie
Cacti Guru User
Posts: 5336
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: weathermap to show int status instead of traffic utiliza

#70 Post by Howie » Wed Nov 09, 2016 3:52 am

No, it's because I'm an idiot... I can't push to github from where I am, but there's a one-line change to make it work:

Code: Select all

diff --git a/lib/datasources/WeatherMapDataSource_snmpv3.php b/lib/datasources/WeatherMapDataSource_snmpv3.php
index c402cb9..7d93b64 100644
--- a/lib/datasources/WeatherMapDataSource_snmpv3.php
+++ b/lib/datasources/WeatherMapDataSource_snmpv3.php
@@ -181,7 +181,7 @@ class WeatherMapDataSource_snmpv3 extends WeatherMapDataSource
                             wm_debug("Going to get $oid\n");
                             $results[$id] = snmp3_get($host, $params['username'], $params['seclevel'], $params['authproto'], $params['auth
                             if ($results[$id] !== FALSE) {
-                                $data[$id] = floatval($get_results);
+                                $data[$id] = floatval($results[$id]);
                                 $item->add_hint("snmp_" . $name . "_raw", $results[$id]);
                             } else {
                                 $this->down_cache{$host}++;
So change the '-' line for the '+' line (without the + and -) around line 187. It'l be in github sometime soon after a bit more testing. Then I'll make the SNMPv2c version follow the same design/logging/etc.
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!)

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: weathermap to show int status instead of traffic utiliza

#71 Post by Pucho » Wed Nov 09, 2016 2:40 pm

Howie wrote:No, it's because I'm an idiot... I can't push to github from where I am, but there's a one-line change to make it work:
You're far from being and idiot :lol:

That worked fine!

There is other completly different issue I'm having since I installed this branch.

This kind of INFOURLs are not working, doesn't look like a browser issue, tried a few differents.

INFOURL https://www.google.com or ssh://[email protected]

It's not even writing the html code in the html file. Any clue?
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

User avatar
Howie
Cacti Guru User
Posts: 5336
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: weathermap to show int status instead of traffic utiliza

#72 Post by Howie » Wed Nov 09, 2016 3:08 pm

No, that's a new one. That's an area that isn't well covered in the automatic tests.

I'll check it out.

(Also, github is now updated with the fixed snmp3 plugin - I'll make the same changes to the snmp2 one sometime soon)
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!)

User avatar
Howie
Cacti Guru User
Posts: 5336
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: weathermap to show int status instead of traffic utiliza

#73 Post by Howie » Thu Nov 10, 2016 5:50 am

Yep, confirmed, for nodes specifically. Links work OK. I'll update when it's fixed.

I was also going to mention that ssh:// URLs are something that sometimes needs browser tweaks to work, but Chrome on Windows knows about my putty install somehow without me doing anything :-)
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!)

User avatar
Howie
Cacti Guru User
Posts: 5336
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: weathermap to show int status instead of traffic utiliza

#74 Post by Howie » Thu Nov 10, 2016 6:31 pm

I think the INFOURL issue is resolved now in the current github. From my testing anyway. I still need to write some automated tests to cover this though.
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!)

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: weathermap to show int status instead of traffic utiliza

#75 Post by Pucho » Mon Nov 14, 2016 2:20 pm

Howie wrote:I think the INFOURL issue is resolved now in the current github. From my testing anyway. I still need to write some automated tests to cover this though.
Hi Howie,

Sorry, I couldn't reply before, cacti site was off yesterday.

Looks like the web editor got broken after the last changes, somehow, I cannot even edit the maps. If I click on a map it opens the editor but without the big blank square (the drawing one), if I click to "see config" it opens the config without issues.

and of course is not creating the maps, just the empty thumbnails.

Cheers,
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

Post Reply