Skip to content

Instantly share code, notes, and snippets.

@stwalkerster
Last active Dec 16, 2015
Embed
What would you like to do?
RRD update for ACC graphs
#!/bin/bash
cd /home/stwalkerster/rrd/acc-new/
wget --no-check-certificate -O status.xml -o /dev/null https://toolserver.org/~acc/api.php?action=status
cat status.xml | sed "s/</\r\n</g" | grep status | sed "s/ /\n/g" | sed "s/\"\/>/\"/" | grep -v "<status" | head -n4 |sed "s/\"//g" > values
rm status.xml
chmod a+x values
. values
rm values
rrdval="N:"
rrdval=$rrdval$open
rrdval=$rrdval":"
rrdval=$rrdval$admin
rrdval=$rrdval":"
rrdval=$rrdval$checkuser
rrdval=$rrdval":"
rrdval=$rrdval$hold
#echo $rrdval;
rrdtool update /home/stwalkerster/rrd/acc-new/acc.rrd $rrdval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment