Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
8514fbc4
Commit
8514fbc4
authored
Apr 24, 2013
by
Dan Reading
Browse files
checkpoint: TYPE and Temp working
parent
c3f49db0
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/common/nodetest/usr/local/etc/emulab/diskcheck
View file @
8514fbc4
...
...
@@ -111,9 +111,9 @@ main() {
$name_val
)
d[
$name_val
]=
"
${
drive
[
$idx
]
}
"
;;
$sectors_val
)
d[
$sectors_val
]=
$(
getsectors
${
drive
[
$idx
]
}
)
;;
$bpers_val
)
d[
$bpers_val
]=
$(
getbpers
${
drive
[
$idx
]
}
)
;;
#
$driver_val ) d[$driver_val]=$(getdriver ${drive[$idx]}) ;;
#
$type_val ) d[$type_val]=$(gettype ${drive[$idx]}) ;;
#
$temp_val ) d[$temp_val]=$(gettemp ${drive[$idx]}) ;;
$driver_val
)
d[
$driver_val
]=
$(
getdriver
${
drive
[
$idx
]
}
)
;;
$type_val
)
d[
$type_val
]=
$(
gettype
${
drive
[
$idx
]
}
)
;;
$temp_val
)
d[
$temp_val
]=
$(
gettemp
${
drive
[
$idx
]
}
)
;;
# $model_val ) d[$model_val]=$(getmodel ${drive[$idx]}) ;;
# $serial_val ) d[$serial_val]=$(getserial ${drive[$idx]}) ;;
# $wspeed_val ) d[$wspeed_val]=$(getwspeed ${drive[$idx]}) ;;
...
...
@@ -389,25 +389,54 @@ echo -n "${scan[@]}"
}
getdriver
()
{
echo
'"UNKNOWN"'
return
0
# don't support this right now
# smtcl=$(findSmartctl)
# if [ "${smtcl/smartcl}" == "$smtcl" ] ; then
# echo '"UNKNOWN"'
# return 0
# fi
echo
'"NA"'
return
0
}
gettype
()
{
set
-x
smtcl
=
$(
findSmartctl
)
if
[
"
${
smtcl
/smartcl
}
"
==
"
$smtcl
"
]
;
then
echo
'"
UNKNOW
N"'
if
[
"
${
smtcl
/smartc
t
l
}
"
==
"
$smtcl
"
]
;
then
echo
'"N
A
"'
return
0
fi
data
=
$(
$smtcl
$1
|
grep
""
)
res
=
1
set
+x
return
0
echo
$FUNCNAME
res
=
$(
$smtcl
-i
$1
|
grep
"ATA Version is"
)
if
[
-n
"
$res
"
]
;
then
res
=
${
res
##*is
:
}
res
=
${
res
// /
}
#get rid of spaces
[[
$res
>
6
]]
&&
res
=
'"SATA"'
||
res
=
'"PATA"'
echo
$res
return
0
fi
res
=
$(
$smtcl
-i
$1
|
grep
"SAS"
)
if
[
-n
"
$res
"
]
;
then
echo
'"SAS"'
return
0
fi
res
=
$(
$smtcl
-i
$1
|
grep
"SCSI"
)
if
[
-n
"
$res
"
]
;
then
echo
'"SCSI"'
return
0
fi
echo
'"UNKNOWN"'
return
0
}
gettemp
()
{
echo
$FUNCNAME
smtcl
=
$(
findSmartctl
)
if
[
"
${
smtcl
/smartctl
}
"
==
"
$smtcl
"
]
;
then
echo
'"NA"'
return
0
fi
res
=
"
$(
$smtcl
-l
scttempsts
$1
|
grep
-i
"Current Temperature:"
|
awk
'{print $3}'
)
"
if
[
-z
$res
]
;
then
#type 2
res
=
"
$(
$smtcl
-a
$1
|
grep
-i
"Current Drive Temperature:"
|
awk
'{print $4}'
)
"
fi
[[
$res
]]
&&
echo
$res
||
echo
'"UNKNOWN"'
return
0
}
getmodel
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment