Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Mar 27, 2017 11:28 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 78 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: weathermap to show int status instead of traffic utiliza
PostPosted: Thu Nov 03, 2016 2:50 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5058
Location: United Kingdom
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 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: weathermap to show int status instead of traffic utiliza
PostPosted: Thu Nov 03, 2016 3:10 pm 
Offline
Cacti User

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 54
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 - 0.8.8h
Poller Type - CMD
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 6
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2


Top
 Profile  
 
 Post subject: Re: weathermap to show int status instead of traffic utiliza
PostPosted: Thu Nov 03, 2016 3:19 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5058
Location: United Kingdom
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:
                $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 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: weathermap to show int status instead of traffic utiliza
PostPosted: Thu Nov 03, 2016 3:42 pm 
Offline
Cacti User

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 54
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 - 0.8.8h
Poller Type - CMD
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 6
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2


Top
 Profile  
 
 Post subject: Re: weathermap to show int status instead of traffic utiliza
PostPosted: Thu Nov 03, 2016 5:05 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5058
Location: United Kingdom
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:
                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 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: weathermap to show int status instead of traffic utiliza
PostPosted: Fri Nov 04, 2016 3:23 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5058
Location: United Kingdom
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 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: weathermap to show int status instead of traffic utiliza
PostPosted: Sun Nov 06, 2016 7:56 pm 
Offline
Cacti User

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 54
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 8 times

_________________
Cacti - 0.8.8h
Poller Type - CMD
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 6
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Top
 Profile  
 
 Post subject: Re: weathermap to show int status instead of traffic utiliza
PostPosted: Tue Nov 08, 2016 4:51 pm 
Offline
Cacti User

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 54
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 - 0.8.8h
Poller Type - CMD
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 6
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2


Top
 Profile  
 
 Post subject: Re: weathermap to show int status instead of traffic utiliza
PostPosted: Wed Nov 09, 2016 3:31 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5058
Location: United Kingdom
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 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: weathermap to show int status instead of traffic utiliza
PostPosted: Wed Nov 09, 2016 3:52 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5058
Location: United Kingdom
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:
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 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: weathermap to show int status instead of traffic utiliza
PostPosted: Wed Nov 09, 2016 2:40 pm 
Offline
Cacti User

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 54
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://user@1.1.1.1

It's not even writing the html code in the html file. Any clue?

_________________
Cacti - 0.8.8h
Poller Type - CMD
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 6
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2


Top
 Profile  
 
 Post subject: Re: weathermap to show int status instead of traffic utiliza
PostPosted: Wed Nov 09, 2016 3:08 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5058
Location: United Kingdom
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 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: weathermap to show int status instead of traffic utiliza
PostPosted: Thu Nov 10, 2016 5:50 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5058
Location: United Kingdom
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 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: weathermap to show int status instead of traffic utiliza
PostPosted: Thu Nov 10, 2016 6:31 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5058
Location: United Kingdom
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 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: weathermap to show int status instead of traffic utiliza
PostPosted: Mon Nov 14, 2016 2:20 pm 
Offline
Cacti User

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 54
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 - 0.8.8h
Poller Type - CMD
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 6
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 78 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 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