xymon-ext-scripts

Check-in [34345518e8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Handle disk overheat situation separately from a FAILURE
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | master | trunk
Files: files | file ages | folders
SHA3-256:34345518e841ba36423e404428a308ba0940803f88a41f599dd03a047595e991
User & Date: feld 2018-10-31 14:30:13
Context
2018-10-31
14:30
Handle disk overheat situation separately from a FAILURE Leaf check-in: 34345518e8 user: feld tags: master, trunk
2018-10-30
16:45
Handle situations where disk does not expose SMART data such as USB drives Also support NVMe disks properly by converting nvd -> nvme check-in: e11222ca76 user: feld tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to smart.sh.

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85



86
87
88
89
90
91
92
        if [ "x${REALLOCATED}" == "x" ]; then REALLOCATED=0; fi
	TEMP=$(echo "${OUTPUT}" | awk '/Temperature_Celsius/ {print $10}')
        if [ "x${TEMP}" == "x" ]; then TEMP=0; fi

	if [ "${REALLOCATED}" -gt 0 ] ; then
		HEALTH="FAILED"
	elif [ "${TEMP}" -gt 45 ] ; then
                HEALTH="FAILED"
	else
		HEALTH=$(echo "${OUTPUT}" | grep "overall-health")
	fi

        case "${HEALTH}" in
                *PASSED)
			echo "&green ${i} PASSED [ Serial: ${SERIAL} Model: ${MODEL} Reallocated: ${REALLOCATED} Temp: ${TEMP} ]"
                        ;;
                "")
			echo "&yellow ${i} PASSED [ Serial: ${SERIAL} Model: ${MODEL} Reallocated: ${REALLOCATED} Temp: ${TEMP} ]"
                        ;;



		*)
			echo "&red ${i} FAILED [ Serial: ${SERIAL} Model: ${MODEL} Reallocated: ${REALLOCATED} Temp: ${TEMP} ]"
			;;
	esac
done)

STATUS="$(hostname) SMART health status"







|





|

|
|

|
>
>
>







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
        if [ "x${REALLOCATED}" == "x" ]; then REALLOCATED=0; fi
	TEMP=$(echo "${OUTPUT}" | awk '/Temperature_Celsius/ {print $10}')
        if [ "x${TEMP}" == "x" ]; then TEMP=0; fi

	if [ "${REALLOCATED}" -gt 0 ] ; then
		HEALTH="FAILED"
	elif [ "${TEMP}" -gt 45 ] ; then
                HEALTH="OVERHEATED"
	else
		HEALTH=$(echo "${OUTPUT}" | grep "overall-health")
	fi

        case "${HEALTH}" in
		*PASSED)
			echo "&green ${i} PASSED [ Serial: ${SERIAL} Model: ${MODEL} Reallocated: ${REALLOCATED} Temp: ${TEMP} ]"
			;;
		"")
			echo "&yellow ${i} PASSED [ Serial: ${SERIAL} Model: ${MODEL} Reallocated: ${REALLOCATED} Temp: ${TEMP} ]"
			;;
		OVERHEATED)
			echo "&red ${i} OVERHEATED [ Serial: ${SERIAL} Model: ${MODEL} Reallocated: ${REALLOCATED} Temp: ${TEMP} ]"
			;;
		*)
			echo "&red ${i} FAILED [ Serial: ${SERIAL} Model: ${MODEL} Reallocated: ${REALLOCATED} Temp: ${TEMP} ]"
			;;
	esac
done)

STATUS="$(hostname) SMART health status"