From 2a5d9a8dea813b6998b94c9b195048d8e5832975 Mon Sep 17 00:00:00 2001 From: mg Date: Sun, 28 Nov 2021 10:49:09 +0100 Subject: [PATCH] script: smart-status.sh entfernt (#257) Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/257 Co-authored-by: mg Co-committed-by: mg --- roles/mgrote.smart/README.md | 18 ------------------ roles/mgrote.smart/tasks/main.yml | 9 --------- roles/mgrote.smart/templates/smart_status.sh | 6 ------ 3 files changed, 33 deletions(-) delete mode 100644 roles/mgrote.smart/templates/smart_status.sh diff --git a/roles/mgrote.smart/README.md b/roles/mgrote.smart/README.md index 45547caf..9f17d182 100644 --- a/roles/mgrote.smart/README.md +++ b/roles/mgrote.smart/README.md @@ -3,24 +3,6 @@ ### Beschreibung Installiert und konfiguriert smartmontools + Mail-Benachrichtigungen.(Mail muss extra konfiguriert werden.) -Stellt `smart_status.sh` bereit. -Ausgabe: -```shell -mg@pve2 ~ -> sudo smart_status.sh -Device Model: SAMSUNG MZ7LH960HAJR-00005 -SMART test result: PASSED -Device Model: SAMSUNG MZ7LH960HAJR-00005 -SMART test result: PASSED -Device Model: WDC WD80EZAZ-11TDBA0 -SMART test result: PASSED -Device Model: WDC WD80EZAZ-11TDBA0 -SMART test result: PASSED -Device Model: WDC WD80EZAZ-11TDBA0 -SMART test result: PASSED -Device Model: MTFDDAK256MBF-1AN15ABHA -SMART test result: PASSED -``` ### getestet auf - [x] ProxMox 6* diff --git a/roles/mgrote.smart/tasks/main.yml b/roles/mgrote.smart/tasks/main.yml index 59031543..485744d7 100644 --- a/roles/mgrote.smart/tasks/main.yml +++ b/roles/mgrote.smart/tasks/main.yml @@ -25,12 +25,3 @@ owner: "{{ smart_user }}" group: "{{ smart_user_group }}" notify: restart smartmontools - - - name: copy smart_status.sh - become: yes - ansible.builtin.template: - src: "smart_status.sh" - dest: "/usr/local/bin/smart_status.sh" - owner: "{{ smart_user }}" - group: "{{ smart_user_group }}" - mode: 0744 diff --git a/roles/mgrote.smart/templates/smart_status.sh b/roles/mgrote.smart/templates/smart_status.sh deleted file mode 100644 index 093539af..00000000 --- a/roles/mgrote.smart/templates/smart_status.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -{{ file_header | default () }} -for i in {a..z}; do - smartctl /dev/sd$i -a | grep "Device Model: " - smartctl /dev/sd$i -a | grep "SMART overall-health self-assessment test result: " | sed -r 's/SMART overall-health self-assessment test result: /SMART test result: /g'| sed -r "s/(PASSED)/`printf "\033[92m"`\1`printf "\033[0m"`/g" | sed -r "s/(FAILED)/`printf "\033[31m"`\1`printf "\033[0m"`/g" -done