diff --git a/defaults/main.yml b/defaults/main.yml index a281fe2..4c6c199 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -40,13 +40,13 @@ opn_check_mk_patches: # the old list syntax opn_check_mk_local_checks: [] is still supported opn_check_mk_local_checks: all: - - gateways_status.py + - check_powerunit.sh - crash_status.py - firmware_status.py + - gateways_status.py + - pfctl_status.sh - pkg_audit.py - pkg_check.sh - - pfctl_status.sh - - check_powerunit.sh # dict of lists of mrpe checks to run # example: @@ -65,6 +65,11 @@ opn_check_mk_additional_files: {} # add here some plugin files (and add them to files/ too! # for example: # https://raw.githubusercontent.com/zerwes/check_mk_extensions/wireguard-fix-plugin-interpreter/wireguard/agents/plugins/wireguard +# +# plugins shipped within this repository and ready to be deployed: +# opn_check_mk_plugins: +# - wireguard +# - smart opn_check_mk_plugins: [] # set this to "{{ lookup('config', 'DEFAULT_LOCAL_TMP') | dirname }}" diff --git a/files/smart b/files/smart new file mode 100755 index 0000000..4295ee8 --- /dev/null +++ b/files/smart @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +#shellcheck disable=SC2086 +echo '<<>>' +for disk in $(sysctl -n kern.disks) +do + data=$(smartctl -a "/dev/${disk}") + model=$(awk '/^(Device Model|Product).*/ {print $NF}' <<< "$data") + serial=$(awk '/^Serial( |Number).*/ {print $NF}' <<< "$data") + name=$(tr ' ' '_' <<< "$model $serial") + fname="$name $model" + stats=$(grep -E '^[ 12][ 0-9][0-9]' <<< "$data") + while IFS= read -r line + do + echo "$line" + done < <(printf '%s %s\n' $fname "$stats") +done