Hi, I'm using the follow script to get interface statistics from my machine and plot a graph, but cacti shows a blank graph with GPRINT values "nan".
Any ideas?
netstat.sh
------------
grep="/bin/grep"
cut="/usr/bin/cut"
bc="/usr/bin/bc"
devsta="/proc/net/dev"
[ ! $1 ] && exit
interface=$1
line=`/bin/cat $devsta | $grep "$interface"`
line=`echo $line | $cut -d":" -f 2`
ibytes=`echo $line | $cut -d" " -f 1`
obytes=`echo $line | $cut -d" " -f 9`
echo -n "$ibytes $obytes"
- -----------
Problem updating uptime graph
Moderators: Developers, Moderators
Assuming you tested this script and it outputs the way you want, it is most likely a problem with the data input source. Going by the data here, the output string for your data input source should be something like:
Then you must define each of those outputs below and mark each one as "Update RRA".
It may also be useful to tail cacti's log file when cmd.php is running. That should tell you exectly what cacti is seeing. If you are having the problem described above, you will probably see something like 'N:U:U'.
-Ian
Code: Select all
<inbytes> <outbytes>
It may also be useful to tail cacti's log file when cmd.php is running. That should tell you exectly what cacti is seeing. If you are having the problem described above, you will probably see something like 'N:U:U'.
-Ian
Who is online
Users browsing this forum: No registered users and 0 guests