-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When an OID starts with space, SNMP returns undefined data #4492
Comments
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: 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. |
Output = U when OID starts with space
I made an executive decision on this one. Most are using spine anyway. This is more important for little installs. |
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: