Skip to content

When an OID starts with space, SNMP returns undefined data #4492

@xmacan

Description

@xmacan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions