Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
7d35c8ec
Commit
7d35c8ec
authored
Oct 04, 2013
by
Dan Reading
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix last fix. Add some output
parent
6efe8a15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
clientside/tmcc/common/checknode/gen_sql
clientside/tmcc/common/checknode/gen_sql
+14
-5
No files found.
clientside/tmcc/common/checknode/gen_sql
View file @
7d35c8ec
...
@@ -5,6 +5,7 @@ source checkutils.sh
...
@@ -5,6 +5,7 @@ source checkutils.sh
checkdrift_main
()
{
checkdrift_main
()
{
set
-u
set
-u
declare
-i
countsame
=
1
filecount
=
0
hostcount
=
0
projdir
=
/proj/emulab-ops/nodecheck
projdir
=
/proj/emulab-ops/nodecheck
cd
$projdir
cd
$projdir
if
((
$#
))
;
then
if
((
$#
))
;
then
...
@@ -14,25 +15,30 @@ checkdrift_main() {
...
@@ -14,25 +15,30 @@ checkdrift_main() {
fi
fi
for
host
in
$allnodes
;
do
for
host
in
$allnodes
;
do
((
hostcount++
))
if
[
-d
$projdir
/
$host
/.tbdb
]
;
then
if
[
-d
$projdir
/
$host
/.tbdb
]
;
then
cd
$projdir
/
$host
/.tbdb
cd
$projdir
/
$host
/.tbdb
allchecks
=
$(
ls
|
sort
-r
|
paste
-s
-d
\\\
-
)
# paste command used to convert into space seperated words.
allchecks
=
$(
ls
|
sort
-r
|
paste
-s
-d
\\\
-
)
# paste command used to convert into space seperated words.
allchecks+
=
' '
# grr string matching, expect space at end
# check that the first file is has a mfsmode=1
# check that the first file is has a mfsmode=1
newest
=
${
allchecks
%%\ *
}
newest
=
${
allchecks
%%\ *
}
allchecks
=
${
allchecks
#*
}
# pop the list
allchecks
=
${
allchecks
#*
}
# pop the list
while
(
grep
-c
'ismfs=0'
$newest
&> /dev/null
)
;
do
[[
!
$allchecks
]]
&&
continue
newest
=
${
allchecks
%% *
}
while
(
grep
-c
'ismfs=0'
$newest
&> /dev/null
)
;
do
newest
=
${
allchecks
%%\ *
}
# take off the top
allchecks
=
${
allchecks
#*
}
# pop the list
allchecks
=
${
allchecks
#*
}
# pop the list
[[
!
$allchecks
]]
&&
break
done
done
readtmcinfo
$newest
hwinvcopy
readtmcinfo
$newest
hwinvcopy
declare
-i
countsame
=
-1
for
tocheck
in
$allchecks
;
do
for
tocheck
in
$allchecks
;
do
[[
$(
grep
'ismfs=0'
$tocheck
)
]]
&&
continue
# if not in ismfs mode then don't check
[[
$(
grep
'ismfs=0'
$tocheck
)
]]
&&
continue
# if not in ismfs mode then don't check
readtmcinfo
$tocheck
hwinv
readtmcinfo
$tocheck
hwinv
# note: will check against self for sanity
# note: will check against self for sanity
comparetmcinfo /tmp/.
$$
checkdiff
comparetmcinfo /tmp/.
$$
checkdiff
((
filecount++
))
if
[
-s
/tmp/.
$$
checkdiff
]
;
then
if
[
-s
/tmp/.
$$
checkdiff
]
;
then
echo
""
echo
""
echo
"
$host
$newest
$tocheck
are not the same"
echo
"
$host
$newest
$tocheck
are not the same"
...
@@ -49,16 +55,19 @@ checkdrift_main() {
...
@@ -49,16 +55,19 @@ checkdrift_main() {
# sudo mv $tocheck $projdir/$host/.tbdb/.notsame
# sudo mv $tocheck $projdir/$host/.tbdb/.notsame
# XXX - end
# XXX - end
else
else
:
#
echo "$host $newest $tocheck SAME"
# :
echo "$host $newest $tocheck SAME"
((
countsame++
))
((
countsame++
))
fi
fi
rm
-f
/tmp/.
$$
checkdiff
rm
-f
/tmp/.
$$
checkdiff
done
done
:
# echo "$host $countsame inventory files are the same"
# :[[ $countsame -gt 1 ]] && echo "$host $countsame inventory files are the same"
echo
-n
.
else
else
echo
"No record of node id
\"
$host
\"
."
echo
"No record of node id
\"
$host
\"
."
fi
fi
done
done
echo
""
echo
"
$filecount
files in
$hostcount
nodes checked"
}
}
checkwce_main
()
{
checkwce_main
()
{
set
-u
set
-u
...
...
Write
Preview
Markdown
is supported
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