Skip to content
GitLab
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-stable
Commits
404f6b27
Commit
404f6b27
authored
Oct 30, 2014
by
Dan Reading
Browse files
report format changes
parent
2548a757
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/common/checknode/gen_sql
View file @
404f6b27
...
...
@@ -484,6 +484,12 @@ setdirstructure() {
done
}
declare h4="
no
"
ph4() {
[[ !
$h4
]] && { echo "
=================================
$1
=================================
" >> /tmp/Report_CheckNode; h4="
no
"; }
}
genreport_main() {
reporting=1
[[ -z "
${
CHECKNODE_CRONJOB
-
}
" ]] && declare CHECKNODE_CRONJOB="
NO
"
...
...
@@ -504,20 +510,33 @@ genreport_main() {
nodes2do=
$allnodes
for node in
$nodes2do
; do
allnodes=
$node
echo "
=================================
$node
=================================
" >> /tmp/Report_CheckNode
h4=''
# echo "
=================================
$node
=================================
" >> /tmp/Report_CheckNode
if [ -s /proj/emulab-ops/nodecheck/
$node
/diff ] ; then
echo "
----------------------- inconsistency with db ---------------------------
" >> /tmp/Report_CheckNode
tail -n +5 /proj/emulab-ops/nodecheck/
$node
/diff >> /tmp/Report_CheckNode
# chop top off diff report and remove UNKNOWN lines
tail -n +5 /proj/emulab-ops/nodecheck/
$node
/diff | grep -v UNKNOWN | grep -v MISSING > /tmp/diffchop
# do we still have something to report?
if [ -s /tmp/diffchop ] ; then
diffDate=
$(
stat
-f
%Sm
-t
"%H:%M %d%b%g"
/proj/emulab-ops/nodecheck/
$node
/diff
)
ph4
$node
echo "
-----------------------
$diffDate
inconsistency with db -------------
" >> /tmp/Report_CheckNode
# remove pesky empty line
grep -v '^
$'
/tmp/diffchop >> /tmp/Report_CheckNode
rm -f /tmp/diffchop
fi
fi
gentbsql_main
$node
> /tmp/genreport
if [ -s /tmp/genreport ] ; then
echo "
--------------------------- suggested db updates -----------------------
" >> /tmp/Report_CheckNode
cat /tmp/genreport >> /tmp/Report_CheckNode
ph4
$node
echo "
>>>> Run gen_sql for suggested db updates
" >> /tmp/Report_CheckNode
# echo "
--------------------------- suggested db updates -----------------------
" >> /tmp/Report_CheckNode
# cat /tmp/genreport >> /tmp/Report_CheckNode
fi
checkdrift_main
$node
> /tmp/driftreport
checkdrift_main
$node
| grep -v '^
$'
> /tmp/driftreport
if [ -s /tmp/driftreport ] ; then
ph4
$node
echo "
--------------------------- changes over time ---------------------------
" >> /tmp/Report_CheckNode
cat /tmp/driftreport >> /tmp/Report_CheckNode
fi
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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