Add type in support filename to avoid conflict
This commit is contained in:
parent
3fe298f961
commit
6945c0e867
|
@ -0,0 +1,8 @@
|
|||
3&green /dev/sda auto
|
||||
3&green /dev/sdb auto
|
||||
3&green /dev/sdc auto
|
||||
3&green /dev/sdd auto
|
||||
3&green /dev/sde auto
|
||||
4&clear /dev/sdf unsupported
|
||||
3&green /dev/bus/0 megaraid,12
|
||||
3&green /dev/bus/0 megaraid,13
|
|
@ -0,0 +1,258 @@
|
|||
&green /dev/sda auto
|
||||
|
||||
SMART Health Status: OK
|
||||
&clear Device is unknown or not complete in smartmontools database. Please take a look to the FAQ:
|
||||
https://www.smartmontools.org/wiki/FAQ#SmartmontoolsDatabase
|
||||
=== START OF INFORMATION SECTION ===
|
||||
Vendor: HGST
|
||||
Product: HUS728T8TAL5200
|
||||
Revision: RS01
|
||||
Compliance: SPC-4
|
||||
User Capacity: 8,001,563,222,016 bytes [8.00 TB]
|
||||
Logical block size: 512 bytes
|
||||
Physical block size: 4096 bytes
|
||||
Formatted with type 2 protection
|
||||
LU is fully provisioned
|
||||
Rotation Rate: 7200 rpm
|
||||
Form Factor: 3.5 inches
|
||||
Logical Unit id: 0x5000cca09976b8c4
|
||||
Serial number: VAJ392BL
|
||||
Device type: disk
|
||||
Transport protocol: SAS (SPL-3)
|
||||
Local Time is: Fri Feb 28 15:07:11 2020 CET
|
||||
SMART support is: Available - device has SMART capability.
|
||||
SMART support is: Enabled
|
||||
Temperature Warning: Disabled or Not Supported
|
||||
|
||||
=== START OF READ SMART DATA SECTION ===
|
||||
SMART Self-test log
|
||||
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
|
||||
Description number (hours)
|
||||
# 1 Background short Completed 96 5771 - [- - -]
|
||||
# 2 Background short Completed 96 5747 - [- - -]
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
&green /dev/sdb auto
|
||||
|
||||
SMART Health Status: OK
|
||||
&clear Device is unknown or not complete in smartmontools database. Please take a look to the FAQ:
|
||||
https://www.smartmontools.org/wiki/FAQ#SmartmontoolsDatabase
|
||||
=== START OF INFORMATION SECTION ===
|
||||
Vendor: HGST
|
||||
Product: HUS728T8TAL5200
|
||||
Revision: RS01
|
||||
Compliance: SPC-4
|
||||
User Capacity: 8,001,563,222,016 bytes [8.00 TB]
|
||||
Logical block size: 512 bytes
|
||||
Physical block size: 4096 bytes
|
||||
Formatted with type 2 protection
|
||||
LU is fully provisioned
|
||||
Rotation Rate: 7200 rpm
|
||||
Form Factor: 3.5 inches
|
||||
Logical Unit id: 0x5000cca09975fc04
|
||||
Serial number: VAJ2WHPL
|
||||
Device type: disk
|
||||
Transport protocol: SAS (SPL-3)
|
||||
Local Time is: Fri Feb 28 15:07:11 2020 CET
|
||||
SMART support is: Available - device has SMART capability.
|
||||
SMART support is: Enabled
|
||||
Temperature Warning: Disabled or Not Supported
|
||||
|
||||
=== START OF READ SMART DATA SECTION ===
|
||||
SMART Self-test log
|
||||
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
|
||||
Description number (hours)
|
||||
# 1 Background short Completed 96 5607 - [- - -]
|
||||
# 2 Background short Completed 96 5583 - [- - -]
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
&green /dev/sdc auto
|
||||
|
||||
SMART Health Status: OK
|
||||
&clear Device is unknown or not complete in smartmontools database. Please take a look to the FAQ:
|
||||
https://www.smartmontools.org/wiki/FAQ#SmartmontoolsDatabase
|
||||
=== START OF INFORMATION SECTION ===
|
||||
Vendor: HGST
|
||||
Product: HUS728T8TAL5200
|
||||
Revision: RS01
|
||||
Compliance: SPC-4
|
||||
User Capacity: 8,001,563,222,016 bytes [8.00 TB]
|
||||
Logical block size: 512 bytes
|
||||
Physical block size: 4096 bytes
|
||||
Formatted with type 2 protection
|
||||
LU is fully provisioned
|
||||
Rotation Rate: 7200 rpm
|
||||
Form Factor: 3.5 inches
|
||||
Logical Unit id: 0x5000cca099757c5c
|
||||
Serial number: VAJ2M04L
|
||||
Device type: disk
|
||||
Transport protocol: SAS (SPL-3)
|
||||
Local Time is: Fri Feb 28 15:07:11 2020 CET
|
||||
SMART support is: Available - device has SMART capability.
|
||||
SMART support is: Enabled
|
||||
Temperature Warning: Disabled or Not Supported
|
||||
|
||||
=== START OF READ SMART DATA SECTION ===
|
||||
SMART Self-test log
|
||||
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
|
||||
Description number (hours)
|
||||
# 1 Background short Completed 96 5859 - [- - -]
|
||||
# 2 Background short Completed 96 5835 - [- - -]
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
&green /dev/sdd auto
|
||||
|
||||
SMART Health Status: OK
|
||||
&clear Device is unknown or not complete in smartmontools database. Please take a look to the FAQ:
|
||||
https://www.smartmontools.org/wiki/FAQ#SmartmontoolsDatabase
|
||||
=== START OF INFORMATION SECTION ===
|
||||
Vendor: HGST
|
||||
Product: HUS728T8TAL5200
|
||||
Revision: RS01
|
||||
Compliance: SPC-4
|
||||
User Capacity: 8,001,563,222,016 bytes [8.00 TB]
|
||||
Logical block size: 512 bytes
|
||||
Physical block size: 4096 bytes
|
||||
Formatted with type 2 protection
|
||||
LU is fully provisioned
|
||||
Rotation Rate: 7200 rpm
|
||||
Form Factor: 3.5 inches
|
||||
Logical Unit id: 0x5000cca099765214
|
||||
Serial number: VAJ327BL
|
||||
Device type: disk
|
||||
Transport protocol: SAS (SPL-3)
|
||||
Local Time is: Fri Feb 28 15:07:11 2020 CET
|
||||
SMART support is: Available - device has SMART capability.
|
||||
SMART support is: Enabled
|
||||
Temperature Warning: Disabled or Not Supported
|
||||
|
||||
=== START OF READ SMART DATA SECTION ===
|
||||
SMART Self-test log
|
||||
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
|
||||
Description number (hours)
|
||||
# 1 Background short Completed 96 5599 - [- - -]
|
||||
# 2 Background short Completed 96 5575 - [- - -]
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
&green /dev/sde auto
|
||||
|
||||
SMART Health Status: OK
|
||||
&clear Device is unknown or not complete in smartmontools database. Please take a look to the FAQ:
|
||||
https://www.smartmontools.org/wiki/FAQ#SmartmontoolsDatabase
|
||||
=== START OF INFORMATION SECTION ===
|
||||
Vendor: HGST
|
||||
Product: HUS728T8TAL5200
|
||||
Revision: RS01
|
||||
Compliance: SPC-4
|
||||
User Capacity: 8,001,563,222,016 bytes [8.00 TB]
|
||||
Logical block size: 512 bytes
|
||||
Physical block size: 4096 bytes
|
||||
Formatted with type 2 protection
|
||||
LU is fully provisioned
|
||||
Rotation Rate: 7200 rpm
|
||||
Form Factor: 3.5 inches
|
||||
Logical Unit id: 0x5000cca09976e460
|
||||
Serial number: VAJ3BZDL
|
||||
Device type: disk
|
||||
Transport protocol: SAS (SPL-3)
|
||||
Local Time is: Fri Feb 28 15:07:11 2020 CET
|
||||
SMART support is: Available - device has SMART capability.
|
||||
SMART support is: Enabled
|
||||
Temperature Warning: Disabled or Not Supported
|
||||
|
||||
=== START OF READ SMART DATA SECTION ===
|
||||
SMART Self-test log
|
||||
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
|
||||
Description number (hours)
|
||||
# 1 Background short Completed 96 5599 - [- - -]
|
||||
# 2 Background short Completed 96 5575 - [- - -]
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
&clear /dev/sdf unsupported
|
||||
|
||||
SMART Health Status can't be determine because of:
|
||||
SMART support is: Unavailable - device lacks SMART capability.
|
||||
|
||||
=== START OF INFORMATION SECTION ===
|
||||
Vendor: DELL
|
||||
Product: PERC H730P Mini
|
||||
Revision: 4.30
|
||||
User Capacity: 146,163,105,792 bytes [146 GB]
|
||||
Logical block size: 512 bytes
|
||||
Logical Unit id: 0x61866da06192eb00256e8c0a2d73f5b6
|
||||
Serial number: 00b6f5732d0a8c6e2500eb9261a06d86
|
||||
Device type: disk
|
||||
Local Time is: Fri Feb 28 15:07:12 2020 CET
|
||||
SMART support is: Unavailable - device lacks SMART capability.
|
||||
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
&green /dev/bus/0 megaraid,12
|
||||
|
||||
SMART Health Status: OK
|
||||
&clear Device is unknown or not complete in smartmontools database. Please take a look to the FAQ:
|
||||
https://www.smartmontools.org/wiki/FAQ#SmartmontoolsDatabase
|
||||
=== START OF INFORMATION SECTION ===
|
||||
Vendor: SEAGATE
|
||||
Product: ST9146803SS
|
||||
Revision: FS64
|
||||
User Capacity: 146,815,733,760 bytes [146 GB]
|
||||
Logical block size: 512 bytes
|
||||
Rotation Rate: 10000 rpm
|
||||
Form Factor: 2.5 inches
|
||||
Logical Unit id: 0x5000c5003ac7ef07
|
||||
Serial number: 6SD3HJV0
|
||||
Device type: disk
|
||||
Transport protocol: SAS (SPL-3)
|
||||
Local Time is: Fri Feb 28 15:07:13 2020 CET
|
||||
SMART support is: Available - device has SMART capability.
|
||||
SMART support is: Enabled
|
||||
Temperature Warning: Disabled or Not Supported
|
||||
|
||||
=== START OF READ SMART DATA SECTION ===
|
||||
SMART Self-test log
|
||||
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
|
||||
Description number (hours)
|
||||
# 1 Background short Completed 16 62479 - [- - -]
|
||||
# 2 Background short Completed 16 62455 - [- - -]
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
&green /dev/bus/0 megaraid,13
|
||||
|
||||
SMART Health Status: OK
|
||||
&clear Device is unknown or not complete in smartmontools database. Please take a look to the FAQ:
|
||||
https://www.smartmontools.org/wiki/FAQ#SmartmontoolsDatabase
|
||||
=== START OF INFORMATION SECTION ===
|
||||
Vendor: SEAGATE
|
||||
Product: ST9146803SS
|
||||
Revision: FS64
|
||||
User Capacity: 146,815,733,760 bytes [146 GB]
|
||||
Logical block size: 512 bytes
|
||||
Rotation Rate: 10000 rpm
|
||||
Form Factor: 2.5 inches
|
||||
Logical Unit id: 0x5000c5003ac956db
|
||||
Serial number: 6SD3HH6J
|
||||
Device type: disk
|
||||
Transport protocol: SAS (SPL-3)
|
||||
Local Time is: Fri Feb 28 15:07:14 2020 CET
|
||||
SMART support is: Available - device has SMART capability.
|
||||
SMART support is: Enabled
|
||||
Temperature Warning: Disabled or Not Supported
|
||||
|
||||
=== START OF READ SMART DATA SECTION ===
|
||||
SMART Self-test log
|
||||
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
|
||||
Description number (hours)
|
||||
# 1 Background short Completed 16 61374 - [- - -]
|
||||
# 2 Background short Completed 16 61350 - [- - -]
|
||||
------------------------------------------------------------
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
/dev/sda -d scsi # /dev/sda, SCSI device
|
||||
/dev/sdb -d scsi # /dev/sdb, SCSI device
|
||||
/dev/sdc -d scsi # /dev/sdc, SCSI device
|
||||
/dev/sdd -d scsi # /dev/sdd, SCSI device
|
||||
/dev/sde -d scsi # /dev/sde, SCSI device
|
||||
/dev/sdf -d scsi # /dev/sdf, SCSI device
|
||||
/dev/bus/0 -d megaraid,0 # /dev/bus/0 [megaraid_disk_00], SCSI device
|
||||
/dev/bus/0 -d megaraid,1 # /dev/bus/0 [megaraid_disk_01], SCSI device
|
||||
/dev/bus/0 -d megaraid,2 # /dev/bus/0 [megaraid_disk_02], SCSI device
|
||||
/dev/bus/0 -d megaraid,3 # /dev/bus/0 [megaraid_disk_03], SCSI device
|
||||
/dev/bus/0 -d megaraid,4 # /dev/bus/0 [megaraid_disk_04], SCSI device
|
||||
/dev/bus/0 -d megaraid,12 # /dev/bus/0 [megaraid_disk_12], SCSI device
|
||||
/dev/bus/0 -d megaraid,13 # /dev/bus/0 [megaraid_disk_13], SCSI device
|
|
@ -95,7 +95,7 @@ is_disk_support_smart() {
|
|||
_disk="${1}"
|
||||
_type="${2}"
|
||||
|
||||
_smarctl_support_result="${XYMONTMP}/${MACHINEDOTS}.smartoverall.support.$(basename "${_disk}")"
|
||||
_smarctl_support_result="${XYMONTMP}/${MACHINEDOTS}.smartoverall.support.$(basename "${_disk}").${_type}"
|
||||
|
||||
smart_support_msg=""
|
||||
|
||||
|
@ -145,7 +145,7 @@ choose_correct_type() {
|
|||
TYPE=""
|
||||
SMART_SUPPORT_MSG=""
|
||||
|
||||
for test_type in "${_default_type}" "${_scanned_type}"; do
|
||||
for test_type in "${_scanned_type}" "${_default_type}"; do
|
||||
is_disk_support_smart "${_disk}" "${test_type}"
|
||||
|
||||
## If no message, the type is correct
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
#!/bin/sh
|
||||
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
||||
|
||||
# Vars [[[
|
||||
debug="0"
|
||||
|
||||
## Colors [[[
|
||||
c_redb='\033[1;31m'
|
||||
c_magentab='\033[1;35m'
|
||||
c_reset='\033[0m'
|
||||
## ]]]
|
||||
default_mtime_minutes="600"
|
||||
|
||||
drivedb_list="/tmp/test.css"
|
||||
|
||||
DDRIVEDB_MSG="green"
|
||||
#DDRIVEDB_MSG="red"
|
||||
DISK="/dev/sda"
|
||||
# ]]]
|
||||
## Create or empty a file if it's too old [[[
|
||||
regenerate_if_too_old() {
|
||||
## Set variables according to the number of passed arguments
|
||||
case $# in
|
||||
1 )
|
||||
_file="${1}"
|
||||
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : regenerate_if_too_old func − Use default_mtime_minutes value: ${default_mtime_minutes}."
|
||||
_max_mtime_minutes="${default_mtime_minutes}"
|
||||
;;
|
||||
2 )
|
||||
_file="${1}"
|
||||
_max_mtime_minutes="${2}"
|
||||
;;
|
||||
esac
|
||||
|
||||
_current_timestamp=$(date "+%s")
|
||||
_file_mtime_timestamp=$(stat --format="%Y" -- "${_file}")
|
||||
|
||||
## Substract last modification timestamp of the file to current timestamp
|
||||
: $(( _file_mtime_seconds=_current_timestamp-_file_mtime_timestamp ))
|
||||
## Get maximum allowed mtime in seconds
|
||||
: $(( _max_mtime_seconds=_max_mtime_minutes*60 ))
|
||||
|
||||
## Compare last modification mtime with the maximum allowed
|
||||
if [ "${_file_mtime_seconds}" -gt "${_max_mtime_seconds}" ]; then
|
||||
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : regenerate_if_too_old func − Need to empty or create ${_file} last modification happened ${_file_mtime_seconds} seconds ago (maximum is ${_max_mtime_seconds})."
|
||||
true > "${_file}"
|
||||
else
|
||||
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : regenerate_if_too_old func − Don't need to empty ${_file} last modification happened ${_file_mtime_seconds} seconds ago (maximum is ${_max_mtime_seconds})."
|
||||
fi
|
||||
|
||||
}
|
||||
## ]]]
|
||||
|
||||
regenerate_if_too_old /tmp/css_style.css
|
||||
regenerate_if_too_old /tmp/font.css 60
|
||||
regenerate_if_too_old /tmp/user/1337/serverauth.qGdeK8OOzr 1440
|
||||
regenerate_if_too_old /tmp/test.css 600
|
||||
|
||||
if printf -- '%s' "${DDRIVEDB_MSG}" | grep -q -E -- "green" &&
|
||||
! grep -q -- "${DISK}" "${drivedb_list}"
|
||||
then
|
||||
echo "${DISK}" >> "${drivedb_list}"
|
||||
fi
|
||||
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue