I'm in the process of adding various data to my rrdtool setup, and one of the things i want ot monitor is the meminfo stuff.
I have it running locally very well with the following:
/usr/bin/rrdupdate /etc/rrdtool/192.168.43.254.mem.rrd --template \
used:free:buff:cached:swap N:`awk ' \
/^MemTotal:/ {total=$2*1024}
/^MemFree:/ {free=$2*1024}
/^Buffers:/ {buff=$2*1024}
/^Cached:/ {cached=$2*1024}
/^SwapTotal:/ {swaptotal=$2*1024}
/^SwapFree:/ {swapfree=$2*1024}
END {
used=total-(free+buff+cached)
swap=swaptotal-swapfree
print used ":" free ":" buff ":" cached ":" swap
}' /proc/meminfo`
But when I try and run an SSH command prior to this, i.e. for a remote server, I get errors. Can someone give me a clue as to what I'm doing wrong?
/usr/bin/rrdupdate /etc/rrdtool/192.168.43.253.mem.rrd --template \
used:free:buff:cached:swap N:`ssh 192.168.43.253 "awk ' \
/^MemTotal:/ {total=$2*1024}
/^MemFree:/ {free=$2*1024}
/^Buffers:/ {buff=$2*1024}
/^Cached:/ {cached=$2*1024}
/^SwapTotal:/ {swaptotal=$2*1024}
/^SwapFree:/ {swapfree=$2*1024}
END {
used=total-(free+buff+cached)
swap=swaptotal-swapfree
print used ":" free ":" buff ":" cached ":" swap
}' /proc/meminfo"`
Thanks
James