snmp 0.0.7 copy "snmp: ^0.0.7" to clipboard
snmp: ^0.0.7 copied to clipboard

A starting point for Dart SNMP protocol, for Using IP(network) to Easyly access snmp data.

example/example.dart

import 'package:snmp/snmp.dart';
import 'package:snmp/src/pdu.dart';

Future<void> main() async {
    //Bind your local SNMP client ip
    var pack = await SnmpPack.bind();
    //Request OID to some host

    var to='192.168.199.214:161'; //target ip and port

    var pdu=await pack.get(PDU(OID('1.3.6.1.2.1.43.10.2.1.4.1.1')),to);
    print(pdu.value);
    print(BER.decode(pdu.value,BER.COUNTER).toInt());

    await pack.get(PDU(OID('1.3.6.1.2.1.43.10.2.1.4.1.1')),to).then(print);
    //device model
    await pack.get(PDU(OID('1.3.6.1.2.1.25.3.2.1.3.1')),to).then(print);
    pack.close();
}
3
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A starting point for Dart SNMP protocol, for Using IP(network) to Easyly access snmp data.

Homepage

License

unknown (LICENSE)

Dependencies

convert, logger

More

Packages that depend on snmp