Skip to content

Firstyear/rs_net_snmp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rs_net_snmp is a rust binding to libnetsnmp.

At the moment is is capable of connecting to version 1 and 2c snmp servers
to query oids.

The library is design to mask many of the complexities of the libnetsnmp into
useful functions with pure rust types.

```
    let mut rssnmp: NetSNMP = NetSNMP::new();
    rssnmp.set_version(SNMPVersion::VERSION_2c).unwrap();
    rssnmp.set_community("public").unwrap();
    rssnmp.set_transport("tcp6:localhost").unwrap();
    rssnmp.open_session().unwrap();
    println!("SNMPv2-MIB::sysName.0 = {:?}", rssnmp.get_oid("SNMPv2-MIB::sysName.0").unwrap() );
    rssnmp.destroy();
```

This library provides a number of rust commands that interact with this library:

* rsnmpdemo  Is an implementation of the above example.
* rsnmpget  Is intentded to be a "parallel" to snmpget
* rsnmpmonitor  Takes a toml file of oids to monitor, and returns their status. Intended for use with cron.

About

A rust library to allow linking to net-snmp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published