-
-
Save maiha/45fcaa2a04241776cc20 to your computer and use it in GitHub Desktop.
SNMPのscalaライブラリ候補まとめ (追加情報welcome)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snmpget | |
コマンドライン | |
snmp4j | |
デファクトのJavaライブラリ | |
http://www.snmp4j.org/ | |
snmpbulk | |
snmp4jを使ってMIBをpollingするサンプル | |
https://code.google.com/p/snmpbulk/ | |
snmp4s | |
snmp4jへのscalaラッパー | |
https://github.com/joescii/snmp4s | |
blaze-snmp | |
イベント型でasyncなscalaライブラリ (akka-2.2) | |
https://github.com/scott-abernethy/blaze-snmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.InetSocketAddress | |
import blazesnmp._ | |
import akka.actor._ | |
val address = new InetSocketAddress("localhost", 161) | |
val community = "(共通鍵の文字列)" // 修正必要 | |
val oid = ObjectIdentifier(Seq(1,3,6,1,4,1,910,1,1,0)) // 修正必要 | |
val system = ActorSystem("blaze") | |
val service = new SnmpServiceImpl(system) | |
val response = service.getRequest(Target(address, community), List(oid)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snmpget -v 1 -c "(共通鍵の文字列)" localhost:161 1.3.6.1.4.1.910.1.1.0 | |
# ↑OIDは適当 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment