You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating new graph with generic OID template. If OID starts with space, the output of snmp query is:
POLLER: Poller[1] PID[52707] Device[1] DS[23] TT[4.51] SNMP: v2: 127.0.0.1, dsname: snmp_oid, oid: .1.3.6.1.2.1.25.2.3.1.6.7, output: U
Easy fix - in snmp.php in function cacti_snmp_session_get add trim:
$out = @$session->get(trim($oid));
I'm not doing PR, because this also applies to other functions (.._getnext,...) and you may want to solve it somehow in a systematic way.
Current 1.2.x branch
The text was updated successfully, but these errors were encountered:
An OID should never start with a space, so I don't think this is really something that we should handle. If a space is being inserted, it should be sorted at the source.
@netniV - There isn't any user input check, so an error can easily happen. It is not easy to find the error, because even in the log you can easily miss the extra space:
Device[1] DS[23] TT[4.51] SNMP: v2: 127.0.0.1, dsname: snmp_oid, **oid: .1.3.6.**1.2.1.25.2.3.1.6.7, output: U
If you don't agree with fix, I'll at least add a test to Intropage (Analyze cacti objects)
Trim would add a few cycles, but not too much in today's world. I'm surprised that the underlying stack is not handing this correctly. Might be something that's version dependent.
Creating new graph with generic OID template. If OID starts with space, the output of snmp query is:
POLLER: Poller[1] PID[52707] Device[1] DS[23] TT[4.51] SNMP: v2: 127.0.0.1, dsname: snmp_oid, oid: .1.3.6.1.2.1.25.2.3.1.6.7, output: U
Easy fix - in snmp.php in function cacti_snmp_session_get add trim:
$out = @$session->get(trim($oid));
I'm not doing PR, because this also applies to other functions (.._getnext,...) and you may want to solve it somehow in a systematic way.
Current 1.2.x branch
The text was updated successfully, but these errors were encountered: