MegaRAIDのカード「MegaRAID SAS 9271-8i」を購入した. これをZabbixで監視させてみた.
設定というかFirmwareの更新はMegaRAIDを参照のこと
Zabbix-agentをインストール †
Zabbix/HostのようにZabbix-agentをインストールします.
[root@e ~]# cat /etc/redhat-release
Rocky Linux release 8.6 (Green Obsidian)
[root@e ~]# getenforce
Disabled
[root@e ~]# rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm
[root@e ~]# dnf install zabbix-agent
| --- zabbix_agentd.conf.20220521 2022-05-21 04:19:16.913660484 +0900
+++ zabbix_agentd.conf 2022-06-05 04:53:05.450198036 +0900
@@ -114,7 +114,7 @@
# Default:
# Server=
-Server=127.0.0.1
+Server=192.168.0.126
### Option: ListenPort
# Agent will listen on this port for connections from the server.
@@ -161,7 +161,7 @@
# Default:
# ServerActive=
-ServerActive=127.0.0.1
+ServerActive=
### Option: Hostname
# List of comma delimited unique, case sensitive hostnames.
@@ -172,7 +172,7 @@
# Default:
# Hostname=
-Hostname=Zabbix server
+Hostname=e
### Option: HostnameItem
# Item used for generating Hostname if it is undefined. Ignored if Hostname is defined.
|
[root@e ~]# systemctl enable zabbix-agent --now
[root@e ~]# firewall-cmd --add-service=zabbix-agent --permanent --zone=public
[root@e ~]# firewall-cmd --reload
zabbix-server側の設定(テンプレートの選択) †
Zabbix/QANPの「SNMP QNAP NAS」と同じようにhttps://github.com/zabbix/community-templatesからテンプレートを拾ってきます
今回はMegaRAID のRAIDカードなので、「Server_Hardware/RAID_Cards/」から選ぶのですが
- template_lsi_avago_broadcom_megaraid_sas_snmp
ベンダー由来の「LSI-MegaRAID-SAS-MIB」をsnmpに組み込む必要がある
と
- template_lsi_avago_broadcom_using_json_outputs_of_storcli
storcliコマンドが出力するjsonを使います. なのでstorcliが必須
の2つがある. ここでは前者の「template_lsi_avago_broadcom_megaraid_sas_snmp」を示します.
後者の「template_lsi_avago_broadcom_using_json_outputs_of_storcli」はこちらで Zabbix/MegaRAID/storcli
template_lsi_avago_broadcom_megaraid_sas_snmp †
まずはベンダー由来のsnmp拡張セットを取得する. 取得方法はMegaRAIDと同じく「Management Software and Tools」内で、
「Latest SNMP Installers」を取得する

取得した「MR_SAS_SNMP_Installer_6.14-17.05.00.02.zip(19.1MB)」を展開するとそこには各OS毎に

