Nagy Károly Gábriel
6 years ago
7 changed files with 32 additions and 17 deletions
@ -1,9 +1,12 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
|
|
||||||
set -o noclobber |
set -o noclobber |
||||||
|
old=$PWD |
||||||
HOME=$(dirname $0) |
cd $(dirname $(readlink -f "$0")) |
||||||
. "$HOME"/master |
cd ../ |
||||||
|
FLUXPLUGHOME=$PWD |
||||||
|
. "$FLUXPLUGHOME"/master |
||||||
|
cd $old |
||||||
|
|
||||||
LINE=$($CHRONY | "$AWK" -F"," -v myhost="$myhost" -v time=`date -u +%s%N` '{printf "chrony,host=%s,reference_id=%s,stratum=%si,leap_status=%s system_time=%s,last_offset=%s,rms_offset=%s,frequency=%s,residual_frequency=%s,skew=%s,root_delay=%s,root_dispersion=%s,update_interval=%s %s\n",myhost,$2,$3,$13,$4,$5,$6,$7,$8,$9,$10,$11,$12,time}') |
LINE=$($CHRONY | "$AWK" -F"," -v myhost="$myhost" -v time=`date -u +%s%N` '{printf "chrony,host=%s,reference_id=%s,stratum=%si,leap_status=%s system_time=%s,last_offset=%s,rms_offset=%s,frequency=%s,residual_frequency=%s,skew=%s,root_delay=%s,root_dispersion=%s,update_interval=%s %s\n",myhost,$2,$3,$13,$4,$5,$6,$7,$8,$9,$10,$11,$12,time}') |
||||||
|
|
@ -1,9 +1,12 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
|
|
||||||
set -o noclobber |
set -o noclobber |
||||||
|
old=$PWD |
||||||
HOME=$(dirname $0) |
cd $(dirname $(readlink -f "$0") |
||||||
. "$HOME"/master |
cd ../ |
||||||
|
FLUXPLUGHOME=$PWD |
||||||
|
. "$FLUXPLUGHOME"/master |
||||||
|
cd $old |
||||||
|
|
||||||
LINE=$($DF | $SED | "$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{sub(/\%$/,"",$5);printf "disks,host=%s,disk=%s total=%s,available=%s,used=%s,percent=%s %s\n",myhost,$1,$2,$4,$3,$5,time}') |
LINE=$($DF | $SED | "$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{sub(/\%$/,"",$5);printf "disks,host=%s,disk=%s total=%s,available=%s,used=%s,percent=%s %s\n",myhost,$1,$2,$4,$3,$5,time}') |
||||||
|
|
@ -1,9 +1,12 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
|
|
||||||
set -o noclobber |
set -o noclobber |
||||||
|
old=$PWD |
||||||
HOME=$(dirname $0) |
cd $(dirname $(readlink -f "$0")) |
||||||
. "$HOME"/master |
cd ../ |
||||||
|
FLUXPLUGHOME=$PWD |
||||||
|
. "$FLUXPLUGHOME"/master |
||||||
|
cd $old |
||||||
|
|
||||||
LINE=$("$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{load1=$1; load5=$2; load15=$3 } END {printf "loadavg,host=%s load_1=%s,load_5=%s,load_15=%s %s\n",myhost,load1,load5,load15,time}' /proc/loadavg ) |
LINE=$("$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{load1=$1; load5=$2; load15=$3 } END {printf "loadavg,host=%s load_1=%s,load_5=%s,load_15=%s %s\n",myhost,load1,load5,load15,time}' /proc/loadavg ) |
||||||
|
|
@ -1,9 +1,12 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
|
|
||||||
set -o noclobber |
set -o noclobber |
||||||
|
old=$PWD |
||||||
HOME=$(dirname $0) |
cd $(dirname $(readlink -f "$0")) |
||||||
. "$HOME"/master |
cd ../ |
||||||
|
FLUXPLUGHOME=$PWD |
||||||
|
. "$FLUXPLUGHOME"/master |
||||||
|
cd $old |
||||||
|
|
||||||
LINE=$("$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{if ($1 ~/MemTotal:/) memtotal=$2; if ($1 ~/MemFree:/) memfree=$2; if ($1 ~/MemAvailable:/) memavailable=$2} END {if ( memtotal && memfree && memavailable ) printf "meminfo,host=%s mem_total=%si,mem_free=%si,mem_available=%si %s\n",myhost,memtotal,memfree,memavailable,time}' /proc/meminfo) |
LINE=$("$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{if ($1 ~/MemTotal:/) memtotal=$2; if ($1 ~/MemFree:/) memfree=$2; if ($1 ~/MemAvailable:/) memavailable=$2} END {if ( memtotal && memfree && memavailable ) printf "meminfo,host=%s mem_total=%si,mem_free=%si,mem_available=%si %s\n",myhost,memtotal,memfree,memavailable,time}' /proc/meminfo) |
||||||
|
|
@ -1,9 +1,12 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
|
|
||||||
set -o noclobber |
set -o noclobber |
||||||
|
old=$PWD |
||||||
HOME=$(dirname $0) |
cd $(dirname $(readlink -f "$0")) |
||||||
. "$HOME"/master |
cd ../ |
||||||
|
FLUXPLUGHOME=$PWD |
||||||
|
. "$FLUXPLUGHOME"/master |
||||||
|
cd $old |
||||||
|
|
||||||
LINE=$("$APT" | "$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{if ($1~/^Inst/) counter=counter+1} END {if (counter) printf "packages,host=%s packs=%si %s\n",myhost,counter,time}') |
LINE=$("$APT" | "$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{if ($1~/^Inst/) counter=counter+1} END {if (counter) printf "packages,host=%s packs=%si %s\n",myhost,counter,time}') |
||||||
|
|
Loading…
Reference in new issue