snmposterとは
特徴として以下の点が挙げられる。
- オープンソースで開発されているSNMPエージェントのシミュレータ
- python-pip上で稼働する
- 1ホスト上での実行で複数ホストのエージェントシミュレータを動作させることができる
- 1ホスト1エージェントではなく、1ホスト多エージェントができるので、リソースコストが少なくて済む
- net-snmpのsnmpwalkコマンドの取得値を使用してシミュレートできる
- しかし、シミュレートはsnmpwalkコマンドの取得値を静的に返すのみなので、値の変化は得られない
静的なデータしか返せなくても、どのMIBをサポートしているのかはわかるので、それだけでも十分利用できるツールだと思う。
動作概要
ざっと以下の感じ。
- snmpwalk の結果情報を準備
- SNMP をサポートしている機器に対して snmpwalk を実行して結果をファイルにしておく(or 完全手動でファイルを作成してもいい??)
- snmposter を起動
- SNMPクライアントから仮想 IP にアクセス (snmp-get or snmpwalk)
- 事前に準備した snpwalk の結果情報が取得できる
- 逆に言うと、準備していない情報は取得できない
- 事前に準備した snpwalk の結果情報が取得できる
snmposterのインストール
CentOS7 にインストールしてみる。
公式の手順に沿ってインストール実施。 (https://pypi.org/project/snmposter/)
Python development tools のインストール
yum -y install python-devel gcc
実行ログ
[root@test-01 ~]# yum -y install python-devel gcc 読み込んだプラグイン:fastestmirror Determining fastest mirrors * base: ftp.iij.ad.jp * extras: ftp.iij.ad.jp * updates: ftp.iij.ad.jp base | 3.6 kB 00:00:00 docker-ce-stable | 3.5 kB 00:00:00 extras | 2.9 kB 00:00:00 updates | 2.9 kB 00:00:00 (1/5): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:05 (2/5): extras/7/x86_64/primary_db | 222 kB 00:00:05 (3/5): docker-ce-stable/x86_64/primary_db | 52 kB 00:00:05 (4/5): updates/7/x86_64/primary_db | 4.7 MB 00:00:06 (5/5): base/7/x86_64/primary_db | 6.1 MB 00:00:07 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> パッケージ gcc.x86_64 0:4.8.5-44.el7 を インストール --> 依存性の処理をしています: libgomp = 4.8.5-44.el7 のパッケージ: gcc-4.8.5-44.el7.x86_64 --> 依存性の処理をしています: cpp = 4.8.5-44.el7 のパッケージ: gcc-4.8.5-44.el7.x86_64 --> 依存性の処理をしています: libgcc >= 4.8.5-44.el7 のパッケージ: gcc-4.8.5-44.el7.x86_64 --> 依存性の処理をしています: glibc-devel >= 2.2.90-12 のパッケージ: gcc-4.8.5-44.el7.x86_64 --> 依存性の処理をしています: libmpfr.so.4()(64bit) のパッケージ: gcc-4.8.5-44.el7.x86_64 --> 依存性の処理をしています: libmpc.so.3()(64bit) のパッケージ: gcc-4.8.5-44.el7.x86_64 ---> パッケージ python-devel.x86_64 0:2.7.5-90.el7 を インストール --> 依存性の処理をしています: python(x86-64) = 2.7.5-90.el7 のパッケージ: python-devel-2.7.5-90.el7.x86_64 --> 依存性の処理をしています: python2-rpm-macros > 3-30 のパッケージ: python-devel-2.7.5-90.el7.x86_64 --> 依存性の処理をしています: python-rpm-macros > 3-30 のパッケージ: python-devel-2.7.5-90.el7.x86_64 --> トランザクションの確認を実行しています。 ---> パッケージ cpp.x86_64 0:4.8.5-44.el7 を インストール ---> パッケージ glibc-devel.x86_64 0:2.17-317.el7 を インストール --> 依存性の処理をしています: glibc-headers = 2.17-317.el7 のパッケージ: glibc-devel-2.17-317.el7.x86_64 --> 依存性の処理をしています: glibc = 2.17-317.el7 のパッケージ: glibc-devel-2.17-317.el7.x86_64 --> 依存性の処理をしています: glibc-headers のパッケージ: glibc-devel-2.17-317.el7.x86_64 ---> パッケージ libgcc.x86_64 0:4.8.5-28.el7 を 更新 ---> パッケージ libgcc.x86_64 0:4.8.5-44.el7 を アップデート ---> パッケージ libgomp.x86_64 0:4.8.5-28.el7 を 更新 ---> パッケージ libgomp.x86_64 0:4.8.5-44.el7 を アップデート ---> パッケージ libmpc.x86_64 0:1.0.1-3.el7 を インストール ---> パッケージ mpfr.x86_64 0:3.1.1-4.el7 を インストール ---> パッケージ python.x86_64 0:2.7.5-68.el7 を 更新 ---> パッケージ python.x86_64 0:2.7.5-90.el7 を アップデート --> 依存性の処理をしています: python-libs(x86-64) = 2.7.5-90.el7 のパッケージ: python-2.7.5-90.el7.x86_64 ---> パッケージ python-rpm-macros.noarch 0:3-34.el7 を インストール --> 依存性の処理をしています: python-srpm-macros のパッケージ: python-rpm-macros-3-34.el7.noarch ---> パッケージ python2-rpm-macros.noarch 0:3-34.el7 を インストール --> トランザクションの確認を実行しています。 ---> パッケージ glibc.x86_64 0:2.17-222.el7 を 更新 --> 依存性の処理をしています: glibc = 2.17-222.el7 のパッケージ: glibc-common-2.17-222.el7.x86_64 ---> パッケージ glibc.x86_64 0:2.17-317.el7 を アップデート ---> パッケージ glibc-headers.x86_64 0:2.17-317.el7 を インストール --> 依存性の処理をしています: kernel-headers >= 2.2.1 のパッケージ: glibc-headers-2.17-317.el7.x86_64 --> 依存性の処理をしています: kernel-headers のパッケージ: glibc-headers-2.17-317.el7.x86_64 ---> パッケージ python-libs.x86_64 0:2.7.5-68.el7 を 更新 ---> パッケージ python-libs.x86_64 0:2.7.5-90.el7 を アップデート ---> パッケージ python-srpm-macros.noarch 0:3-34.el7 を インストール --> トランザクションの確認を実行しています。 ---> パッケージ glibc-common.x86_64 0:2.17-222.el7 を 更新 ---> パッケージ glibc-common.x86_64 0:2.17-317.el7 を アップデート ---> パッケージ kernel-headers.x86_64 0:3.10.0-1160.11.1.el7 を インストール --> 依存性解決を終了しました。 依存性を解決しました =========================================================================================================================== Package アーキテクチャー バージョン リポジトリー 容量 =========================================================================================================================== インストール中: gcc x86_64 4.8.5-44.el7 base 16 M python-devel x86_64 2.7.5-90.el7 updates 399 k 依存性関連でのインストールをします: cpp x86_64 4.8.5-44.el7 base 5.9 M glibc-devel x86_64 2.17-317.el7 base 1.1 M glibc-headers x86_64 2.17-317.el7 base 690 k kernel-headers x86_64 3.10.0-1160.11.1.el7 updates 9.0 M libmpc x86_64 1.0.1-3.el7 base 51 k mpfr x86_64 3.1.1-4.el7 base 203 k python-rpm-macros noarch 3-34.el7 base 9.1 k python-srpm-macros noarch 3-34.el7 base 8.8 k python2-rpm-macros noarch 3-34.el7 base 8.1 k 依存性関連での更新をします: glibc x86_64 2.17-317.el7 base 3.6 M glibc-common x86_64 2.17-317.el7 base 11 M libgcc x86_64 4.8.5-44.el7 base 103 k libgomp x86_64 4.8.5-44.el7 base 159 k python x86_64 2.7.5-90.el7 updates 96 k python-libs x86_64 2.7.5-90.el7 updates 5.6 M トランザクションの要約 =========================================================================================================================== インストール 2 パッケージ (+9 個の依存関係のパッケージ) 更新 ( 6 個の依存関係のパッケージ) 総ダウンロード容量: 55 M Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/17): cpp-4.8.5-44.el7.x86_64.rpm | 5.9 MB 00:00:06 (2/17): glibc-2.17-317.el7.x86_64.rpm | 3.6 MB 00:00:00 (3/17): gcc-4.8.5-44.el7.x86_64.rpm | 16 MB 00:00:08 (4/17): glibc-devel-2.17-317.el7.x86_64.rpm | 1.1 MB 00:00:00 (5/17): glibc-headers-2.17-317.el7.x86_64.rpm | 690 kB 00:00:00 (6/17): libgcc-4.8.5-44.el7.x86_64.rpm | 103 kB 00:00:00 (7/17): libgomp-4.8.5-44.el7.x86_64.rpm | 159 kB 00:00:00 (8/17): libmpc-1.0.1-3.el7.x86_64.rpm | 51 kB 00:00:00 (9/17): mpfr-3.1.1-4.el7.x86_64.rpm | 203 kB 00:00:00 (10/17): glibc-common-2.17-317.el7.x86_64.rpm | 11 MB 00:00:02 (11/17): python-2.7.5-90.el7.x86_64.rpm | 96 kB 00:00:05 (12/17): python-devel-2.7.5-90.el7.x86_64.rpm | 399 kB 00:00:00 (13/17): kernel-headers-3.10.0-1160.11.1.el7.x86_64.rpm | 9.0 MB 00:00:07 (14/17): python-libs-2.7.5-90.el7.x86_64.rpm | 5.6 MB 00:00:01 (15/17): python-rpm-macros-3-34.el7.noarch.rpm | 9.1 kB 00:00:05 (16/17): python-srpm-macros-3-34.el7.noarch.rpm | 8.8 kB 00:00:05 (17/17): python2-rpm-macros-3-34.el7.noarch.rpm | 8.1 kB 00:00:00 --------------------------------------------------------------------------------------------------------------------------- 合計 2.5 MB/s | 55 MB 00:00:21 Running transaction check Running transaction test Transaction test succeeded Running transaction 更新します : libgcc-4.8.5-44.el7.x86_64 1/23 更新します : glibc-common-2.17-317.el7.x86_64 2/23 更新します : glibc-2.17-317.el7.x86_64 3/23 warning: /etc/nsswitch.conf created as /etc/nsswitch.conf.rpmnew インストール中 : mpfr-3.1.1-4.el7.x86_64 4/23 インストール中 : libmpc-1.0.1-3.el7.x86_64 5/23 更新します : python-libs-2.7.5-90.el7.x86_64 6/23 更新します : python-2.7.5-90.el7.x86_64 7/23 インストール中 : cpp-4.8.5-44.el7.x86_64 8/23 更新します : libgomp-4.8.5-44.el7.x86_64 9/23 インストール中 : python-srpm-macros-3-34.el7.noarch 10/23 インストール中 : python-rpm-macros-3-34.el7.noarch 11/23 インストール中 : kernel-headers-3.10.0-1160.11.1.el7.x86_64 12/23 インストール中 : glibc-headers-2.17-317.el7.x86_64 13/23 インストール中 : glibc-devel-2.17-317.el7.x86_64 14/23 インストール中 : python2-rpm-macros-3-34.el7.noarch 15/23 インストール中 : python-devel-2.7.5-90.el7.x86_64 16/23 インストール中 : gcc-4.8.5-44.el7.x86_64 17/23 整理中 : python-2.7.5-68.el7.x86_64 18/23 整理中 : python-libs-2.7.5-68.el7.x86_64 19/23 整理中 : libgomp-4.8.5-28.el7.x86_64 20/23 整理中 : glibc-common-2.17-222.el7.x86_64 21/23 整理中 : glibc-2.17-222.el7.x86_64 22/23 整理中 : libgcc-4.8.5-28.el7.x86_64 23/23 検証中 : glibc-2.17-317.el7.x86_64 1/23 検証中 : python-2.7.5-90.el7.x86_64 2/23 検証中 : glibc-devel-2.17-317.el7.x86_64 3/23 検証中 : cpp-4.8.5-44.el7.x86_64 4/23 検証中 : python-devel-2.7.5-90.el7.x86_64 5/23 検証中 : python-rpm-macros-3-34.el7.noarch 6/23 検証中 : glibc-common-2.17-317.el7.x86_64 7/23 検証中 : glibc-headers-2.17-317.el7.x86_64 8/23 検証中 : gcc-4.8.5-44.el7.x86_64 9/23 検証中 : libmpc-1.0.1-3.el7.x86_64 10/23 検証中 : python2-rpm-macros-3-34.el7.noarch 11/23 検証中 : python-libs-2.7.5-90.el7.x86_64 12/23 検証中 : mpfr-3.1.1-4.el7.x86_64 13/23 検証中 : kernel-headers-3.10.0-1160.11.1.el7.x86_64 14/23 検証中 : python-srpm-macros-3-34.el7.noarch 15/23 検証中 : libgcc-4.8.5-44.el7.x86_64 16/23 検証中 : libgomp-4.8.5-44.el7.x86_64 17/23 検証中 : python-libs-2.7.5-68.el7.x86_64 18/23 検証中 : libgomp-4.8.5-28.el7.x86_64 19/23 検証中 : libgcc-4.8.5-28.el7.x86_64 20/23 検証中 : glibc-2.17-222.el7.x86_64 21/23 検証中 : glibc-common-2.17-222.el7.x86_64 22/23 検証中 : python-2.7.5-68.el7.x86_64 23/23 インストール: gcc.x86_64 0:4.8.5-44.el7 python-devel.x86_64 0:2.7.5-90.el7 依存性関連をインストールしました: cpp.x86_64 0:4.8.5-44.el7 glibc-devel.x86_64 0:2.17-317.el7 glibc-headers.x86_64 0:2.17-317.el7 kernel-headers.x86_64 0:3.10.0-1160.11.1.el7 libmpc.x86_64 0:1.0.1-3.el7 mpfr.x86_64 0:3.1.1-4.el7 python-rpm-macros.noarch 0:3-34.el7 python-srpm-macros.noarch 0:3-34.el7 python2-rpm-macros.noarch 0:3-34.el7 依存性を更新しました: glibc.x86_64 0:2.17-317.el7 glibc-common.x86_64 0:2.17-317.el7 libgcc.x86_64 0:4.8.5-44.el7 libgomp.x86_64 0:4.8.5-44.el7 python.x86_64 0:2.7.5-90.el7 python-libs.x86_64 0:2.7.5-90.el7 完了しました! [root@test-01 ~]#
virtualenv のインストールと実行設定
yum -y install python-virtualenv virtualenv /snmposter source /snmposter/bin/activate
実行ログ
[root@test-01 ~]# yum -y install python-virtualenv 読み込んだプラグイン:fastestmirror Loading mirror speeds from cached hostfile * base: ftp.iij.ad.jp * extras: ftp.iij.ad.jp * updates: ftp.iij.ad.jp 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> パッケージ python-virtualenv.noarch 0:15.1.0-4.el7_7 を インストール --> 依存性の処理をしています: python-setuptools のパッケージ: python-virtualenv-15.1.0-4.el7_7.noarch --> トランザクションの確認を実行しています。 ---> パッケージ python-setuptools.noarch 0:0.9.8-7.el7 を インストール --> 依存性の処理をしています: python-backports-ssl_match_hostname のパッケージ: python-setuptools-0.9.8-7.el7.noarch --> トランザクションの確認を実行しています。 ---> パッケージ python-backports-ssl_match_hostname.noarch 0:3.5.0.1-1.el7 を インストール --> 依存性の処理をしています: python-ipaddress のパッケージ: python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch --> 依存性の処理をしています: python-backports のパッケージ: python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch --> トランザクションの確認を実行しています。 ---> パッケージ python-backports.x86_64 0:1.0-8.el7 を インストール ---> パッケージ python-ipaddress.noarch 0:1.0.16-2.el7 を インストール --> 依存性解決を終了しました。 依存性を解決しました =========================================================================================================================== Package アーキテクチャー バージョン リポジトリー 容量 =========================================================================================================================== インストール中: python-virtualenv noarch 15.1.0-4.el7_7 base 1.7 M 依存性関連でのインストールをします: python-backports x86_64 1.0-8.el7 base 5.8 k python-backports-ssl_match_hostname noarch 3.5.0.1-1.el7 base 13 k python-ipaddress noarch 1.0.16-2.el7 base 34 k python-setuptools noarch 0.9.8-7.el7 base 397 k トランザクションの要約 =========================================================================================================================== インストール 1 パッケージ (+4 個の依存関係のパッケージ) 総ダウンロード容量: 2.1 M インストール容量: 4.3 M Downloading packages: (1/5): python-backports-1.0-8.el7.x86_64.rpm | 5.8 kB 00:00:05 (2/5): python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm | 13 kB 00:00:05 (3/5): python-ipaddress-1.0.16-2.el7.noarch.rpm | 34 kB 00:00:00 (4/5): python-setuptools-0.9.8-7.el7.noarch.rpm | 397 kB 00:00:00 (5/5): python-virtualenv-15.1.0-4.el7_7.noarch.rpm | 1.7 MB 00:00:00 --------------------------------------------------------------------------------------------------------------------------- 合計 357 kB/s | 2.1 MB 00:00:06 Running transaction check Running transaction test Transaction test succeeded Running transaction インストール中 : python-backports-1.0-8.el7.x86_64 1/5 インストール中 : python-ipaddress-1.0.16-2.el7.noarch 2/5 インストール中 : python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch 3/5 インストール中 : python-setuptools-0.9.8-7.el7.noarch 4/5 インストール中 : python-virtualenv-15.1.0-4.el7_7.noarch 5/5 検証中 : python-ipaddress-1.0.16-2.el7.noarch 1/5 検証中 : python-virtualenv-15.1.0-4.el7_7.noarch 2/5 検証中 : python-setuptools-0.9.8-7.el7.noarch 3/5 検証中 : python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch 4/5 検証中 : python-backports-1.0-8.el7.x86_64 5/5 インストール: python-virtualenv.noarch 0:15.1.0-4.el7_7 依存性関連をインストールしました: python-backports.x86_64 0:1.0-8.el7 python-backports-ssl_match_hostname.noarch 0:3.5.0.1-1.el7 python-ipaddress.noarch 0:1.0.16-2.el7 python-setuptools.noarch 0:0.9.8-7.el7 完了しました! [root@test-01 ~]# [root@test-01 ~]# virtualenv /snmposter New python executable in /snmposter/bin/python Installing setuptools, pip, wheel...done. [root@test-01 ~]# [root@test-01 ~]# source /snmposter/bin/activate (snmposter) [root@test-01 ~]#
TwistedSNMP のインストール
wget http://downloads.sourceforge.net/project/twistedsnmp/twistedsnmp/0.3.13/TwistedSNMP-0.3.13.tar.gz tar -xzf TwistedSNMP-0.3.13.tar.gz cd TwistedSNMP-0.3.13 python setup.py install cd ..
実行ログ
(snmposter) [root@test-01 ~]# wget http://downloads.sourceforge.net/project/twistedsnmp/twistedsnmp/0.3.13/TwistedSNMP-0.3.13.tar.gz --2021-01-20 17:56:09-- http://downloads.sourceforge.net/project/twistedsnmp/twistedsnmp/0.3.13/TwistedSNMP-0.3.13.tar.gz downloads.sourceforge.net (downloads.sourceforge.net) をDNSに問いあわせています... 216.105.38.13 downloads.sourceforge.net (downloads.sourceforge.net)|216.105.38.13|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 302 Found 場所: https://jaist.dl.sourceforge.net/project/twistedsnmp/twistedsnmp/0.3.13/TwistedSNMP-0.3.13.tar.gz [続く] --2021-01-20 17:56:15-- https://jaist.dl.sourceforge.net/project/twistedsnmp/twistedsnmp/0.3.13/TwistedSNMP-0.3.13.tar.gz jaist.dl.sourceforge.net (jaist.dl.sourceforge.net) をDNSに問いあわせています... 2001:df0:2ed:feed::feed, 150.65.7.130 jaist.dl.sourceforge.net (jaist.dl.sourceforge.net)|2001:df0:2ed:feed::feed|:443 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 200 OK 長さ: 56256 (55K) [application/x-gzip] `TwistedSNMP-0.3.13.tar.gz' に保存中 100%[=================================================================================>] 56,256 --.-K/s 時間 0s 2021-01-20 17:56:15 (234 MB/s) - `TwistedSNMP-0.3.13.tar.gz' へ保存完了 [56256/56256] (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# tar -xzf TwistedSNMP-0.3.13.tar.gz (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# cd TwistedSNMP-0.3.13 (snmposter) [root@test-01 TwistedSNMP-0.3.13]# (snmposter) [root@test-01 TwistedSNMP-0.3.13]# python setup.py install running install running build running build_py creating build creating build/lib creating build/lib/twistedsnmp copying ./agent.py -> build/lib/twistedsnmp copying ./datatypes.py -> build/lib/twistedsnmp copying ./oidstub.py -> build/lib/twistedsnmp copying ./bisectoidstore.py -> build/lib/twistedsnmp copying ./snmpprotocol.py -> build/lib/twistedsnmp copying ./pysnmpproto.py -> build/lib/twistedsnmp copying ./bsdoidstore.py -> build/lib/twistedsnmp copying ./logs.py -> build/lib/twistedsnmp copying ./massretriever.py -> build/lib/twistedsnmp copying ./isnmp.py -> build/lib/twistedsnmp copying ./agentproxy.py -> build/lib/twistedsnmp copying ./__init__.py -> build/lib/twistedsnmp copying ./oidstore.py -> build/lib/twistedsnmp copying ./tableretriever.py -> build/lib/twistedsnmp copying ./version.py -> build/lib/twistedsnmp copying ./twinetables.py -> build/lib/twistedsnmp copying ./agentprotocol.py -> build/lib/twistedsnmp copying ./errors.py -> build/lib/twistedsnmp creating build/lib/twistedsnmp/utilities copying ./utilities/mirroragent.py -> build/lib/twistedsnmp/utilities copying ./utilities/__init__.py -> build/lib/twistedsnmp/utilities copying ./utilities/synchronous.py -> build/lib/twistedsnmp/utilities creating build/lib/twistedsnmp/test copying ./test/simpleagent.py -> build/lib/twistedsnmp/test copying ./test/test.py -> build/lib/twistedsnmp/test copying ./test/test_trap.py -> build/lib/twistedsnmp/test copying ./test/test_get.py -> build/lib/twistedsnmp/test copying ./test/test_set.py -> build/lib/twistedsnmp/test copying ./test/test_storage.py -> build/lib/twistedsnmp/test copying ./test/__init__.py -> build/lib/twistedsnmp/test copying ./test/test_basic.py -> build/lib/twistedsnmp/test copying ./test/basetestcase.py -> build/lib/twistedsnmp/test creating build/lib/twistedsnmp/v3 copying ./v3/agentproxy.py -> build/lib/twistedsnmp/v3 copying ./v3/__init__.py -> build/lib/twistedsnmp/v3 creating build/lib/twistedsnmp/v4 copying ./v4/agentproxy.py -> build/lib/twistedsnmp/v4 copying ./v4/__init__.py -> build/lib/twistedsnmp/v4 running install_lib creating /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/agent.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/datatypes.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/oidstub.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/bisectoidstore.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/snmpprotocol.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/pysnmpproto.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/bsdoidstore.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/logs.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/massretriever.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/isnmp.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/agentproxy.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/__init__.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/oidstore.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/tableretriever.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/version.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/twinetables.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/agentprotocol.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp copying build/lib/twistedsnmp/errors.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp creating /snmposter/lib/python2.7/site-packages/twistedsnmp/utilities copying build/lib/twistedsnmp/utilities/mirroragent.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/utilities copying build/lib/twistedsnmp/utilities/__init__.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/utilities copying build/lib/twistedsnmp/utilities/synchronous.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/utilities creating /snmposter/lib/python2.7/site-packages/twistedsnmp/test copying build/lib/twistedsnmp/test/simpleagent.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/test copying build/lib/twistedsnmp/test/test.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/test copying build/lib/twistedsnmp/test/test_trap.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/test copying build/lib/twistedsnmp/test/test_get.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/test copying build/lib/twistedsnmp/test/test_set.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/test copying build/lib/twistedsnmp/test/test_storage.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/test copying build/lib/twistedsnmp/test/__init__.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/test copying build/lib/twistedsnmp/test/test_basic.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/test copying build/lib/twistedsnmp/test/basetestcase.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/test creating /snmposter/lib/python2.7/site-packages/twistedsnmp/v3 copying build/lib/twistedsnmp/v3/agentproxy.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/v3 copying build/lib/twistedsnmp/v3/__init__.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/v3 creating /snmposter/lib/python2.7/site-packages/twistedsnmp/v4 copying build/lib/twistedsnmp/v4/agentproxy.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/v4 copying build/lib/twistedsnmp/v4/__init__.py -> /snmposter/lib/python2.7/site-packages/twistedsnmp/v4 byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/agent.py to agent.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/datatypes.py to datatypes.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/oidstub.py to oidstub.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/bisectoidstore.py to bisectoidstore.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/snmpprotocol.py to snmpprotocol.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/pysnmpproto.py to pysnmpproto.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/bsdoidstore.py to bsdoidstore.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/logs.py to logs.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/massretriever.py to massretriever.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/isnmp.py to isnmp.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/agentproxy.py to agentproxy.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/oidstore.py to oidstore.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/tableretriever.py to tableretriever.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/version.py to version.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/twinetables.py to twinetables.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/agentprotocol.py to agentprotocol.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/errors.py to errors.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/utilities/mirroragent.py to mirroragent.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/utilities/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/utilities/synchronous.py to synchronous.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/test/simpleagent.py to simpleagent.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/test/test.py to test.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/test/test_trap.py to test_trap.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/test/test_get.py to test_get.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/test/test_set.py to test_set.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/test/test_storage.py to test_storage.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/test/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/test/test_basic.py to test_basic.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/test/basetestcase.py to basetestcase.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/v3/agentproxy.py to agentproxy.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/v3/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/v4/agentproxy.py to agentproxy.pyc byte-compiling /snmposter/lib/python2.7/site-packages/twistedsnmp/v4/__init__.py to __init__.pyc running install_egg_info Writing /snmposter/lib/python2.7/site-packages/TwistedSNMP-0.3.13-py2.7.egg-info (snmposter) [root@test-01 TwistedSNMP-0.3.13]# (snmposter) [root@test-01 TwistedSNMP-0.3.13]# cd .. (snmposter) [root@test-01 ~]#
PySNMP-SE のインストール
wget http://downloads.sourceforge.net/project/twistedsnmp/pysnmp-se/3.5.2/pysnmp-se-3.5.2.tar.gz tar -xzf pysnmp-se-3.5.2.tar.gz cd pysnmp-se-3.5.2 python setup.py install cd ..
実行ログ
(snmposter) [root@test-01 ~]# wget http://downloads.sourceforge.net/project/twistedsnmp/pysnmp-se/3.5.2/pysnmp-se-3.5.2.tar.gz --2021-01-20 17:57:33-- http://downloads.sourceforge.net/project/twistedsnmp/pysnmp-se/3.5.2/pysnmp-se-3.5.2.tar.gz downloads.sourceforge.net (downloads.sourceforge.net) をDNSに問いあわせています... 216.105.38.13 downloads.sourceforge.net (downloads.sourceforge.net)|216.105.38.13|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 302 Found 場所: https://jaist.dl.sourceforge.net/project/twistedsnmp/pysnmp-se/3.5.2/pysnmp-se-3.5.2.tar.gz [続く] --2021-01-20 17:57:38-- https://jaist.dl.sourceforge.net/project/twistedsnmp/pysnmp-se/3.5.2/pysnmp-se-3.5.2.tar.gz jaist.dl.sourceforge.net (jaist.dl.sourceforge.net) をDNSに問いあわせています... 2001:df0:2ed:feed::feed, 150.65.7.130 jaist.dl.sourceforge.net (jaist.dl.sourceforge.net)|2001:df0:2ed:feed::feed|:443 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 200 OK 長さ: 94435 (92K) [application/x-gzip] `pysnmp-se-3.5.2.tar.gz' に保存中 100%[=================================================================================>] 94,435 --.-K/s 時間 0.06s 2021-01-20 17:57:39 (1.46 MB/s) - `pysnmp-se-3.5.2.tar.gz' へ保存完了 [94435/94435] (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# tar -xzf pysnmp-se-3.5.2.tar.gz (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# cd pysnmp-se-3.5.2 (snmposter) [root@test-01 pysnmp-se-3.5.2]# (snmposter) [root@test-01 pysnmp-se-3.5.2]# python setup.py install running install running build running build_py creating build creating build/lib creating build/lib/pysnmp copying pysnmp/error.py -> build/lib/pysnmp copying pysnmp/__init__.py -> build/lib/pysnmp copying pysnmp/version.py -> build/lib/pysnmp creating build/lib/pysnmp/asn1 copying pysnmp/asn1/error.py -> build/lib/pysnmp/asn1 copying pysnmp/asn1/oidtree.py -> build/lib/pysnmp/asn1 copying pysnmp/asn1/constraints.py -> build/lib/pysnmp/asn1 copying pysnmp/asn1/test_oid.py -> build/lib/pysnmp/asn1 copying pysnmp/asn1/oid.py -> build/lib/pysnmp/asn1 copying pysnmp/asn1/univ.py -> build/lib/pysnmp/asn1 copying pysnmp/asn1/base.py -> build/lib/pysnmp/asn1 copying pysnmp/asn1/__init__.py -> build/lib/pysnmp/asn1 creating build/lib/pysnmp/asn1/encoding copying pysnmp/asn1/encoding/error.py -> build/lib/pysnmp/asn1/encoding copying pysnmp/asn1/encoding/__init__.py -> build/lib/pysnmp/asn1/encoding creating build/lib/pysnmp/asn1/encoding/ber copying pysnmp/asn1/encoding/ber/error.py -> build/lib/pysnmp/asn1/encoding/ber copying pysnmp/asn1/encoding/ber/univ.py -> build/lib/pysnmp/asn1/encoding/ber copying pysnmp/asn1/encoding/ber/base.py -> build/lib/pysnmp/asn1/encoding/ber copying pysnmp/asn1/encoding/ber/__init__.py -> build/lib/pysnmp/asn1/encoding/ber creating build/lib/pysnmp/proto copying pysnmp/proto/rfc1155.py -> build/lib/pysnmp/proto copying pysnmp/proto/rfc1157.py -> build/lib/pysnmp/proto copying pysnmp/proto/rfc1902.py -> build/lib/pysnmp/proto copying pysnmp/proto/rfc1905.py -> build/lib/pysnmp/proto copying pysnmp/proto/v1.py -> build/lib/pysnmp/proto copying pysnmp/proto/error.py -> build/lib/pysnmp/proto copying pysnmp/proto/v2c.py -> build/lib/pysnmp/proto copying pysnmp/proto/__init__.py -> build/lib/pysnmp/proto creating build/lib/pysnmp/proto/api copying pysnmp/proto/api/error.py -> build/lib/pysnmp/proto/api copying pysnmp/proto/api/__init__.py -> build/lib/pysnmp/proto/api creating build/lib/pysnmp/proto/api/alpha copying pysnmp/proto/api/alpha/rfc1155.py -> build/lib/pysnmp/proto/api/alpha copying pysnmp/proto/api/alpha/rfc1157.py -> build/lib/pysnmp/proto/api/alpha copying pysnmp/proto/api/alpha/rfc1905.py -> build/lib/pysnmp/proto/api/alpha copying pysnmp/proto/api/alpha/v1.py -> build/lib/pysnmp/proto/api/alpha copying pysnmp/proto/api/alpha/pdutypes.py -> build/lib/pysnmp/proto/api/alpha copying pysnmp/proto/api/alpha/versions.py -> build/lib/pysnmp/proto/api/alpha copying pysnmp/proto/api/alpha/v2c.py -> build/lib/pysnmp/proto/api/alpha copying pysnmp/proto/api/alpha/__init__.py -> build/lib/pysnmp/proto/api/alpha creating build/lib/pysnmp/proto/api/generic copying pysnmp/proto/api/generic/rfc1157.py -> build/lib/pysnmp/proto/api/generic copying pysnmp/proto/api/generic/rfc1905.py -> build/lib/pysnmp/proto/api/generic copying pysnmp/proto/api/generic/__init__.py -> build/lib/pysnmp/proto/api/generic creating build/lib/pysnmp/test copying pysnmp/test/trap.py -> build/lib/pysnmp/test copying pysnmp/test/getset.py -> build/lib/pysnmp/test copying pysnmp/test/base.py -> build/lib/pysnmp/test copying pysnmp/test/walk.py -> build/lib/pysnmp/test copying pysnmp/test/__init__.py -> build/lib/pysnmp/test copying pysnmp/test/suite.py -> build/lib/pysnmp/test creating build/lib/pysnmp/mapping copying pysnmp/mapping/error.py -> build/lib/pysnmp/mapping copying pysnmp/mapping/__init__.py -> build/lib/pysnmp/mapping creating build/lib/pysnmp/mapping/udp copying pysnmp/mapping/udp/error.py -> build/lib/pysnmp/mapping/udp copying pysnmp/mapping/udp/role.py -> build/lib/pysnmp/mapping/udp copying pysnmp/mapping/udp/asynrole.py -> build/lib/pysnmp/mapping/udp copying pysnmp/mapping/udp/__init__.py -> build/lib/pysnmp/mapping/udp creating build/lib/pysnmp/compat copying pysnmp/compat/__init__.py -> build/lib/pysnmp/compat creating build/lib/pysnmp/compat/pysnmp1x copying pysnmp/compat/pysnmp1x/message.py -> build/lib/pysnmp/compat/pysnmp1x copying pysnmp/compat/pysnmp1x/error.py -> build/lib/pysnmp/compat/pysnmp1x copying pysnmp/compat/pysnmp1x/msession.py -> build/lib/pysnmp/compat/pysnmp1x copying pysnmp/compat/pysnmp1x/ber.py -> build/lib/pysnmp/compat/pysnmp1x copying pysnmp/compat/pysnmp1x/session.py -> build/lib/pysnmp/compat/pysnmp1x copying pysnmp/compat/pysnmp1x/__init__.py -> build/lib/pysnmp/compat/pysnmp1x copying pysnmp/compat/pysnmp1x/asynsnmp.py -> build/lib/pysnmp/compat/pysnmp1x copying pysnmp/compat/pysnmp1x/wrapexp.py -> build/lib/pysnmp/compat/pysnmp1x creating build/lib/pysnmp/compat/pysnmp2x copying pysnmp/compat/pysnmp2x/v1.py -> build/lib/pysnmp/compat/pysnmp2x copying pysnmp/compat/pysnmp2x/error.py -> build/lib/pysnmp/compat/pysnmp2x copying pysnmp/compat/pysnmp2x/role.py -> build/lib/pysnmp/compat/pysnmp2x copying pysnmp/compat/pysnmp2x/v2c.py -> build/lib/pysnmp/compat/pysnmp2x copying pysnmp/compat/pysnmp2x/asynrole.py -> build/lib/pysnmp/compat/pysnmp2x copying pysnmp/compat/pysnmp2x/asn1.py -> build/lib/pysnmp/compat/pysnmp2x copying pysnmp/compat/pysnmp2x/__init__.py -> build/lib/pysnmp/compat/pysnmp2x creating build/lib/pysnmp/compat/snmpy copying pysnmp/compat/snmpy/__init__.py -> build/lib/pysnmp/compat/snmpy copying pysnmp/compat/snmpy/snmpy.py -> build/lib/pysnmp/compat/snmpy running install_lib creating /snmposter/lib/python2.7/site-packages/pysnmp copying build/lib/pysnmp/error.py -> /snmposter/lib/python2.7/site-packages/pysnmp copying build/lib/pysnmp/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp copying build/lib/pysnmp/version.py -> /snmposter/lib/python2.7/site-packages/pysnmp creating /snmposter/lib/python2.7/site-packages/pysnmp/asn1 copying build/lib/pysnmp/asn1/error.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1 copying build/lib/pysnmp/asn1/oidtree.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1 copying build/lib/pysnmp/asn1/constraints.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1 copying build/lib/pysnmp/asn1/test_oid.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1 copying build/lib/pysnmp/asn1/oid.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1 copying build/lib/pysnmp/asn1/univ.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1 copying build/lib/pysnmp/asn1/base.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1 copying build/lib/pysnmp/asn1/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1 creating /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding copying build/lib/pysnmp/asn1/encoding/error.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding copying build/lib/pysnmp/asn1/encoding/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding creating /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/ber copying build/lib/pysnmp/asn1/encoding/ber/error.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/ber copying build/lib/pysnmp/asn1/encoding/ber/univ.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/ber copying build/lib/pysnmp/asn1/encoding/ber/base.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/ber copying build/lib/pysnmp/asn1/encoding/ber/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/ber creating /snmposter/lib/python2.7/site-packages/pysnmp/proto copying build/lib/pysnmp/proto/rfc1155.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto copying build/lib/pysnmp/proto/rfc1157.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto copying build/lib/pysnmp/proto/rfc1902.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto copying build/lib/pysnmp/proto/rfc1905.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto copying build/lib/pysnmp/proto/v1.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto copying build/lib/pysnmp/proto/error.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto copying build/lib/pysnmp/proto/v2c.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto copying build/lib/pysnmp/proto/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto creating /snmposter/lib/python2.7/site-packages/pysnmp/proto/api copying build/lib/pysnmp/proto/api/error.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api copying build/lib/pysnmp/proto/api/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api creating /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha copying build/lib/pysnmp/proto/api/alpha/rfc1155.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha copying build/lib/pysnmp/proto/api/alpha/rfc1157.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha copying build/lib/pysnmp/proto/api/alpha/rfc1905.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha copying build/lib/pysnmp/proto/api/alpha/v1.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha copying build/lib/pysnmp/proto/api/alpha/pdutypes.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha copying build/lib/pysnmp/proto/api/alpha/versions.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha copying build/lib/pysnmp/proto/api/alpha/v2c.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha copying build/lib/pysnmp/proto/api/alpha/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha creating /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/generic copying build/lib/pysnmp/proto/api/generic/rfc1157.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/generic copying build/lib/pysnmp/proto/api/generic/rfc1905.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/generic copying build/lib/pysnmp/proto/api/generic/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/generic creating /snmposter/lib/python2.7/site-packages/pysnmp/test copying build/lib/pysnmp/test/trap.py -> /snmposter/lib/python2.7/site-packages/pysnmp/test copying build/lib/pysnmp/test/getset.py -> /snmposter/lib/python2.7/site-packages/pysnmp/test copying build/lib/pysnmp/test/base.py -> /snmposter/lib/python2.7/site-packages/pysnmp/test copying build/lib/pysnmp/test/walk.py -> /snmposter/lib/python2.7/site-packages/pysnmp/test copying build/lib/pysnmp/test/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/test copying build/lib/pysnmp/test/suite.py -> /snmposter/lib/python2.7/site-packages/pysnmp/test creating /snmposter/lib/python2.7/site-packages/pysnmp/mapping copying build/lib/pysnmp/mapping/error.py -> /snmposter/lib/python2.7/site-packages/pysnmp/mapping copying build/lib/pysnmp/mapping/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/mapping creating /snmposter/lib/python2.7/site-packages/pysnmp/mapping/udp copying build/lib/pysnmp/mapping/udp/error.py -> /snmposter/lib/python2.7/site-packages/pysnmp/mapping/udp copying build/lib/pysnmp/mapping/udp/role.py -> /snmposter/lib/python2.7/site-packages/pysnmp/mapping/udp copying build/lib/pysnmp/mapping/udp/asynrole.py -> /snmposter/lib/python2.7/site-packages/pysnmp/mapping/udp copying build/lib/pysnmp/mapping/udp/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/mapping/udp creating /snmposter/lib/python2.7/site-packages/pysnmp/compat copying build/lib/pysnmp/compat/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat creating /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x copying build/lib/pysnmp/compat/pysnmp1x/message.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x copying build/lib/pysnmp/compat/pysnmp1x/error.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x copying build/lib/pysnmp/compat/pysnmp1x/msession.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x copying build/lib/pysnmp/compat/pysnmp1x/ber.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x copying build/lib/pysnmp/compat/pysnmp1x/session.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x copying build/lib/pysnmp/compat/pysnmp1x/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x copying build/lib/pysnmp/compat/pysnmp1x/asynsnmp.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x copying build/lib/pysnmp/compat/pysnmp1x/wrapexp.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x creating /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x copying build/lib/pysnmp/compat/pysnmp2x/v1.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x copying build/lib/pysnmp/compat/pysnmp2x/error.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x copying build/lib/pysnmp/compat/pysnmp2x/role.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x copying build/lib/pysnmp/compat/pysnmp2x/v2c.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x copying build/lib/pysnmp/compat/pysnmp2x/asynrole.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x copying build/lib/pysnmp/compat/pysnmp2x/asn1.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x copying build/lib/pysnmp/compat/pysnmp2x/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x creating /snmposter/lib/python2.7/site-packages/pysnmp/compat/snmpy copying build/lib/pysnmp/compat/snmpy/__init__.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/snmpy copying build/lib/pysnmp/compat/snmpy/snmpy.py -> /snmposter/lib/python2.7/site-packages/pysnmp/compat/snmpy byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/error.py to error.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/version.py to version.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/error.py to error.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/oidtree.py to oidtree.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/constraints.py to constraints.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/test_oid.py to test_oid.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/oid.py to oid.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/univ.py to univ.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/base.py to base.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/error.py to error.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/ber/error.py to error.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/ber/univ.py to univ.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/ber/base.py to base.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/asn1/encoding/ber/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/rfc1155.py to rfc1155.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/rfc1157.py to rfc1157.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/rfc1902.py to rfc1902.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/rfc1905.py to rfc1905.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/v1.py to v1.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/error.py to error.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/v2c.py to v2c.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/error.py to error.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha/rfc1155.py to rfc1155.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha/rfc1157.py to rfc1157.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha/rfc1905.py to rfc1905.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha/v1.py to v1.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha/pdutypes.py to pdutypes.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha/versions.py to versions.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha/v2c.py to v2c.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/alpha/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/generic/rfc1157.py to rfc1157.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/generic/rfc1905.py to rfc1905.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/proto/api/generic/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/test/trap.py to trap.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/test/getset.py to getset.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/test/base.py to base.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/test/walk.py to walk.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/test/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/test/suite.py to suite.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/mapping/error.py to error.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/mapping/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/mapping/udp/error.py to error.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/mapping/udp/role.py to role.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/mapping/udp/asynrole.py to asynrole.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/mapping/udp/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x/message.py to message.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x/error.py to error.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x/msession.py to msession.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x/ber.py to ber.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x/session.py to session.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x/asynsnmp.py to asynsnmp.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp1x/wrapexp.py to wrapexp.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x/v1.py to v1.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x/error.py to error.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x/role.py to role.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x/v2c.py to v2c.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x/asynrole.py to asynrole.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x/asn1.py to asn1.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/pysnmp2x/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/snmpy/__init__.py to __init__.pyc byte-compiling /snmposter/lib/python2.7/site-packages/pysnmp/compat/snmpy/snmpy.py to snmpy.pyc running install_egg_info Writing /snmposter/lib/python2.7/site-packages/pysnmp_se-3.5.2-py2.7.egg-info (snmposter) [root@test-01 pysnmp-se-3.5.2]# (snmposter) [root@test-01 pysnmp-se-3.5.2]# cd .. (snmposter) [root@test-01 ~]#
snmposter のインストール
pip install snmposter
実行ログ
(snmposter) [root@test-01 ~]# pip install snmposter Collecting snmposter Downloading https://files.pythonhosted.org/packages/d5/bd/81c673b5f69fa620b6ca67ad35ed847e05843c76a5b430f26e15c0981ff6/snmposter-1.0.4.tar.gz Collecting Twisted (from snmposter) Downloading https://files.pythonhosted.org/packages/4d/15/890ba1d83dc29ad71427ce5174d5963b84a25c8cf1973815107709fbb520/Twisted-20.3.0-cp27-cp27mu-manylinux1_x86_64.whl (3.2MB) 100% |????????????????????????????????| 3.2MB 327kB/s Collecting constantly>=15.1 (from Twisted->snmposter) Downloading https://files.pythonhosted.org/packages/b9/65/48c1909d0c0aeae6c10213340ce682db01b48ea900a7d9fce7a7910ff318/constantly-15.1.0-py2.py3-none-any.whl Collecting attrs>=19.2.0 (from Twisted->snmposter) Downloading https://files.pythonhosted.org/packages/c3/aa/cb45262569fcc047bf070b5de61813724d6726db83259222cd7b4c79821a/attrs-20.3.0-py2.py3-none-any.whl (49kB) 100% |????????????????????????????????| 51kB 6.7MB/s Collecting zope.interface>=4.4.2 (from Twisted->snmposter) Downloading https://files.pythonhosted.org/packages/64/73/8de66bdab6c4494232339eba8f8864521180c9a76c7c6059b4202adb1e03/zope.interface-5.2.0-cp27-cp27mu-manylinux1_x86_64.whl (232kB) 100% |????????????????????????????????| 235kB 3.8MB/s Collecting Automat>=0.3.0 (from Twisted->snmposter) Downloading https://files.pythonhosted.org/packages/dd/83/5f6f3c1a562674d65efc320257bdc0873ec53147835aeef7762fe7585273/Automat-20.2.0-py2.py3-none-any.whl Collecting hyperlink>=17.1.1 (from Twisted->snmposter) Downloading https://files.pythonhosted.org/packages/6e/aa/8caf6a0a3e62863cbb9dab27135660acba46903b703e224f14f447e57934/hyperlink-21.0.0-py2.py3-none-any.whl (74kB) 100% |????????????????????????????????| 81kB 7.6MB/s Collecting incremental>=16.10.1 (from Twisted->snmposter) Downloading https://files.pythonhosted.org/packages/f5/1d/c98a587dc06e107115cf4a58b49de20b19222c83d75335a192052af4c4b7/incremental-17.5.0-py2.py3-none-any.whl Collecting PyHamcrest!=1.10.0,>=1.9.0 (from Twisted->snmposter) Downloading https://files.pythonhosted.org/packages/d9/6b/fb2e701f25303c620149923d98085c6d7b052d112044764cbf00cc07469e/PyHamcrest-1.10.1.tar.gz (43kB) 100% |????????????????????????????????| 51kB 7.7MB/s Requirement already satisfied: setuptools in /snmposter/lib/python2.7/site-packages (from zope.interface>=4.4.2->Twisted->snmposter) Collecting six (from Automat>=0.3.0->Twisted->snmposter) Downloading https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl Collecting typing; python_version < "3.5" (from hyperlink>=17.1.1->Twisted->snmposter) Downloading https://files.pythonhosted.org/packages/3b/c0/e44213fcb799eac02881e2485724ba5b0914600bc9df6ed922e364fdc059/typing-3.7.4.3-py2-none-any.whl Collecting idna>=2.5 (from hyperlink>=17.1.1->Twisted->snmposter) Downloading https://files.pythonhosted.org/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl (58kB) 100% |????????????????????????????????| 61kB 6.9MB/s Building wheels for collected packages: snmposter, PyHamcrest Running setup.py bdist_wheel for snmposter ... done Stored in directory: /root/.cache/pip/wheels/e4/e4/90/aad4818fe5336aacfec7fdb3650bfba603a74283f806c11517 Running setup.py bdist_wheel for PyHamcrest ... done Stored in directory: /root/.cache/pip/wheels/8f/88/5d/2d12b9e226ee11ce171a603275d8dd6546d93202466b7fe173 Successfully built snmposter PyHamcrest Installing collected packages: constantly, attrs, zope.interface, six, Automat, typing, idna, hyperlink, incremental, PyHamcrest, Twisted, snmposter Successfully installed Automat-20.2.0 PyHamcrest-1.10.1 Twisted-20.3.0 attrs-20.3.0 constantly-15.1.0 hyperlink-21.0.0 idna-2.10 incremental-17.5.0 six-1.15.0 snmposter-1.0.4 typing-3.7.4.3 zope.interface-5.2.0 You are using pip version 9.0.1, however version 20.3.3 is available. You should consider upgrading via the 'pip install --upgrade pip' command. (snmposter) [root@test-01 ~]#
snmposter実行用ファイルの準備
snmposter の実行には以下の2つのファイルが必要。
それぞれ準備する。
snmpwalkで取得したデータ(テキスト)
実行に必要なsnmpwalkの実行結果をファイルにしたものを用意する。
今回は以下の取得値を ar260sv2_snmpv2c.txt として保存して使用する。(自前で購入したAR260SV2のsnmpwalkの実行結果)
※ snmpwalkでデータを取得する際には、-ObenU
のオプションを指定して、OIDを数値表記にすること。
MIB変数に翻訳されてしまうとsnmposterで読み込み時に解釈できないみたい。
.1.3.6.1.2.1.1.1.0 = STRING: CentreCOM AR260S V2 Version 3.3.2 B03 .1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.207.1.23.1.1 .1.3.6.1.2.1.1.3.0 = Timeticks: (68576537) 7 days, 22:29:25.37 .1.3.6.1.2.1.1.4.0 = STRING: .1.3.6.1.2.1.1.5.0 = STRING: AR260SV2 .1.3.6.1.2.1.1.6.0 = STRING: 2F .1.3.6.1.2.1.1.7.0 = INTEGER: 72 .1.3.6.1.2.1.1.8.0 = Timeticks: (107) 0:00:01.07
↑ その他いっぱい情報はとれる。
SNMPエージェントの設定 (csvファイル)
前項で準備した snmpwalk の取得データが保存されているファイルと、SNMPエージェントとして稼働するために必要な情報を csv 形式のファイルに定義する。
snmposterはこの csv ファイルを読み込んでSNMPエージェントとしてふるまう。
csvファイルの設定は以下の通り。
定義方法
<snmpwalkで取得したデータが記載されているファイルのフルパス>,<IPアドレス>
定義例 (agents.csv として作成)
/root/ar260sv2_snmpv2c.txt,192.168.3.251 /root/ar260sv2_snmpv2c.txt,192.168.3.252
※ このcsvファイルには複数のエージェントの設定ができる
snmposterの起動
ファイルを保存したら、以下のコマンドで snmposter を起動。
source /snmposter/bin/activate snmposter -f /<path>/agent.csv
実行ログ
[root@test-01 ~]# source /snmposter/bin/activate (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# snmposter -f /root/agents.csv Starting /root/ar260sv2_snmpv2c.txt on 192.168.3.251. Starting /root/ar260sv2_snmpv2c.txt on 192.168.3.252. (snmposter) [root@test-01 ~]#
net-snmpによるデータ取得結果
snmpwalkコマンドで情報取得してみる。
今回の対象ホストは 192.168.3.251 と 192.168.3.252 で、どちらも同じ情報が取得できた。
実行例
[root@zbx-svr-5 ~]# snmpwalk -v 2c -c public -ObenU 192.168.3.251 >192_168_3_251.txt [root@zbx-svr-5 ~]# snmpwalk -v 2c -c public -ObenU 192.168.3.252 >192_168_3_252.txt [root@zbx-svr-5 ~]# ll 合計 128 -rw-r--r-- 1 root root 37606 1月 20 21:22 192_168_3_251.txt -rw-r--r-- 1 root root 37606 1月 20 21:22 192_168_3_252.txt -rw-------. 1 root root 1545 8月 29 13:44 anaconda-ks.cfg -rw-r--r-- 1 root root 37784 1月 20 16:51 ar260sv2_snmpv2c.txt drwxr-xr-x 3 root root 22 8月 29 15:55 work -rw-r--r-- 1 root root 141 1月 20 21:15 zbx_send_data.txt [root@zbx-svr-5 ~]# [root@zbx-svr-5 ~]# diff 192_168_3_251.txt 192_168_3_252.txt [root@zbx-svr-5 ~]# [root@zbx-svr-5 ~]# cat 192_168_3_251.txt .1.3.6.1.2.1.1.1.0 = STRING: CentreCOM AR260S V2 Version 3.3.2 B03 .1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.207.1.23.1.1 .1.3.6.1.2.1.1.3.0 = Timeticks: (68576537) 7 days, 22:29:25.37 .1.3.6.1.2.1.1.4.0 = STRING: .1.3.6.1.2.1.1.5.0 = STRING: AR260SV2 .1.3.6.1.2.1.1.6.0 = STRING: 2F .1.3.6.1.2.1.1.7.0 = INTEGER: 72 .1.3.6.1.2.1.1.8.0 = Timeticks: (107) 0:00:01.07 (その他、いっぱい情報はとれます。ここでは省略) End of MIB [root@zbx-svr-5 ~]#
停止手順
- ps で pid を調べて kill
- network を再起動
例
(snmposter) [root@test-01 ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet 192.168.3.251/32 scope global lo valid_lft forever preferred_lft forever inet 192.168.3.252/32 scope global lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:15:5d:de:01:0a brd ff:ff:ff:ff:ff:ff inet 192.168.3.241/24 brd 192.168.3.255 scope global noprefixroute eth0 valid_lft forever preferred_lft forever inet6 2400:2411:340:b212:4742:b192:29b8:3882/64 scope global noprefixroute dynamic valid_lft 1121sec preferred_lft 521sec inet6 fe80::a9f0:ee29:9437:a951/64 scope link noprefixroute valid_lft forever preferred_lft forever (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# ps -aux |grep snmp root 4936 0.3 0.9 230224 16836 ? S 21:21 0:03 /snmposter/bin/python /snmposter/bin/snmposter -f /root/agents.csv root 8072 0.0 0.0 112824 968 pts/0 R+ 21:37 0:00 grep --color=auto snmp (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# kill 4936 (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# snmposter -f /root/agents.csv Starting /root/ar260sv2_snmpv2c.txt on 192.168.3.251. RTNETLINK answers: File exists Starting /root/ar260sv2_snmpv2c.txt on 192.168.3.252. RTNETLINK answers: File exists (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# systemctl restart network (snmposter) [root@test-01 ~]# (snmposter) [root@test-01 ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:15:5d:de:01:0a brd ff:ff:ff:ff:ff:ff inet 192.168.3.241/24 brd 192.168.3.255 scope global noprefixroute eth0 valid_lft forever preferred_lft forever inet6 2400:2411:340:b212:4742:b192:29b8:3882/64 scope global noprefixroute dynamic valid_lft 945sec preferred_lft 345sec inet6 fe80::a9f0:ee29:9437:a951/64 scope link noprefixroute valid_lft forever preferred_lft forever (snmposter) [root@test-01 ~]#
注意事項
- コミュニティ名は public
snmpwalkのデータ等設定を変更したい場合には snmposter を再起動する必要がある
snmpwalk のパラメータで最後に指定するOIDに数値を設定する場合の動作に違和感がある
以下の3パターンは実機に対してだとどれも値が返ってくるが、対象が snmposter だと値が取得できないものがある。
何も指定なし → 値が取得できる
例
snmpwalk -v 2c -c public -ObenU 192.168.3.251
ドットのみ、もしくは .1 を指定 → 値が取得できない
例
snmpwalk -v 2c -c public -ObenU 192.168.3.251 . snmpwalk -v 2c -c public -ObenU 192.168.3.251 .1
.1.3 を指定 → 値が取得できる
例
snmpwalk -v 2c -c public -ObenU 192.168.3.251 .1.3
実行例
[root@zbx-svr-5 ~]# snmpwalk -v 2c -c public -ObenU 192.168.3.251
.1.3.6.1.2.1.1.1.0 = STRING: CentreCOM AR260S V2 Version 3.3.2 B03
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.207.1.23.1.1
.1.3.6.1.2.1.1.3.0 = Timeticks: (68576537) 7 days, 22:29:25.37
.1.3.6.1.2.1.1.4.0 = STRING:
.1.3.6.1.2.1.1.5.0 = STRING: AR260SV2
.1.3.6.1.2.1.1.6.0 = STRING: 2F
.1.3.6.1.2.1.1.7.0 = INTEGER: 72
.1.3.6.1.2.1.1.8.0 = Timeticks: (107) 0:00:01.07
(ここでもいっぱい情報はとれる!)
End of MIB
[root@zbx-svr-5 ~]#
[root@zbx-svr-5 ~]# snmpwalk -v 2c -c public -ObenU 192.168.3.251 .
End of MIB
[root@zbx-svr-5 ~]# snmpwalk -v 2c -c public -ObenU 192.168.3.251 .1
End of MIB
[root@zbx-svr-5 ~]#
[root@zbx-svr-5 ~]# snmpwalk -v 2c -c public -ObenU 192.168.3.251 .1.3
.1.3.6.1.2.1.1.1.0 = STRING: CentreCOM AR260S V2 Version 3.3.2 B03
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.207.1.23.1.1
.1.3.6.1.2.1.1.3.0 = Timeticks: (68576537) 7 days, 22:29:25.37
.1.3.6.1.2.1.1.4.0 = STRING:
.1.3.6.1.2.1.1.5.0 = STRING: AR260SV2
.1.3.6.1.2.1.1.6.0 = STRING: 2F
.1.3.6.1.2.1.1.7.0 = INTEGER: 72
.1.3.6.1.2.1.1.8.0 = Timeticks: (107) 0:00:01.07
(ここでもいっぱい情報はとれる!!)
End of MIB
[root@zbx-svr-5 ~]#