netniV / cacti-netsnmp-memory

This script template is intended to overcome these shortcomings by fetching all of the available memory data from all known sources (including the standard HOST MIB), and then performing basic arithmetic to fill in any gaps in the data.
3 stars 2 forks source link

PHP WARNING: snmp3_get(): Unknown authentication protocol '' in file: /cacti/lib/snmp.php on line: 137 #2

Closed k4y53r closed 6 years ago

k4y53r commented 6 years ago

I get this error trying to get graph working in host with snmp v3, same host with snmp v2 works fine If i run query from cli all values return 0 value, no errors

Cacti Version 1.1.27 and graph template and query installed from github version

2018/01/19 09:30:45 - CMDPHP PHP ERROR WARNING Backtrace: (/script_server.php: 223 ss_netsnmp_memory)(/scripts/ss_netsnmp_memory.php: 80 cacti_snmp_get)(/lib/snmp.php: 137 snmp3_get)(CactiErrorHandler)(/lib/functions.php: 4403 cacti_debug_backtrace) 2018/01/19 09:30:45 - ERROR PHP WARNING: snmp3_get(): Unknown authentication protocol '' in file: /opt/cacti/lib/snmp.php on line: 137

netniV commented 6 years ago

Have you definitely got the latest ss_netsnmp_memory.php file ? There is no code on line 80 that can execute. I would have expected this to be line 78.

Are you using 1.0-beta1?

netniV commented 6 years ago

OK, I think the problem here may be the input statement if you have had the same issue as #1 then it would appear that the template hasn't updated the data sources. Edit the template, click save, then view your poller cache. If it is still showing '' for all of the last 6 parameters, that would mean it's not pulling in the SNMP v3 info for some reason so try the Rebuild Poller Cache. If it still isn't showing them, post the output from the poller cache here so I can have a look.

k4y53r commented 6 years ago

Hi again,

I verify that script and template are last version 1.0-beta1

You're right about line of error, maybe it was my fault copy/paste error from my file, so actual error related with this issue is:

2018/01/19 12:55:32 - CMDPHP PHP ERROR WARNING Backtrace: (/script_server.php: 223 ss_netsnmp_memory)(/scripts/ss_netsnmp_memory.php: 78 cacti_snmp_get)(/lib/snmp.php: 137 snmp3_get)(CactiErrorHandler)(/lib/functions.php: 4403 cacti_debug_backtrace) 2018/01/19 12:55:32 - ERROR PHP WARNING: snmp3_get(): Unknown authentication protocol '' in file: /opt/cacti/lib/snmp.php on line: 137

I've tried to save template, rebuild cache with no luck, if i check poller cache get:

HOSTNAME - Memory Usage HOSTNAME Script Server: /opt/cacti/scripts/ss_netsnmp_memory.php ss_netsnmp_memory '' '3' '' '161' '500' '' ''

Data Source Debug on graph:

/usr/bin/rrdtool create \ /opt/cacti/rra/_usedreal_1937.rrd \ --step 300 \ DS:usedReal:GAUGE:600:0:U \ DS:totalReal:GAUGE:600:0:U \ DS:memCached:GAUGE:600:0:U \ DS:memBuffer:GAUGE:600:0:U \ DS:availSwap:GAUGE:600:0:U \ DS:totalSwap:GAUGE:600:0:U \ DS:availReal:GAUGE:600:0:U \ DS:usedSwap:GAUGE:600:0:U \ RRA:AVERAGE:0.5:1:600 \ RRA:AVERAGE:0.5:6:700 \ RRA:AVERAGE:0.5:24:775 \ RRA:AVERAGE:0.5:288:797 \ RRA:MIN:0.5:1:600 \ RRA:MIN:0.5:6:700 \ RRA:MIN:0.5:24:775 \ RRA:MIN:0.5:288:797 \ RRA:MAX:0.5:1:600 \ RRA:MAX:0.5:6:700 \ RRA:MAX:0.5:24:775 \ RRA:MAX:0.5:288:797 \ RRA:LAST:0.5:1:600 \ RRA:LAST:0.5:6:700 \ RRA:LAST:0.5:24:775 \ RRA:LAST:0.5:288:797 \

Hope it helps....

netniV commented 6 years ago

A little, I can tell the first to lots of XX's are the hostname and IP address, could you edit that so the rest are formated like <community> <snmp_v3_user> If you do this in the single backtick quotes then you don't need to use the &lt;blah&gt; format.

k4y53r commented 6 years ago

I'm sorry...

I've just edited previous post

Thanks and regards

k4y53r commented 6 years ago

