Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| monitors:hardware_sensors [2022/12/11 11:05] – [Source] doktoil_makresh | monitors:hardware_sensors [2022/12/11 11:12] (current) – [Source] doktoil_makresh | ||
|---|---|---|---|
| Line 18: | Line 18: | ||
| Add hardware to you $XYMONHOME/ | Add hardware to you $XYMONHOME/ | ||
| + | ===== Source ===== | ||
| + | === hobbit-hardware.sh === | ||
| + | <hidden onHidden=" | ||
| + | <code bash> | ||
| #!/bin/bash | #!/bin/bash | ||
| Line 24: | Line 28: | ||
| # Title: | # Title: | ||
| # Author: | # Author: | ||
| - | # Date: | + | # Date: |
| # Purpose: | # Purpose: | ||
| # Platforms: Uni* having lm-sensor and hddtemp utilities | # Platforms: Uni* having lm-sensor and hddtemp utilities | ||
| # Tested: | # Tested: | ||
| - | |||
| - | #TODO for v0.7 | ||
| - | # -To be independent of / | ||
| - | # -Support for multiples sensors | ||
| - | # -Support for independant temperatures thresolds for each disk | ||
| - | # | ||
| - | # History : | ||
| - | # 01 nov 2018 - Steffan ?? | ||
| - | # v0.5.1 : Adds support for spare drive (not reported as failed anymore) | ||
| - | # 27 sep 2013 - Damien Martins | ||
| - | # v0.5 : Adds support for HP monitoring tools (hpacucli) | ||
| - | # 27 jun 2013 - Damien Martins and Xavier Carol i Rosell | ||
| - | # v0.4 : Fixes hddtemp output handling (print last field instead of field N) | ||
| - | # 09 sep 2011 - Damien Martins | ||
| - | # v0.3 : Adds support for OpenManage Physical disks, temps | ||
| - | # 17 feb 2010 - Damien Martins | ||
| - | # v0.2.2 : Minor code optimizations | ||
| - | # 22 jan 2010 - Damien Martins | ||
| - | # v0.2.1 : Minor bug fix | ||
| - | # 14 nov 2009 - Damien Martins | ||
| - | # v0.2 : -Getting sensor probe no more hard coded | ||
| - | # -More verbosity when commands fail | ||
| - | # -Disk temperature thresolds in xymon-hardware.cfg file. | ||
| - | # -Support smartctl to replace hddtemp (if needed) | ||
| - | # | ||
| - | # | ||
| - | # 25 jun 2009 - Damien Martins | ||
| - | # | ||
| - | # 18 jun 2009 - Damien Martins | ||
| - | # | ||
| - | # 15 jan 2009 - Damien Martins | ||
| - | # v0.1 : First lines, trying to get : | ||
| - | # | ||
| - | # -fan rotation speed and thresold | ||
| - | # | ||
| - | # -HDD temperature (thresold is not include, so we set it in this file) | ||
| ################################################################################# | ################################################################################# | ||
| Line 140: | Line 108: | ||
| DISK_WARNING_TEMP=$($GREP ^DISK_WARNING_TEMP= $CONFIG_FILE | $SED s/ | DISK_WARNING_TEMP=$($GREP ^DISK_WARNING_TEMP= $CONFIG_FILE | $SED s/ | ||
| DISK_PANIC_TEMP=$($GREP ^DISK_PANIC_TEMP= $CONFIG_FILE | $SED s/ | DISK_PANIC_TEMP=$($GREP ^DISK_PANIC_TEMP= $CONFIG_FILE | $SED s/ | ||
| - | |||
| - | function set_disk_entries_values() | ||
| - | { | ||
| - | ENTRIES=$1 | ||
| - | if [ " | ||
| - | | ||
| - | | ||
| - | elif [ " | ||
| - | LOCAL_DISK_WARNING_TEMP=$DISK_WARNING_TEMP | ||
| - | LOCAL_DISK_PANIC_TEMP=$(echo $ENTRIES | " | ||
| - | elif [ " | ||
| - | LOCAL_DISK_WARNING_TEMP=$(echo $ENTRIES | " | ||
| - | LOCAL_DISK_PANIC_TEMP=$(echo $ENTRIES | " | ||
| - | fi | ||
| - | } | ||
| function use_hddtemp () | function use_hddtemp () | ||
| { | { | ||
| - | | + | for DISK in $(" |
| - | DISK=$(echo $ENTRIES | " | + | |
| - | set_disk_entries_values $ENTRIES | + | |
| HDD_TEMP=" | HDD_TEMP=" | ||
| if [ ! " | if [ ! " | ||
| Line 166: | Line 117: | ||
| LINE="& | LINE="& | ||
| It seems S.M.A.R.T. is no more responding !!!" | It seems S.M.A.R.T. is no more responding !!!" | ||
| - | echo " | + | echo " |
| HDD_TEMP : $HDD_TEMP" | HDD_TEMP : $HDD_TEMP" | ||
| - | elif [ " | + | elif [ " |
| RED=1 | RED=1 | ||
| - | LINE="& | + | LINE="& |
| " | " | ||
| - | elif [ " | + | elif [ " |
| YELLOW=" | YELLOW=" | ||
| - | LINE="& | + | LINE="& |
| " | " | ||
| - | elif [ " | + | elif [ " |
| - | LINE="& | + | LINE="& |
| " | " | ||
| fi | fi | ||
| Line 192: | Line 143: | ||
| SMARTCTL_ARGS=" | SMARTCTL_ARGS=" | ||
| fi | fi | ||
| - | for ENTRIES | + | for DISK in $(" |
| - | DISK=$(echo $ENTRIES | " | + | |
| - | set_disk_entries_values $ENTRIES | + | |
| HDD_TEMP=" | HDD_TEMP=" | ||
| if [ ! " | if [ ! " | ||
| Line 200: | Line 149: | ||
| LINE="& | LINE="& | ||
| It seems S.M.A.R.T. is no more responding !!!" | It seems S.M.A.R.T. is no more responding !!!" | ||
| - | echo " | + | echo " |
| HDD_TEMP : $HDD_TEMP" | HDD_TEMP : $HDD_TEMP" | ||
| - | elif [ " | + | elif [ " |
| RED=1 | RED=1 | ||
| - | LINE="& | + | LINE="& |
| " | " | ||
| - | elif [ " | + | elif [ " |
| YELLOW=" | YELLOW=" | ||
| - | LINE="& | + | LINE="& |
| " | " | ||
| - | elif [ " | + | elif [ " |
| - | LINE="& | + | LINE="& |
| " | " | ||
| fi | fi | ||
| Line 245: | Line 194: | ||
| unset MIN MAX PANIC VALUE WARNING | unset MIN MAX PANIC VALUE WARNING | ||
| } | } | ||
| - | |||
| function test_fan () | function test_fan () | ||
| { | { | ||
| Line 495: | Line 443: | ||
| SLOT=$(echo $OUTPUT | awk ' | SLOT=$(echo $OUTPUT | awk ' | ||
| STATUS=$(echo $OUTPUT | awk ' | STATUS=$(echo $OUTPUT | awk ' | ||
| - | if [ " | ||
| - | STATUS=$(echo $OUTPUT | cut -d',' | ||
| - | fi | ||
| if [ $TYPE == " | if [ $TYPE == " | ||
| RAID=$(echo $OUTPUT | awk ' | RAID=$(echo $OUTPUT | awk ' | ||
| Line 554: | Line 499: | ||
| fi | fi | ||
| " | " | ||
| + | |||
| $(" | $(" | ||
| " | " | ||
| + | </ | ||
| + | </ | ||
| + | |||
| ===== Known Bugs and Issues ===== | ===== Known Bugs and Issues ===== | ||
| None | None | ||
| Line 593: | Line 542: | ||
| * **2022-07-13 v0.6** | * **2022-07-13 v0.6** | ||
| * Add support for disks independent temperatures | * Add support for disks independent temperatures | ||
| + | </ | ||