SAS_IRとはIntegrated Raidを意味してLSIのHBAカードでRAID機能をFirmwareで付与されたもの. RAID0、1、10と10Eを提供できるそうな. そういった対象の場合これを選ぶ. 今回は純然なRAIDカードなので SAS_SNMP_Linux_x64_Installer.zip を選ぶ
「SAS_SNMP_Linux_x64_Installer.zip」を展開します
[root@e ~]# mkdir snmp
[root@e ~]# cd snmp/
[root@e snmp]# unzip ../SAS_SNMP_Linux_x64_Installer.zip
Archive: ../SAS_SNMP_Linux_x64_Installer.zip
extracting: SAS_SNMP_Linux_x64_Installer-17.05-0002.zip
inflating: MD5Checksum.txt
[root@e snmp]#
(さらに展開)
[root@e snmp]# unzip SAS_SNMP_Linux_x64_Installer-17.05-0002.zip
Archive: SAS_SNMP_Linux_x64_Installer-17.05-0002.zip
inflating: sas_snmp_64bit.tar.gz
inflating: sassnmp_linux_x64_readme.txt
[root@e snmp]#
(さらに解凍)
[root@e snmp]# tar xvf sas_snmp_64bit.tar.gz
sas_snmp-17.05-0002.x86_64.rpm
[root@e snmp]#
[root@e snmp]# ls -lh sas_snmp-17.05-0002.x86_64.rpm
-rw-r--r-- 1 root root 575K Apr 18 2017 sas_snmp-17.05-0002.x86_64.rpm
[root@e snmp]#
この「sas_snmp-17.05-0002.x86_64.rpm」をインストールしますが、まずはちょいと中身を拝見.
[root@e snmp]# rpm -qlp sas_snmp-17.05-0002.x86_64.rpm
/etc/lsi_mrdsnmp/lsi_mrdsnmpagent
/etc/lsi_mrdsnmp/lsi_mrdsnmpd.conf
/etc/lsi_mrdsnmp/lsi_mrdsnmpd.rh
/etc/lsi_mrdsnmp/lsi_mrdsnmpd.suse
/etc/lsi_mrdsnmp/lsi_mrdsnmpmain
/etc/lsi_mrdsnmp/sas/LSI-AdapterSAS.mib
/etc/lsi_mrdsnmp/sas/install
/etc/lsi_mrdsnmp/sas/sas_TrapDestination.conf
/etc/lsi_mrdsnmp/sas/sas_mib.dat
/etc/lsi_mrdsnmp/sas/uninstall
/opt/lsi/snmp
/opt/lsi/snmp/lib
/opt/lsi/snmp/lib/libstorelib.so.4.70-0
/usr/lib64/libsas_objects.so.1.55-1
[root@e snmp]#
*事前に net-snmp は入れておきます。その後にこの sas_snmp を入れます
[root@e snmp]# dnf install net-snmp -y
( cp -a /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig )
[root@e snmp]# dnf localinstall ./sas_snmp-17.05-0002.x86_64.rpm
[root@e snmp]# scp /etc/lsi_mrdsnmp/sas/LSI-AdapterSAS.mib root@zaibbx:/usr/share/snmp/mibs <--- MIBを文字列で引くので
*zabbix-serverにmibを加えたら、zabbix-serverの再起動は必須です. 反映させるため
これでnet-snmpの/etc/snmp/snmpd.confに下記のような追記が発生します.
内容的にはOIDが「.1.3.6.1.4.1.3582」以下は「/usr/sbin/lsi_mrdsnmpmain」が担当という事でしょうか.
| --- /etc/snmp/snmpd.conf.orig 2022-04-13 05:19:27.000000000 +0900
+++ /etc/snmp/snmpd.conf 2022-06-05 04:20:04.459709922 +0900
@@ -460,3 +460,4 @@
# Further Information
#
# See the snmpd.conf manual page, and the output of "snmpd -H".
+pass .1.3.6.1.4.1.3582 /usr/sbin/lsi_mrdsnmpmain
|
ですが、これでは無理で「.1.3.6.1.4.1.3582」もsnmpd的に許可する必要がある. っで下記のようにする
| --- /etc/snmp/snmpd.conf.orig 2022-04-13 05:19:27.000000000 +0900
+++ /etc/snmp/snmpd.conf 2022-06-05 05:14:23.971356259 +0900
@@ -54,6 +54,7 @@
# 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
+view systemview included .1.3.6.1.4.1.3582
####
# Finally, grant the group read-only access to the systemview view.
@@ -460,3 +461,4 @@
# Further Information
#
# See the snmpd.conf manual page, and the output of "snmpd -H".
+pass .1.3.6.1.4.1.3582 /usr/sbin/lsi_mrdsnmpmain
|
っでsnmpとlsi_mrdsnmpmainを起動させます. lsi_mrdsnmpmainはinit系で用意されている.
[root@e ~]# systemctl enable snmpd --now
[root@e ~]# firewall-cmd --add-service={snmp,snmptrap} --permanent --zone=public
[root@e ~]# firewall-cmd --reload
zabbixにテンプレート敷設(template_lsi_avago_broadcom_megaraid_sas_snmp) †
「管理->テンプレート」を開いて、右上のインポートボタンを押下します.
開いたインポートパネルに取得した「template_lsi_avago_broadcom_megaraid_sas_snmp.yaml」を指定して「インポート」ボタンを押下して

コードの確認画面でも「インポート」ボタンを押下します. これでテンプレートの設定は完了.
MegaRAID もちマシンのzabbix登録 †
「設定->ホスト」にて登録作業を行う. 「ホストの作成」ボタンを押下して「新しいホストの作成」パネルで下記のようにします.
テンプレートは「Linux by Zabbix agent」と追加された「SNMP MegaRAID SAS」を指定して、グループは「Linux servers」とします。
インターフェイスはzabbix-agent向けとsnmp向けの2つ用意します

暫くすると値が取得出来て下記のようになる

RAIDチップの温度が 255度 と表示されるが、「MegaCli64」コマンドでも
ROC temperature : 255 degree Celsius
と表示されるので、本当なのかも...まぁー中古の品って事ね...