Skip to content

creating oid with type OID. getting error - ReferenceError: data type OID has no registered constructor #263

@brzssh

Description

@brzssh

creating oid with type OID. getting error - ReferenceError: data type OID has no registered constructor

what is correct type to put?

agent.request({ oid: '.1.3.6.1.2.1.1.2', handler: function (prq) {
var sysobjid = '1.3.6.1.6.3.15.1.1.4.0'
var val = snmp.data.createData({ type: 'OID',
value: sysobjid });

    snmp.provider.readOnlyScalar(prq, val);

} });

agent.bind({ family: 'udp4', port: 161 });

/root/node_modules/snmpjs/lib/protocol/data.js:664
throw new ReferenceError('data type ' + type +
^

ReferenceError: data type OID has no registered constructor
at Object.createData (/root/node_modules/snmpjs/lib/protocol/data.js:664:9)
at handler (/root/scripts/Loaders/pcp/snmp/generic_snmp_objid.js:8:22)
at /root/node_modules/snmpjs/lib/agent.js:220:4
at Array.forEach ()
at /root/node_modules/snmpjs/lib/agent.js:219:11
at Array.forEach ()
at Agent._do_getset (/root/node_modules/snmpjs/lib/agent.js:181:19)
at Agent._process_req (/root/node_modules/snmpjs/lib/agent.js:408:8)
at Agent._recv (/root/node_modules/snmpjs/lib/agent.js:450:7)
at Socket._recv_binder (/root/node_modules/snmpjs/lib/agent.js:481:8)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions