how to graph traffic?

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

Moderators: Developers, Moderators

Post Reply
InfInIte
Posts: 23
Joined: Wed Apr 14, 2004 12:27 pm

how to graph traffic?

Post by InfInIte »

Hello,

I installed cacti today and have been trying to monitor my in and outgoing traffic, but I can't get it working.
Can someone tell me step by step how to setup cacti to do this or point me to a good tutorial about this?

I'm using the latest version of cacti and have snmp installed.
I'm alreay using mrtg but I would like to try it with cacti too.

Thanks.
Mika
Cacti User
Posts: 64
Joined: Tue Mar 23, 2004 3:01 am

Post by Mika »

Hi,
I have cacti 0.8.5 installed and I hope there is no big difference between 0.8.5a.
So, go to console, and there are few ways to set measurement. But I'll tell you at least one.
Go to Devices. If you have already added any devices, click on which you want to start measurement. If you don't have any devices, please add. Then, click on that device and cacti will list some info about that device. On top right corner, you'll see "Creat graphs for this hosts", click on it and you'll see a drop down menu of Graph templates and if its a router, you will also get a list of interface. So you pick up either graphing template or select particular interface you want to measure and select "graph type" at the bottom of the page, and then click "create".
First graphs you will see after cron will run your polling request (max after 5 minutes). First numbers you will get either after first time cron runs (if its gauge) or after cron runs second time (if its counters).

Hope this will help you.
Good luck.
InfInIte
Posts: 23
Joined: Wed Apr 14, 2004 12:27 pm

Post by InfInIte »

I did exacty as you described, and get this error net to where the graph should be:
Notice: Undefined variable: regexps in /home/cacti/public_html/lib/rrd.php on line 308

Notice: Undefined variable: fetch_array in /home/cacti/public_html/lib/rrd.php on line 323
ERROR: no rrdtool fetch output, you probably forgot to pass a valid data source
Notice: Undefined variable: regexps in /home/cacti/public_html/lib/rrd.php on line 308

Notice: Undefined variable: fetch_array in /home/cacti/public_html/lib/rrd.php on line 323
ERROR: no rrdtool fetch output, you probably forgot to pass a valid data source
ERROR: opening '/home/cacti/public_html/rra/localhost_traffic_in_8.rrd': No such file or directory
The program didn't create the localhost_traffic_in_8.rrd file.
And do I have to fill in something for the 'Index Type', 'Index Value' and 'Output Type ID' under 'Custom Data' for this graph?
InfInIte
Posts: 23
Joined: Wed Apr 14, 2004 12:27 pm

Post by InfInIte »

I dont know what i did, but the first time i tried what you told me i couldn't select an interface and graph type.
but now somehow i can choose one. and i think it's working pretty well now.
but i'm getting graphs like the one i attached..how is that possible :-?
Attachments
graph2.jpg
graph2.jpg (70.49 KiB) Viewed 3419 times
InfInIte
Posts: 23
Joined: Wed Apr 14, 2004 12:27 pm

Post by InfInIte »

nobody who can help me with this? :(
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I assume you have cmd.php correctly setup to run every five minutes from cron? What happens if you 'cd' to Cacti's directory and run 'php cmd.php' at the command line? You should see if there are any errors displayed. Are you seeing these gaps in all of your graphs or just this one?

-Ian
InfInIte
Posts: 23
Joined: Wed Apr 14, 2004 12:27 pm

Post by InfInIte »

yes, cron runs it every 5 minutes, and there are no errors in the output.
And the gaps are in all the graphs.

I think it's a problem with the cron job.
On the attached image you can see how i've set it up with webmin.
When i click the 'run now' button, it runs fine, and the graphs get updated.
But when it runs auomaticly, it doesn't update anything :S
I've got no idea what's cousing this
Attachments
cron.jpg
cron.jpg (129.65 KiB) Viewed 3344 times
User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Post by Morgan »

could you run crontab -l from a terminal screen, it would make more sense (to me at least)
InfInIte
Posts: 23
Joined: Wed Apr 14, 2004 12:27 pm

Post by InfInIte »

sure, here you go:
Attachments
cron2.jpg
cron2.jpg (84.01 KiB) Viewed 3323 times
rommel
Posts: 1
Joined: Thu Apr 22, 2004 4:54 am

Post by rommel »

Hi

I think you need to write before the command "php ..." which user is going to execute it. Like this:

Code: Select all

0-55/5 * * * *	rommel	php /var/www/localhost/htdocs/cacti/cmd.php > /dev/null 2>&1
Rommel
User avatar
branix
Posts: 39
Joined: Sun Mar 14, 2004 10:38 am

Post by branix »

Make sure you have reloaded cron after adding you new line to the crontab file (I'm not sure if webmin does that automatically).

Code: Select all

crontab /etc/crontab
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests