アイデアは簡単です。Zabbixサーバーは、外部処理およびzabbix_getを介してsmartmontoolsから必要なものをすべて受信し、解析して依存要素(Zabbix 3.4に表示)に渡します。 したがって、Zabbixサーバー側で解析が行われるため、監視対象サーバーへのアクセス数が削減されるだけでなく、リソースが消費されません。
現時点での1つの制限:/ dev / sd *形式のドライブのみを監視します。 フォーマット/ dev / csmi *、*(Intel Matrix RAID)は、zabbix_getが2番目の引数としてカンマを考慮するため、サポートされていません。 間違っている場合は修正してください。
実装に必要なもの:
- 模様
- スクリプト
- サーバー上のzabbix_get
- エージェントのsmartmontools
エージェントのセットアップ
ここで注目に値する唯一のことは、 EnableRemoteCommands = 1行のコメントを外す必要があることです。そうしないと、エージェントはコマンドを受け入れることができません。
Smartmontools
インストールは簡単で、考慮されませんが、Linuxの場合、 sudoなしで起動するには、suidビットをsmartctlファイルに設定する必要があります。 Ubuntuの場合、これはsudo chmod u + s / usr / sbin / smartctlです。
スクリプト
zabbix_server.conf設定ファイルに応じて、このスクリプトをZabbixサーバーの適切なディレクトリに配置する必要があります。 Ubuntuのデフォルトは/ usr / lib / zabbix / externalscriptsです。 ファイルに実行の許可を与えることを忘れないでください-sudo chmod 775 /usr/lib/zabbix/externalscripts/smartctl.sh
  smartctl.sh 
    
      
        
  
    
  
      
      
  
  
      
      
    
      
        
        
        
      
    
      | #!/bin/bash | |
| # 2017/12/07 AcidVenom v1.0 | |
| # HDD LLD Zabbix ( ) | |
| # | |
| # : discovery | |
| IFS=$'\n' | |
| JSON="{\"data\":[" | |
| SEP="" | |
| if [[ $2 = "discovery" ]] | |
| then | |
| get=`zabbix_get -s $1 -k system.run["smartctl --scan-open"] | grep "/dev/sd"` | |
| for hdd in $get | |
| do | |
| DISKID=`echo $hdd | grep "/dev/sd" | sed "s/\/dev\///" | cut -c 1-3` | |
| if [[ `zabbix_get -s $1 -k system.run["smartctl -i /dev/$DISKID"] | grep "SMART support is: Enabled"` != "" ]] | |
| then | |
| JSON=$JSON"$SEP{\"{#DISKID}\":\"$DISKID\"}" | |
| SEP=", " | |
| fi | |
| done | |
| JSON=$JSON"]}" | |
| echo $JSON | |
| # | |
| # : info attr | |
| else | |
| if [[ $3 = "info" ]] | |
| then | |
| get=`zabbix_get -s $1 -k system.run["smartctl -x /dev/$2"]` | |
| for out in $get | |
| do | |
| echo $out | |
| done | |
| elif [[ $3 = "attr" ]] | |
| then | |
| get=`zabbix_get -s $1 -k system.run["smartctl -A /dev/$2"]` | |
| for out in $get | |
| do | |
| echo $out | |
| done | |
| fi | |
| fi | 
模様
バージョン3.4.4からエクスポートされたテンプレート。
次の要素がテンプレートに既に存在します:モデル、ファミリ、シリアル番号、ディスクサイズ、SMARTステータス。 SMART値3、5、7、9、10、190(194)、196、197、198、199。 3つのトリガーがあります。2つは高温を示し、もう1つは不良SMARTを示します。
  ハードウェア-HDD.xml 
    
      
        
  
    
  
      
      
  
  
      
      
    
      
        
        
        
      
    
      | <?xml version="1.0" encoding="UTF-8"?> | |
| <zabbix_export> | |
| <version>3.4</version> | |
| <date>2017-12-27T05:26:57Z</date> | |
| <groups> | |
| <group> | |
| <name>Templates</name> | |
| </group> | |
| </groups> | |
| <templates> | |
| <template> | |
| <template>Hardware - HDD</template> | |
| <name>Hardware - HDD</name> | |
| <description> HDD c LLD.
 | |
| 
 | |
| 
 | |
| :
 | |
| smartctl.sh -> /usr/lib/zabbix/externalscripts/
 | |