wrong button!! :(

netniV commented 6 years ago

OK, the correct order should be

You seem to have these out of sequence. Can you copy and paste the input string from the template itself?

k4y53r commented 6 years ago

Hi, I check sequence pasted on my previous post and your last post and i could't find the out of sequence you told.

HOSTNAME - Memory Usage HOSTNAME Script Server: /opt/cacti/scripts/ss_netsnmp_memory.php ss_netsnmp_memory '' '3' '' '161' '500' '' ''

hostname
'<HOST_IP>'
snmp_version
'3'
snmp_community
'<snmp_auth_password>'
snmp_port
'161'
snmp_timeout
'500'
snmp_auth_username
'<snmp_auth_username>'
snmp_auth_password
'<snmp_priv_passphrase>'
snmp_auth_protocol
snmp_priv_passphrase
snmp_priv_protocol
snmp_context

Also i couldn't find on my sentence value for snmp_priv_protocol, i've setup SHA, not default DES and error on log refers to auth protocol

ERROR PHP WARNING: snmp3_get(): Unknown authentication protocol '' in file

Should this field be included on parameters array?

Thank you so much and i hope you could forgive my errors reporting this issue... It's my first time on github ;)

netniV commented 6 years ago

The error is that the priv_passpharse (as you typed it out) is in the location for the auth_passowrd (see your post above where you edited the poller cache output). The other error is that the community has the auth_password.

This is why I am now curious what the input string is showing on your template

k4y53r commented 6 years ago

Hi again,

I couldn't check it before due flue process, i've check graph template and i think this is what you want:

<path_cacti>/scripts/ss_netsnmp_memory.php ss_netsnmp_memory <hostname> <snmp_ver> <snmp_community> <snmp_port> <snmp_timeout> <snmp3_username> <snmp3_password> <snmp3_authprot> <snmp3_privpass> <snmp3_privprot> <snmp3_context>

So I think it's ok, keep in mind that i've setup same keyword for SNMP Password and SNMP Privacy Passphrase, but i still think that i should get SNMP Privacy Protocol value on poller cache output

Thanks anyway

netniV commented 6 years ago

Yeah that is what I wanted to see. For some reason, this slipped under my radar. I'll take a look later.

netniV commented 6 years ago

Quick question, does the template show it as being Script Server Data (Indexed) ?

k4y53r commented 6 years ago

Hi, I'll check it tomorrow at work, where i could locate it?

netniV commented 6 years ago

Goto Console -> Data Collection -> Data Queries -> Cisco - 65xx - SFP statistics

k4y53r commented 6 years ago

Hi, i've checked it twice and i have no data querie at all for this graph, neither Get Script Server Data (Indexed) or Get SNMP Data (Indexed) and graph still shows no data

Last error on log:

2018/02/06 09:31:10 - CMDPHP PHP ERROR WARNING Backtrace: (/script_server.php: 223 ss_netsnmp_memory)(/scripts/ss_netsnmp_memory.php: 78 cacti_snmp_get)(/lib/snmp.php: 150 snmp3_get)(CactiErrorHandler)(/lib/functions.php: 4477 cacti_debug_backtrace)

2018/02/06 09:31:10 - ERROR PHP WARNING: snmp3_get(): Unknown authentication protocol '' in file: /opt/cacti/lib/snmp.php on line: 150

netniV commented 6 years ago

OK. Let me take another look over the code, if you put it back to what it was I'll take a look.

k4y53r commented 6 years ago

Hi again,

I've more test and I could get results from shell modifying query as you could see below

totalReal:0 availReal:0 totalSwap:0 availSwap:0 memBuffer:0 memCached:0 usedReal:0 usedSwap:0 Return 0 value for all fields

totalReal:1027016 availReal:131140 totalSwap:2094076 availSwap:2073448 memBuffer:132112 memCached:572316 usedReal:191448 usedSwap:20628

I still don't know why template query miss last 3 fields

Regards...

NOTE: Tested on cacti 1.1.34

netniV commented 6 years ago

OK, lets try this:

k4y53r commented 6 years ago

Yes, it shows "test" (without quotes) at end of poller cache

netniV commented 6 years ago

Do we have any data now from the poller?

k4y53r commented 6 years ago

I'll get "test" after auth_priv_password

2018/02/09 13:01:53 - SPINE: Poller[Main Poller] Device[6] Device[HOSTNAME] TH[1] Graphs[HOSTNAME - Memory Usage, HOSTNAME - Memory Usage] DS[HOSTNAME - Memory Usage] SS[0] SERVER: /opt/cacti/scripts/ss_netsnmp_memory.php ss_netsnmp_memory '' '3' '' '161' '500' '' '' test, output: totalReal:0 availReal:0 totalSwap:0 availSwap:0 memBuffer:0 memCached:0 usedReal:0 usedSwap:0

k4y53r commented 6 years ago

One detail that i see now...

Why are snmp_community value on snmp3 query after snmp version field??

I've check that this field get value from default device settings, but same query with this field replaced by empty string ('') get same result

k4y53r commented 6 years ago

Get error resolved, after leave empty SNMP Privacy Passphrase (v3) field on device graph begins to work. I made same config from cacti v0.8 on devices on cacti v1 but it seems something had change on last version.

Check that this only works on v1.1.34, that it shows new snmp device option SNMP Security Level

Previous version without this option stills had no data (also v1.1.33) Apologyze for annoyances caused

I did not close regarding if you query additional info, if not i'll close it tomorrow

Thank you so much

netniV commented 6 years ago

Ah, doh, should have thought of that one. There was a change to the SNMP v3 security and then it was changed again in the last release to fix issue #1275 on the Cacti Issues

netniV commented 6 years ago

In that case, I may have to specify that as a minimum compatibility level to ensure people don't end up reporting the same bug ;-)