howardjones / network-weathermap

Network Weathermap draws diagrams from data
http://www.network-weathermap.com/
MIT License
426 stars 94 forks source link

TARGET snmp query fails #139

Closed bsyd closed 6 years ago

bsyd commented 6 years ago

Version : master (commit c7fec728e9ef1791ca03e510b16b824f3ca83ed1) PHP version : 7.2 php-snmp module installed

I am trying to include snmp queries in a map. I took an old example here.

NODE node07595
        LABEL 100
        POSITION 48 83
        TARGET snmp:public:172.20.5.5:.1.3.6.1.4.1.11.2.14.11.5.1.88.1.4.1.5.100.49:-
        USESCALE stpstate in

But it fails with following error :

PHP Fatal error:  Uncaught Error: Call to undefined method Weathermap\Core\Map::get_hint() in /usr/share/cacti/plugins/weathermap/lib/Weathermap/Plugins/Datasources/SNMP1.php:75
Stack trace:
#0 /usr/share/cacti/plugins/weathermap/lib/Weathermap/Core/Target.php(125): Weathermap\Plugins\Datasources\SNMP1->readData('snmp:public:172...', Object(Weathermap\Core\Map), Object(Weathermap\Core\MapNode))
#1 /usr/share/cacti/plugins/weathermap/lib/Weathermap/Core/MapDataItem.php(264): Weathermap\Core\Target->readData(Object(Weathermap\Core\Map), Object(Weathermap\Core\MapNode))
#2 /usr/share/cacti/plugins/weathermap/lib/Weathermap/Core/MapDataItem.php(232): Weathermap\Core\MapDataItem->collectDataFromTargets(Array)
#3 /usr/share/cacti/plugins/weathermap/lib/Weathermap/Core/Map.php(1513): Weathermap\Core\MapDataItem->performDataCollection()
#4 /usr/share/cacti/plugins/weathermap/lib/Weathermap/Core/Map.php(1569): Weathermap\Core\Map->readDataFromTargets(Array)
#5 /usr/share/cacti/plugins/weathermap/weathermap(220): Weathermap\Core\Map->re in /usr/share/cacti/plugins/weathermap/lib/Weathermap/Plugins/Datasources/SNMP1.php on line 75

Am I missing something ?

howardjones commented 6 years ago

That's strange. It was supposed to point to the new commit that fixes the code, too.

I've just pushed a new commit that should resolve this issue with SNMPv1 (works for me now, anyway).

bsyd commented 6 years ago

confirmed, thanks.