| smartmontools</description> | |
| <groups> | |
| <group> | |
| <name>Templates</name> | |
| </group> | |
| </groups> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <items/> | |
| <discovery_rules> | |
| <discovery_rule> | |
| <name> </name> | |
| <type>10</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.sh[{HOST.CONN},discovery]</key> | |
| <delay>1h</delay> | |
| <status>0</status> | |
| <allowed_hosts/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <filter> | |
| <evaltype>0</evaltype> | |
| <formula/> | |
| <conditions/> | |
| </filter> | |
| <lifetime>1d</lifetime> | |
| <description> .</description> | |
| <item_prototypes> | |
| <item_prototype> | |
| <name> {#DISKID} - </name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.capacity.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>0</trends> | |
| <status>0</status> | |
| <value_type>1</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>User Capacity: .*\[(.*)\] | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},info]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - </name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.family.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>0</trends> | |
| <status>0</status> | |
| <value_type>1</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>Model Family: (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},info]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - FW</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.fw.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>0</trends> | |
| <status>0</status> | |
| <value_type>1</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>Firmware Version: (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},info]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - </name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.model.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>0</trends> | |
| <status>0</status> | |
| <value_type>1</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>Device Model: (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},info]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - </name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.serial.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>0</trends> | |
| <status>0</status> | |
| <value_type>1</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>Serial Number: (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},info]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMARTCTL Attr</name> | |
| <type>10</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| <delay>10m</delay> | |
| <history>1h</history> | |
| <trends>0</trends> | |
| <status>0</status> | |
| <value_type>4</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing/> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype/> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMARTCTL Info</name> | |
| <type>10</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},info]</key> | |
| <delay>10m</delay> | |
| <history>1h</history> | |
| <trends>0</trends> | |
| <status>0</status> | |
| <value_type>4</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing/> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype/> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART - Spin-Up Time [3]</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.3.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>365d</trends> | |
| <status>0</status> | |
| <value_type>3</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>3 Spin_Up_Time.* - (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART - Reallocated Sector Count [5]</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.5.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>365d</trends> | |
| <status>0</status> | |
| <value_type>3</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>5 Reallocated_Sector.* - (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART - Seek Error Rate [7]</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.7.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>365d</trends> | |
| <status>0</status> | |
| <value_type>3</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>7 Seek_Error_Rate.* - (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART - Power-on Time Count [9]</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.9.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>365d</trends> | |
| <status>0</status> | |
| <value_type>3</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>9 Power_On_Hours.* - (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART - Spin-Up Retry Count [10]</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.10.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>365d</trends> | |
| <status>0</status> | |
| <value_type>3</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>10 Spin_Retry_Count.* - (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART - Temperature [190-194]</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.190-194.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>365d</trends> | |
| <status>0</status> | |
| <value_type>3</value_type> | |
| <allowed_hosts/> | |
| <units>°C</units> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>(190 Airflow_Temperature_Cel|194 Temperature_Celsius).* - *([0-9]+).* | |
| \2</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART - Reallocated Event Count [196]</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.196.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>365d</trends> | |
| <status>0</status> | |
| <value_type>3</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>196 Reallocated_Event_Count.* - (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART - Current Pending Sector Count [197]</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.197.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>365d</trends> | |
| <status>0</status> | |
| <value_type>3</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>197 Current_Pending_Sector.* - (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART - Uncorrectable Sector Count [198]</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.198.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>365d</trends> | |
| <status>0</status> | |
| <value_type>3</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>198 Offline_Uncorrectable.* - (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART - UltraDMA CRC Error Count [199]</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.199.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>365d</trends> | |
| <status>0</status> | |
| <value_type>3</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>199 UDMA_CRC_Error_Count.* - (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},attr]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| <item_prototype> | |
| <name> {#DISKID} - SMART</name> | |
| <type>18</type> | |
| <snmp_community/> | |
| <snmp_oid/> | |
| <key>smartctl.smart.status.[{#DISKID}]</key> | |
| <delay>0</delay> | |
| <history>90d</history> | |
| <trends>0</trends> | |
| <status>0</status> | |
| <value_type>1</value_type> | |
| <allowed_hosts/> | |
| <units/> | |
| <snmpv3_contextname/> | |
| <snmpv3_securityname/> | |
| <snmpv3_securitylevel>0</snmpv3_securitylevel> | |
| <snmpv3_authprotocol>0</snmpv3_authprotocol> | |
| <snmpv3_authpassphrase/> | |
| <snmpv3_privprotocol>0</snmpv3_privprotocol> | |
| <snmpv3_privpassphrase/> | |
| <params/> | |
| <ipmi_sensor/> | |
| <authtype>0</authtype> | |
| <username/> | |
| <password/> | |
| <publickey/> | |
| <privatekey/> | |
| <port/> | |
| <description/> | |
| <inventory_link>0</inventory_link> | |
| <applications> | |
| <application> | |
| <name> </name> | |
| </application> | |
| </applications> | |
| <valuemap/> | |
| <logtimefmt/> | |
| <preprocessing> | |
| <step> | |
| <type>5</type> | |
| <params>SMART overall-health self-assessment test result: (.*) | |
| \1</params> | |
| </step> | |
| </preprocessing> | |
| <jmx_endpoint/> | |
| <application_prototypes/> | |
| <master_item_prototype> | |
| <key>smartctl.sh[{HOST.CONN},{#DISKID},info]</key> | |
| </master_item_prototype> | |
| </item_prototype> | |
| </item_prototypes> | |
| <trigger_prototypes> | |
| <trigger_prototype> | |
| <expression>{Hardware - HDD:smartctl.smart.status.[{#DISKID}].regexp(^PASSED$)}=1</expression> | |
| <recovery_mode>0</recovery_mode> | |
| <recovery_expression/> | |
| <name>SMART {#DISKID} {HOST.NAME}</name> | |
| <correlation_mode>0</correlation_mode> | |
| <correlation_tag/> | |
| <url/> | |
| <status>0</status> | |
| <priority>4</priority> | |
| <description/> | |
| <type>0</type> | |
| <manual_close>0</manual_close> | |
| <dependencies/> | |
| <tags/> | |
| </trigger_prototype> | |
| <trigger_prototype> | |
| <expression>{Hardware - HDD:smartctl.smart.190-194.[{#DISKID}].last()}>50</expression> | |
| <recovery_mode>0</recovery_mode> | |
| <recovery_expression/> | |
| <name> {#DISKID} {HOST.NAME}</name> | |
| <correlation_mode>0</correlation_mode> | |
| <correlation_tag/> | |
| <url/> | |
| <status>0</status> | |
| <priority>3</priority> | |
| <description/> | |
| <type>0</type> | |
| <manual_close>0</manual_close> | |
| <dependencies/> | |
| <tags/> | |
| </trigger_prototype> | |
| <trigger_prototype> | |
| <expression>{Hardware - HDD:smartctl.smart.190-194.[{#DISKID}].last()}>60</expression> | |
| <recovery_mode>0</recovery_mode> | |
| <recovery_expression/> | |
| <name> {#DISKID} {HOST.NAME}</name> | |
| <correlation_mode>0</correlation_mode> | |
| <correlation_tag/> | |
| <url/> | |
| <status>0</status> | |
| <priority>4</priority> | |
| <description/> | |
| <type>0</type> | |
| <manual_close>0</manual_close> | |
| <dependencies/> | |
| <tags/> | |
| </trigger_prototype> | |
| </trigger_prototypes> | |
| <graph_prototypes/> | |
| <host_prototypes/> | |
| <jmx_endpoint/> | |
| </discovery_rule> | |
| </discovery_rules> | |
| <httptests/> | |
| <macros/> | |
| <templates/> | |
| <screens/> | |
| </template> | |
| </templates> | |
| </zabbix_export> | 
  仕組みの詳細をご覧ください。 
       以下では、各段階で何が起こるかを詳細に説明しようとします。 
      
        
        
        
      
最初のステップ:キー{HOST.CONN}とディスカバリーを備えた外部smartctl.shチェックを使用して、使用可能なsd *ドライブを検出します。 応答として、サーバーはSMART機能がアクティブになっているディスクを含むJSONを受信します。 SMARTがないディスクまたはsd *ではないディスクは出力されません。
        
        
        
      
    
      
        
        
        
      
ステージ2:見つかった各ディスクに対して、情報と属性という2つの要素を取得します。 情報-ディスク情報、属性-SMART属性。 「smartctl -a / dev / sd *を要求しないのはなぜですか?」と尋ねます。 この結論は一部のディスクでは完全ではなく、属性は失われます。 外出先で発明しなければなりませんでした。
        
        
        
      
    
      
        
        
        
      
3番目の段階:InfoおよびAttrは、正規表現の前処理を使用して依存要素に解析されます。 これが最も簡単な部分です。 実際には、「レギュラーシーズン」を自分で調整する必要があります。
        
        
        
      
    
最初のステップ:キー{HOST.CONN}とディスカバリーを備えた外部smartctl.shチェックを使用して、使用可能なsd *ドライブを検出します。 応答として、サーバーはSMART機能がアクティブになっているディスクを含むJSONを受信します。 SMARTがないディスクまたはsd *ではないディスクは出力されません。
ステージ2:見つかった各ディスクに対して、情報と属性という2つの要素を取得します。 情報-ディスク情報、属性-SMART属性。 「smartctl -a / dev / sd *を要求しないのはなぜですか?」と尋ねます。 この結論は一部のディスクでは完全ではなく、属性は失われます。 外出先で発明しなければなりませんでした。
3番目の段階:InfoおよびAttrは、正規表現の前処理を使用して依存要素に解析されます。 これが最も簡単な部分です。 実際には、「レギュラーシーズン」を自分で調整する必要があります。
まとめ
以上です。 PSスクリプト実行ポリシーを無効にするかどうか、PSの同じバージョンを追跡するかどうか、何をどこに置くかを覚えておく必要はありません。 また、必要に応じて、すべての変更はWebインターフェースのZabbix自体で行われます。
最後に、新しい機能に満足し続ける高品質の製品を提供してくれたAlexei alexvlと彼のチームに感謝します。 特に前処理用。 彼女と一緒に暮らすと、管理者はずっと簡単になります。