Commit c5b1084b authored by Olav Kvittem's avatar Olav Kvittem

added rude-status; mp-cmd with userid

parent 3bfc8d7f
......@@ -2,6 +2,7 @@
mplist=$1
reglist=$2
regnames=`cat $regnames`
function path_lth {
echo `traceroute -n -q 3 $1| wc -l || echo 99`
......@@ -10,7 +11,7 @@ function path_lth {
for mp in `cat $mplist`; do
reg1l=99
reg2l=99
for reg in `cat $reglist` ; do
for reg in $regnames ; do
if test $reg != $mp ; then
lth=$( path_lth $reg )
if test $lth -lt $reg1l; then
......
......@@ -8,5 +8,5 @@ for mp in `cut -f 1 $mps | grep -v \#` ; do
echo henter $mp
# ssh -q root@$mp sysctl net.core.rmem_default
ssh -q $user@$mp "$cmd"
ssh -q -o ConnectTimeout=3 $user@$mp "$cmd"
done
#! /bin/sh
set -e
kind='https://kind.uninett.no/openapi/utstyr_mp.json'
mp=$(curl -s "$kind" | jq -M '.[] | .navn' | cut -d\" -f2)
ssh='ssh -o ConnectTimeout=3'
cmd='cd /var/lib/mp-rude/ ; du -h *-$(date +%Y-%m-%d).crude.gz'
clear
printf "%-40s %-6s %s\n====================================================\n" HOSTNAME SIZE FILE
while true ; do
printf "\x1b[3;1f"
for host in $mp ; do
printf "%-40s %-6s %s\n" $host $($ssh $host 'cd /var/lib/mp-rude/ ; du -h *-$(date +%Y-%m-%d).crude.gz' || echo FAILED)
done
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment