From 406fa7610f4e67f5959803a48bdc835a8b97b496 Mon Sep 17 00:00:00 2001 From: Gerard Stanczak Date: Mon, 1 Jun 2015 22:11:18 +0200 Subject: [PATCH 1/2] Add S.M.A.R.T monitoring --- README.md | 7 + bin/hdd_discovery.sh | 21 + templates/Template App S.M.A.R.T.xml | 1664 ++++++++++++++++++++++++++ zabbix_agentd.conf.d/smart.conf | 2 + 4 files changed, 1694 insertions(+) create mode 100644 bin/hdd_discovery.sh create mode 100644 templates/Template App S.M.A.R.T.xml create mode 100644 zabbix_agentd.conf.d/smart.conf diff --git a/README.md b/README.md index fd0da43..566be5a 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,13 @@ Dell Open Manage System Status You need also add SUDO for zabbix user: ```zabbix ALL=(ALL) NOPASSWD: /opt/dell/srvadmin/bin/omreport``` +Template App S.M.A.R.T. +====== +Monitoring for S.M.A.R.T. enabled storage devices (HDD's, SSD's and other). Uses discovery script to populate disks. INFO: For non present S.M.A.R.T. values disable items on per-host level. + +Template and scripts created by: +Michał Macioszek, Taras Baran, Michal Gębora, Marcin Wilk, Maks Bednarek, Anna Fałek, Mikołaj Szczuraszek + Template App PowerPath ====== Monitoring for EMC PowerPath: Host-based software for automated data path management, failover and recovery, and optimized load balancing. PowerPath automates, standardizes, and optimizes data paths in physical and virtual environments as well as cloud deployments to deliver high availability and performance. diff --git a/bin/hdd_discovery.sh b/bin/hdd_discovery.sh new file mode 100644 index 0000000..5c73a60 --- /dev/null +++ b/bin/hdd_discovery.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Script for HDD discovery +# Created by: +# Michał Macioszek, Taras Baran, Michal Gębora, Marcin Wilk, Maks Bednarek, Anna Fałek, Mikołaj Szczuraszek +# + + +disks=`ls -l /dev/sd* | awk '{print $NF}' | sed 's/[0-9]//g' | uniq` +echo -n "{\"data\":[" + +comma=1 +for disk in $disks +do + if [ $comma -eq 0 ]; then + echo -n "," + fi + comma=0 + echo -n "{\"{#DISKNAME}\":\"$disk\",\"{#SHORTDISKNAME}\":\"${disk:5}\"}" +done + +echo -n "]}" \ No newline at end of file diff --git a/templates/Template App S.M.A.R.T.xml b/templates/Template App S.M.A.R.T.xml new file mode 100644 index 0000000..577517a --- /dev/null +++ b/templates/Template App S.M.A.R.T.xml @@ -0,0 +1,1664 @@ + + + 2.0 + 2015-06-01T20:04:18Z + + + Templates + + + + + + diff --git a/zabbix_agentd.conf.d/smart.conf b/zabbix_agentd.conf.d/smart.conf new file mode 100644 index 0000000..2405193 --- /dev/null +++ b/zabbix_agentd.conf.d/smart.conf @@ -0,0 +1,2 @@ +UserParameter=hdd.smart[*],sudo smartctl -A $1 | grep $2 | awk '{print $$10}' | tail -1 +UserParameter=hdd_discovery, /etc/zabbix/bin/hdd_discovery.sh \ No newline at end of file From 169ae0bc09676b632cc287ae11526363de6b41b8 Mon Sep 17 00:00:00 2001 From: Gerard Stanczak Date: Tue, 7 Jul 2015 15:40:14 +0200 Subject: [PATCH 2/2] updated authors --- README.md | 3 --- bin/hdd_discovery.sh | 2 -- 2 files changed, 5 deletions(-) diff --git a/README.md b/README.md index 566be5a..3ae412e 100644 --- a/README.md +++ b/README.md @@ -204,9 +204,6 @@ Template App S.M.A.R.T. ====== Monitoring for S.M.A.R.T. enabled storage devices (HDD's, SSD's and other). Uses discovery script to populate disks. INFO: For non present S.M.A.R.T. values disable items on per-host level. -Template and scripts created by: -Michał Macioszek, Taras Baran, Michal Gębora, Marcin Wilk, Maks Bednarek, Anna Fałek, Mikołaj Szczuraszek - Template App PowerPath ====== Monitoring for EMC PowerPath: Host-based software for automated data path management, failover and recovery, and optimized load balancing. PowerPath automates, standardizes, and optimizes data paths in physical and virtual environments as well as cloud deployments to deliver high availability and performance. diff --git a/bin/hdd_discovery.sh b/bin/hdd_discovery.sh index 5c73a60..398ae7d 100644 --- a/bin/hdd_discovery.sh +++ b/bin/hdd_discovery.sh @@ -1,7 +1,5 @@ #!/bin/bash # Script for HDD discovery -# Created by: -# Michał Macioszek, Taras Baran, Michal Gębora, Marcin Wilk, Maks Bednarek, Anna Fałek, Mikołaj Szczuraszek #