xymon-ext-scripts

Check-in [9c33e94924]
Login

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

Overview
Comment:filter out cdrom devices
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: 9c33e949243e267e7448140d4f2a9a92d6f8a939df310540769862973ce543fd
User & Date: feld@feld.me 2015-01-28 17:50:39
Context
2015-01-29
13:53
Only issue one smartctl command per drive Also fail if there are any reallocated sectors check-in: 16c227a4e0 user: feld@feld.me tags: master, trunk
2015-01-28
17:50
filter out cdrom devices check-in: 9c33e94924 user: feld@feld.me tags: master, trunk
17:46
add comments detailing usage check-in: 7ea91dbfe9 user: feld@feld.me tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to smart.sh.

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Now restart the xymon client to start using it.

# Xymon doesn't have /usr/local in PATH
PATH=${PATH}:/usr/local/bin:/usr/local/sbin

COLUMN=smart

MSG=$(for i in $(sysctl -n kern.disks | tr ' ' '\n' | sort); do
	OUTPUT=$(sudo smartctl -f brief -H /dev/${i});
	SERIAL=$(sudo smartctl -i /dev/${i} | grep Serial | awk '{print $3}')
	MODEL=$(sudo smartctl -i /dev/${i} | grep "Device Model" | awk '{print $3,$4}')

        case "${OUTPUT}" in
                *PASSED)
			echo "&green ${i} PASSED [ Serial:${SERIAL} Model:${MODEL} ]"







|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Now restart the xymon client to start using it.

# Xymon doesn't have /usr/local in PATH
PATH=${PATH}:/usr/local/bin:/usr/local/sbin

COLUMN=smart

MSG=$(for i in $(sysctl -n kern.disks | tr ' ' '\n' | sort | egrep -v '^cd'); do
	OUTPUT=$(sudo smartctl -f brief -H /dev/${i});
	SERIAL=$(sudo smartctl -i /dev/${i} | grep Serial | awk '{print $3}')
	MODEL=$(sudo smartctl -i /dev/${i} | grep "Device Model" | awk '{print $3,$4}')

        case "${OUTPUT}" in
                *PASSED)
			echo "&green ${i} PASSED [ Serial:${SERIAL} Model:${MODEL} ]"