Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
eole-wol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
primtux-eole
Grenoble
eole-wol
Commits
6dad5b84
Verified
Commit
6dad5b84
authored
5 years ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Retrieve upgrade logs and summary from all schools
parent
1ab65a48
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
logs/extract_hosts.sh
+43
-0
43 additions, 0 deletions
logs/extract_hosts.sh
logs/getlogs.sh
+11
-0
11 additions, 0 deletions
logs/getlogs.sh
with
54 additions
and
0 deletions
logs/extract_hosts.sh
0 → 100755
+
43
−
0
View file @
6dad5b84
#!/bin/bash
SCHOOLS
=
$(
/usr/bin/ls
*
.log |
grep
-v
"getlogs.log"
|
sed
's/\.log$//'
)
for
school
in
$SCHOOLS
do
UPDATED
=
""
FAILED
=
""
file
=
"
$school
.log"
MACS
=
$(
awk
'/^Trying/{print $5}'
$file
|
sed
-e
's/(//'
-e
's/)//'
)
for
mac
in
$MACS
do
name
=
$(
grep
"^Trying to boot .* (
$mac
)"
$file
|
cut
-d
' '
-f
4
)
host
=
"
$name
-
$mac
"
if
[
$(
grep
"Begin host
$name
(
$mac
"
-A
1
$file
|
grep
"End host
$name
"
-c
)
-eq
0
]
then
UPDATED
=
"
$UPDATED
$host
"
else
FAILED
=
"
$FAILED
$host
"
fi
done
nUpdated
=
$(
echo
$UPDATED
|
wc
-w
)
nUpdatedTot
=
$((
$nUpdatedTot
+
$nUpdated
))
nFailed
=
$(
echo
$FAILED
|
wc
-w
)
nFailedTot
=
$((
$nFailedTot
+
$nFailed
))
if
[
$nFailed
-gt
0
]
then
SCHOOLS_FAILED
=
"
$SCHOOLS_FAILED
$school
"
fi
echo
"=====================
$school
============================"
echo
"Resultats pour l'école '
$school
'"
echo
-e
"
\t
sur un total de
$((
$nUpdated
+
$nFailed
))
postes"
echo
-e
"
\t
$nUpdated
postes mis à jour (
$UPDATED
)"
echo
-e
"
\t
$nFailed
postes non contactés (
$FAILED
)"
echo
"========================================================="
done
nSchools
=
$(
echo
$SCHOOLS
|
wc
-w
)
nFailedSchools
=
$(
echo
$SCHOOLS_FAILED
|
wc
-w
)
echo
"===================== Total ============================"
echo
"Resultats globaux"
echo
-e
"
\t
sur un total de
$((
$nUpdatedTot
+
$nFailedTot
))
postes dans
$nSchools
écoles"
echo
-e
"
\t
$nUpdatedTot
postes mis à jour"
echo
-e
"
\t
$nFailedTot
postes non contactés dans
$nFailedSchools
écoles (
$SCHOOLS_FAILED
)"
echo
"========================================================="
This diff is collapsed.
Click to expand it.
logs/getlogs.sh
0 → 100755
+
11
−
0
View file @
6dad5b84
#!/bin/bash
ECOLES
=
"alphonse-daudet ampere anatole-france anthoard bajatiere beauvert bizanet christophe-turc-vm christophe-turc-vo clemenceau diderot elisee-chatin ferdinand-buisson grand-chatelet houille-blanche jean-jaures joseph-vallier jules-ferry fontaine lac verderet leon-jouhaux buttes trembles liberation lucie-aubrac malherbe menon-sg menon-sh nicolas-chorier paul-bert paul-painleve saint-laurent sidi-brahim simone-lagrange"
for
e
in
$ECOLES
do
echo
"Retrieving logs for
$e
"
file
=
$(
ssh
-o
"StrictHostKeyChecking=no"
root@
$e
.ecole.grenoble.fr
\
ssh partage
ls
-ltr
/var/log/ |
grep
'upgrade_all'
\
|
tail
-n
1 | rev |
cut
-d
' '
-f
1 | rev
)
ssh
-o
"StrictHostKeyChecking=no"
root@
$e
.ecole.grenoble.fr ssh partage
cat
/var/log/
$file
>
$e
.log
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment