Мониторим состояние md-raid в zabbix
Создадим пользовательский параметр mdraid
:
echo "UserParameter=mdraid,/bin/egrep -c '\[.*_.*\]' /proc/mdstat" > /etc/zabbix/zabbix_agentd.d/userparameter_mdraid.conf systemctl restart zabbix-agent
Шаблон для zabbix:
<?xml version="1.0" encoding="UTF-8"?> <zabbix_export> <version>3.2</version> <date>2016-11-20T12:17:00Z</date> <groups> <group> <name>Templates</name> </group> </groups> <templates> <template> <template>Template_MDRAID</template> <name>Template_MDRAID</name> <description/> <groups> <group> <name>Templates</name> </group> </groups> <applications> <application> <name>MD RAID</name> </application> </applications> <items> <item> <name>RAID STATUS</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>mdraid</key> <delay>3600</delay> <history>30</history> <trends>365</trends> <status>0</status> <value_type>3</value_type> <allowed_hosts/> <units/> <delta>0</delta> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <formula>1</formula> <delay_flex/> <params/> <ipmi_sensor/> <data_type>0</data_type> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>MD RAID</name> </application> </applications> <valuemap/> <logtimefmt/> </item> </items> <discovery_rules/> <httptests/> <macros/> <templates/> <screens/> </template> </templates> <triggers> <trigger> <expression>{Template_MDRAID:mdraid.last()}>0</expression> <recovery_mode>0</recovery_mode> <recovery_expression/> <name>MD RAID in failure state on {HOST.NAME}</name> <correlation_mode>0</correlation_mode> <correlation_tag/> <url/> <status>0</status> <priority>5</priority> <description/> <type>0</type> <manual_close>1</manual_close> <dependencies/> <tags/> </trigger> </triggers> </zabbix_export>