Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sysop-bioinformatics
management_scripts
Commits
fecc3208
Commit
fecc3208
authored
Jun 16, 2020
by
Haarst, Jan van
Browse files
Add timeout, and move to lovelace
parent
7d6c0672
Changes
1
Hide whitespace changes
Inline
Side-by-side
profile.d/Z00-gstat.sh
View file @
fecc3208
#!/bin/bash
# Script to show usage on other machines
echo
echo
"Usage on our other machines:"
echo
"Hostname LOAD CPU"
;
echo
" CPUs (Procs/Total) [ 1, 5, 15min] [ User, Nice, System, Idle, Wio]"
;
#gstat -al | sed 's/OFF//'
gstat
-al
--gmond_ip
=
$(
dig wiki.ab.wurnet.nl +short
)
|
sed
'/localhost/,+1 d'
|
sed
's/OFF//'
# First get info from ganglia
HOST
=
lovelace.bioinformatics.nl
IP
=
$(
dig
$HOST
+short |
tail
-1
)
RESULT
=
$(
timeout
0.5 gstat
-al
--gmond_ip
=
${
IP
}
|
sed
'/localhost/,+1 d'
|
sed
's/OFF//'
)
IGNORE
=
'bunker|lovelace|scratch'
# If that is successfull, continue with printing the output
if
[
-z
"
$RESULT
"
]
then
echo
-
else
echo
echo
"Usage on our other machines:"
{
echo
Hostname,CPUs,Processes_running,Processes_total,load-1m,load-5m,load-15,cpu_user,cpu_nice,cpu_system,cpu_idle,cpu_wio |
tr
','
' '
;
echo
"
$RESULT
"
|
paste
- - |
tr
'/'
' '
|
tr
','
' '
|
tr
-d
'[]()'
|
sort
-k8n
|
grep
-vE
$IGNORE
;
}
| column
-t
fi
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