Problem updating uptime graph

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Tosta

Problem updating uptime graph

Post by Tosta »

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"
- :cry: -----------
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

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:

Code: Select all

<inbytes> <outbytes>
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
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests