「Template SNMP Disks」テンプレートを使用した監視方法について
お世話になっております。
現在、「Template SNMP Disks」テンプレートを使用して
Linux のディスク使用率を監視することを検討しております。
※今後、NetAppのディスク監視で「Template SNMP Disks」テンプレートを使用したいため
「Template SNMP Disks」テンプレートでは、snmpの「hrStorageDescr」キー
に一致する項目の値を取得していると思うのですが、「snmpwalk」コマンドを
使用して全項目を抽出しましたが、「hrStorageDescr」が記載された項目は
抽出されませんでした。以下、実行結果になります。
//////////////////////////////////////////////////////////////////////
[root@zbxsvr ~]# snmpwalk -v 2c -c public 192.168.56.101 .
SNMPv2-MIB::sysDescr.0 = STRING: Linux zbxsvr.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (56127) 0:09:21.27
SNMPv2-MIB::sysContact.0 = STRING: Root (configure /etc/snmp/snmp.local.conf)
SNMPv2-MIB::sysName.0 = STRING: zbxsvr.localdomain
SNMPv2-MIB::sysLocation.0 = STRING: Unknown (edit /etc/snmp/snmpd.conf)
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (15) 0:00:00.15
SNMPv2-MIB::sysORID.1 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.2 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.3 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.5 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.6 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.8 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.9 = OID: SNMP-NOTIFICATION-MIB::snmpNotifyFullCompliance
SNMPv2-MIB::sysORID.10 = OID: NOTIFICATION-LOG-MIB::notificationLogMIB
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.2 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORDescr.3 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.9 = STRING: The MIB modules for managing SNMP Notification, plus filtering.
SNMPv2-MIB::sysORDescr.10 = STRING: The MIB module for logging SNMP Notifications.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (15) 0:00:00.15
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (15) 0:00:00.15
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (15) 0:00:00.15
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (15) 0:00:00.15
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (15) 0:00:00.15
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (15) 0:00:00.15
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (15) 0:00:00.15
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (15) 0:00:00.15
SNMPv2-MIB::sysORUpTime.9 = Timeticks: (15) 0:00:00.15
SNMPv2-MIB::sysORUpTime.10 = Timeticks: (15) 0:00:00.15
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (2043024) 5:40:30.24
HOST-RESOURCES-MIB::hrSystemUptime.0 = No more variables left in this MIB View (It is past the end of the MIB tree)
//////////////////////////////////////////////////////////////////////
上記、「hrStorageDescr」に関連する項目が抽出されない理由を
ご存知の方はおられますでしょうか?
ご存知の方がおられましたら、
ご教示頂けますよう、よろしくお願いします。
TNK - 投稿数: 4769
snmpwalkコマンドで引数に指定しているIPアドレスは、NetAppの機
器のものですか?
メッセージの内容からして、ZabbixサーバーのIPアドレスを指定し
ていませんか?
あと、質問される際には、Zabbixの詳細なバージョンもお教えくだ
さい。
REN - 投稿数: 13
お世話になっております。
>snmpwalkコマンドで引数に指定しているIPアドレスは、NetAppの機
>器のものですか?
>メッセージの内容からして、ZabbixサーバーのIPアドレスを指定し
>ていませんか?
ご認識の通り、IPは Zabbixサーバを指定しております。
Zabbixサーバからも MIBからディスク情報は取得される認識でしたが、
取得できないのでしょうか?
NetAppは本番機となるため、事前に、Zabbixサーバからの情報取得の
動作を確認したく、こちらを実施しております。
>あと、質問される際には、Zabbixの詳細なバージョンもお教えくだ
>さい。
Zabbixのバージョンは以下になります。
------------------------------------------------------------------------------
[root@zbxsvr ~]# zabbix_server -V
Zabbix server v2.2.20 (revision 72882) (25 September 2017)
Compilation time: Sep 26 2017 23:25:51
[root@zbxsvr ~]# zabbix_agentd -V
Zabbix Agent (daemon) v2.2.20 (revision 72882) (25 September 2017)
Compilation time: Sep 26 2017 23:30:19
------------------------------------------------------------------------------
恐れ入りますが、
ご教示のほどよろしくお願いいたします。
TNK - 投稿数: 4769
Zabbixサーバーを稼働させているサーバー上にsnmpdを起動して、
そこから値を取得しようとしているということですね?
そうであるならば、snmpdの設定を見直してください。
ディスクの情報を取得できるように設定しましたか?
OSにも依存すると思いますが、デフォルトの設定では、一部の値し
か取得できないように制限されている場合があります。
REN - 投稿数: 13
お世話になっております。
ご教示ありがとうございます。
ご指摘をもとに、「/etc/snmp/snmpd.conf」に以下を追加し、
snmpdをリスタートしたのですが、snmpwalkコマンドの結果は
特に変化がない状況です。
-------------------------
disk / 20%
-------------------------
データの取得に時間が掛かることも考慮し、
もう少し待ってみます。
TNK - 投稿数: 4769
viewの定義はどのようにされていますか?
wakaba - 投稿数: 228
広瀬です
私もNetAppは監視していますが、OIDが1.3.6.1.4.1.789で始まる値で全て取得しています。
※7modeとcDotで789以降のOIDは異なります
そもそもNetAppでhrStorageDescrキーが定義されてなかったと思うのですが、その詳しい
ところは私も存じませんが、「NetApp hrStorage」では探しても情報は出てこないですね。
また、NetApp側もSNMPを有効、無効、コミュニティ名の指定等、アクセス制御以外に設定
が無かったと記憶しています
NetAPPの仕様次第なので、hrStorageTableの存在有無に関しては確かな事は言えませんが、
1.3.6.1.4.1.789でアグリゲート、ボリューム、SnapShotの3種が個別に取れます。この辺は
LLD使うのがベターですね。尚、7modeの場合qtreeまでの個別指定は出来ません
ご参考のほど
REN - 投稿数: 13
TNK様
お世話になっております。
>viewの定義はどのようにされていますか?
viewの定義とは「/etc/snmp/snmpd.conf」の以下の箇所のことでしょうか?
こちらは特に変更はしておりません。
知見がほとんどないため、ご指摘頂けますと幸いです。
###############################################################################
# Access Control
###############################################################################
# As shipped, the snmpd demon will only respond to queries on the
# system mib group until this file is replaced or modified for
# security purposes. Examples are shown below about how to increase the
# level of access.
# By far, the most common question I get about the agent is "why won't
# it work?", when really it should be "how do I configure the agent to
# allow me to access it?"
#
# By default, the agent responds to the "public" community for read
# only access, if run out of the box without any configuration file in
# place. The following examples show you other ways of configuring
# the agent so that you can change the community names, and give
# yourself write access to the mib tree as well.
#
# For more information, read the FAQ as well as the snmpd.conf(5)
# manual page.
####
# First, map the community name "public" into a "security name"
# sec.name source community
com2sec notConfigUser default public
####
# Second, map the security name into a group name:
# groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
####
# Third, create a view for us to let the group have rights to:
# Make at least snmpwalk -v 1 localhost -c public system fast again.
# name incl/excl subtree mask(optional)
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
####
# Finally, grant the group read-only access to the systemview view.
# group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact systemview none none
# -----------------------------------------------------------------------------
# Here is a commented out example configuration that allows less
# restrictive access.
# YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
# KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
# SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.
## sec.name source community
#com2sec local localhost COMMUNITY
#com2sec mynetwork NETWORK/24 COMMUNITY
## group.name sec.model sec.name
#group MyRWGroup any local
#group MyROGroup any mynetwork
#
#group MyRWGroup any otherv3user
#...
## incl/excl subtree mask
#view all included .1 80
## -or just the mib2 tree-
#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
## context sec.model sec.level prefix read write notif
#access MyROGroup "" any noauth 0 all none none
#access MyRWGroup "" any noauth 0 all all all
###############################################################################
# Sample configuration to make net-snmpd RFC 1213.
# Unfortunately v1 and v2c don't allow any user based authentification, so
# opening up the default config is not an option from a security point.
#
# WARNING: If you uncomment the following lines you allow write access to your
# snmpd daemon from any source! To avoid this use different names for your
# community or split out the write access to a different community and
# restrict it to your local network.
# Also remember to comment the syslocation and syscontact parameters later as
# otherwise they are still read only (see FAQ for net-snmp).
#
# First, map the community name "public" into a "security name"
# sec.name source community
#com2sec notConfigUser default public
# Second, map the security name into a group name:
# groupName securityModel securityName
#group notConfigGroup v1 notConfigUser
#group notConfigGroup v2c notConfigUser
# Third, create a view for us to let the group have rights to:
# Open up the whole tree for ro, make the RFC 1213 required ones rw.
# name incl/excl subtree mask(optional)
#view roview included .1
#view rwview included system.sysContact
#view rwview included system.sysName
#view rwview included system.sysLocation
#view rwview included interfaces.ifTable.ifEntry.ifAdminStatus
#view rwview included at.atTable.atEntry.atPhysAddress
#view rwview included at.atTable.atEntry.atNetAddress
#view rwview included ip.ipForwarding
#view rwview included ip.ipDefaultTTL
#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteDest
#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteIfIndex
#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric1
#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric2
#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric3
#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric4
#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteType
#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteAge
#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMask
#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric5
#view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaIfIndex
#view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaPhysAddress
#view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaNetAddress
#view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType
#view rwview included tcp.tcpConnTable.tcpConnEntry.tcpConnState
#view rwview included egp.egpNeighTable.egpNeighEntry.egpNeighEventTrigger
#view rwview included snmp.snmpEnableAuthenTraps
# Finally, grant the group read-only access to the systemview view.
# group context sec.model sec.level prefix read write notif
#access notConfigGroup "" any noauth exact roview rwview none
REN - 投稿数: 13
広瀬様
お世話になっております。
ご回答ありがとうございます。
もう少しこちらで確認してみます
REN - 投稿数: 13
お世話になっております。
「/etc/snmp/snmpd.conf」に以下の定義を入れて、
snmpdを再起動しましたが、「snmpwalk -v 2c -c public 192.168.56.101 .」の実行で
取得される行数は、39レコードと変化がありません。
-----------------------------------------------------
view AllView included .1
-----------------------------------------------------
上記を記載することで、多くのレコードが抽出されることを
期待したのですが、認識に誤りがありましたら、
ご教示頂けますでしょうか。
よろしくお願いいたします。
yk_taiko - 投稿数: 184
「AllView」を使用する定義は記載されましたでしょうか。
※記載いただいている設定ファイルを以下の順序で追うと、手っ取り早く関係性がつかめると思います。
「public」→「notConfigUser」→「notConfigGroup」→「systemview」
TNK - 投稿数: 4769
単純にその1行だけ追加しても機能しません。
その参考にされたサイトや書籍をよく読んでみてください。
どのような環境に、どのような条件で、何を許可するのかといった
前提条件と手順が書かれているはずです。
それらを1から説明すると長くなってしまうので、これまでにあが
ったキーワードで検索したり、例えば、以下のURLにあるような情
報を参照して、各設定の関係性を勉強してみてください。
http://www.server-memo.net/server-setting/snmp/net-snmp.html
http://friendsnow.hatenablog.com/entry/2016/04/19/203412
https://advanceffort.com/snmp%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%...
https://www.ipentec.com/document/linux-configuration-net-snmp-snmpd
https://qiita.com/Kenji_TAJIMA/items/6bf9eb9d5d9ef4c8c3b6
wakaba - 投稿数: 228
広瀬です
少し初歩に戻らせていただきますが、マネージャー(またはsnmpwalkなどのコマンド)から監視対象に対してSNMPの
情報を取得する際、当然ながら監視対象側のsnmpd.confを編集し、snmpdデーモンを起動しますよね?
で、今回の話ですが監視対象はNetAppそのものな訳ですが、操作されているsnmpd.confはどこを弄られてますか?
手元にNetApp無いのではっきりした事はは言えませんが、NetAppにsnmpd.confに準ずるものは無かったと思います。
ご提示されているsnmpd.confは少なくとも通常LinuxOSのsnmpd.confだと思いますので、マネージャ側のconfを
操作しようとしていませんでしょうか?
https://library.netapp.com/ecmdocs/ECMLP2372137/html/GUID-DFB6BE76-4A32-...
NetApp側で操作可能なコマンドラインは上記だけですので、View定義に関わる記述は無いようです。
もし操作する(Disk容量を取りたい)のならNetApp側を操作せざるを得ませんが、View定義操作できない以上は
HOST-RESOURCE-MIBでの取得は実質不可能という事に他ならない気がします。
調べてみましたが、もとよりNetAPPのサポートしているSNMP MIBは以下の通りの様です
The node supports an SNMP version 1 (RFC 1157) compatible agent that provides support for both the MIB-II (RFC 1213) management information base for TCP/IP based internets as well as a Data ONTAP Custom MIB.
HOST-RESOURCE-MIBはRFC2790なのでそもそも論サポートしていないということになります。
NetApp側似関しては100%の裏取りがまだ無いので、正しいとは言えませんがSNMPに関しての一般的な関係性
から言わせて貰えれば、行おうとされていることが少し勘違いされている様に思えます。
TNK - 投稿数: 4769
広瀬さんへ
RENさんは、最初の返答でもあった通り、Zabbixサーバーに対して
もSNMPで取得して同様のことができるか試されているそうです。
ですので、ここで書かれているsnmpd.confは、広瀬さんも書かれて
いる通り、恐らくLinux上のものだと思われます。
wakaba - 投稿数: 228
TNKさん
ご指摘ありがとうございます。21日17:23 頃のレス見落としてました。
その通りですね。ZABBIX自身なら指定自体は間違いでは無いですね。
失礼しました。
REN - 投稿数: 13
お世話になっております。
TNKさん、広瀬さん、ご指摘ありがとうございます。
>http://friendsnow.hatenablog.com/entry/2016/04/19/203412
上記を参考に対応したところ、以下の通り、「hrStorageDescr」キーの
情報が取得できるようになりました。
------------------------------------------------------------------------------------------------------
[root@zbxsvr ~]# snmpwalk -v 2c -c public 192.168.56.101 | grep hrStorageDescr
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Physical memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Virtual memory
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: Memory buffers
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: Cached memory
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: Shared memory
HOST-RESOURCES-MIB::hrStorageDescr.10 = STRING: Swap space
HOST-RESOURCES-MIB::hrStorageDescr.31 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.36 = STRING: /dev/shm
HOST-RESOURCES-MIB::hrStorageDescr.38 = STRING: /run
HOST-RESOURCES-MIB::hrStorageDescr.39 = STRING: /sys/fs/cgroup
HOST-RESOURCES-MIB::hrStorageDescr.59 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageDescr.60 = STRING: /run/user/42
HOST-RESOURCES-MIB::hrStorageDescr.63 = STRING: /run/user/0
HOST-RESOURCES-MIB::hrSWRunParameters.11148 = STRING: "--color=auto hrStorageDescr"
------------------------------------------------------------------------------------------------------
これで少し、道が開けてきました。
ありがとうございました!!