cleanup
This commit is contained in:
@ -12,3 +12,4 @@
|
||||
2021-01-14;XLM;380.6974577;100;2.99;0.2548;10
|
||||
2021-01-14;ETH;0.48874273;500;7.34;1008.01;10
|
||||
2021-02-03;EGLD;35.12583900;2000;6.00;56.8242654;50
|
||||
2021-04-21;EGLD;27.34081182;4000;6.00;144.90;50
|
||||
|
|
@ -15,13 +15,18 @@ my $cryptoMap = {
|
||||
"BTC" => "Bitcoin",
|
||||
"CVC" => "Civic",
|
||||
"DNT" => "district0x",
|
||||
"DOGE" => "Dogecoin",
|
||||
"EGLD" => "Elrond eGold",
|
||||
"ETH" => "Etherium",
|
||||
"EOS" => "EOS",
|
||||
"LRC" => "Loopring",
|
||||
"RAD" => "Radicle",
|
||||
"REN" => "REN",
|
||||
"SHIB" => "Shiba Inu",
|
||||
"SNX" => "Synthetix",
|
||||
"XLM" => "Stellar Lumen",
|
||||
"XTZ" => "Tezos"
|
||||
"XTZ" => "Tezos",
|
||||
"ZRX" => "Ox",
|
||||
};
|
||||
my $v;
|
||||
|
||||
@ -54,7 +59,7 @@ while (<CSV>) {
|
||||
};
|
||||
$x->{CURRENT_PRICE} = &getCurrentPrice($currency);
|
||||
$x->{LAST_WEEK_PRICE} = &getLastWeekValue($currency);
|
||||
$x->{IMAGE} = `curl -s 'http://localhost/cgi-bin/graph.pl?width=540&height=200&graph=crypto-${currency}&start=-14d' --output - | base64 -w 0`;
|
||||
$x->{IMAGE} = `curl -s 'http://localhost/cgi-bin/graph.pl?width=540&height=200&graph=crypto-${currency}&start=-14d' --output - | base64`;
|
||||
push @{$v->{DATA}},$x;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ RRDDIR="/var/www/localhost/rrd"
|
||||
RRDPREFIX="crypto-"
|
||||
TMPLDIR="/var/www/localhost/tmpl"
|
||||
|
||||
for c in AAVE ALGO BTC CVC DNT EOS ETH LRC LTC REN SNX XLM XTZ;
|
||||
for c in AAVE ALGO BTC CVC DOGE DNT EOS ETH LRC LTC RAD REN SNX XLM XTZ ZRX;
|
||||
do
|
||||
if [[ ! -f "${RRDDIR}/${RRDPREFIX}${c}.rrd" ]];
|
||||
then
|
||||
@ -40,3 +40,6 @@ GPRINT:sell:LAST:%6.4lf %sEUR\n
|
||||
EOF
|
||||
fi
|
||||
done
|
||||
|
||||
SELL=$(curl -s https://api.coinbase.com/v2/prices/SHIB-EUR/spot | jq .data.amount | sed 's/"//g')
|
||||
rrdtool update "${RRDDIR}/${RRDPREFIX}SHIB.rrd" N:${SELL}
|
||||
|
@ -16,7 +16,7 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www
|
||||
<H1><a href="/">home</a> <a href="/lxc.html">lxc</a> <a href="/crypto.html">crypto</a> LXC - Monitoring</H1>
|
||||
<DIV>
|
||||
'
|
||||
curl -s http://10.3.0.1 | while read c;
|
||||
curl -s http://10.3.0.1 | sort | while read c;
|
||||
do
|
||||
echo "<DIV>
|
||||
<B>[$c]</B><BR/>
|
||||
|
@ -1,23 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
DIR="/var/www/mrtg/tmpl"
|
||||
cpuCount=$(grep processor /proc/cpuinfo | wc -l)
|
||||
|
||||
curl -s http://10.3.0.1 | while read c;
|
||||
do
|
||||
|
||||
for m in cpu memory
|
||||
do
|
||||
echo "-v $m
|
||||
-t [$c] $m
|
||||
echo "-v memory
|
||||
-t [$c] memory
|
||||
--full-size-mode
|
||||
--color=BACK#343637
|
||||
--color=CANVAS#F0F0F0
|
||||
--color=FONT#F0F0F0
|
||||
--font=TITLE:12:DejaVu Bold
|
||||
DEF:in=/var/www/mrtg/rrd/lxc-$c.$m.rrd:ds0:AVERAGE
|
||||
DEF:in=/var/www/mrtg/rrd/lxc-$c.memory.rrd:ds0:AVERAGE
|
||||
AREA:in#CC9A5780
|
||||
LINE1:in#CC9A57" > "$DIR/lxc-$c.$m.tmpl"
|
||||
done
|
||||
LINE1:in#CC9A57" > "$DIR/lxc-$c.memory.tmpl"
|
||||
|
||||
echo "-v cpu perc
|
||||
-t [$c] cpu
|
||||
--full-size-mode
|
||||
--color=BACK#343637
|
||||
--color=CANVAS#F0F0F0
|
||||
--color=FONT#F0F0F0
|
||||
--font=TITLE:12:DejaVu Bold
|
||||
DEF:i=/var/www/mrtg/rrd/lxc-$c.cpu.rrd:ds0:AVERAGE
|
||||
CDEF:in=i,$cpuCount,/,10000000,/
|
||||
AREA:in#CC9A5780
|
||||
LINE1:in#CC9A57" > "$DIR/lxc-$c.cpu.tmpl"
|
||||
|
||||
echo "-v in/up bps
|
||||
-t [$c] net
|
||||
|
Reference in New Issue
Block a user