Cacti can't tell a rrd from another ?!

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Japh
Posts: 7
Joined: Wed Sep 11, 2002 7:33 am

Cacti can't tell a rrd from another ?!

Post by Japh »

Hi all.

I'm trying to start a network traffic monitoring server using Cacti.

At the present, and for a start, I want to monitor 3 Cisco Catalyst 2950 switches (24x10/100 ).

I've stumbled (so far 8) ) in a couple of issues:

- Creating a graph, for example, the interface 24 of one of the switches, I get 2 rrd files using the Cacti defaults:
- traf_fastethernet024_25_in.rrd
- traf_fastethernet024_25_out.rrd
but if I create a graph for *ANOTHER* switch but same interface (24), cacti will go bananas ... and uses the same 2 files for both switches !
Needless to say that the resulting output ... er... :roll: is totally disastrous ...

Another thing that bothers me is that I want all the graphs I create related to traffic analysis be in "Bits per second" instead of the default "Bytes per second".
The only way I could find to do it is creating the graphs and then, graph by graph change the y-axis legend to "Bits per second" and then, item by item, applying the "Bytes to Bits" CDEF ...
This is ******* annoying ...
Isn't there a way to change the defaults to "Bits Per Second" and "Convert Bytes to Bits" (or whatever suits the user that configures) ?

Besides all, great product :-)
We're born naked, wet and hungry.
Then things get worse.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Your first problem is caused by empty IP address field for the switches (that's normal because they are layer-2 devices). In this case cacti tries to use interface description to autogenerate rrd file name. Interface descriprions are the same for your switches which results in the same rrd file name generated. You would need to change line 67 of snmp_interfaces.php file.
$snmp_description = mysql_result($sql_id, 0, "description") . "_" . mysql_result($sql_id, 0, "interfacenumber");
Replace "descriptions" to "hardwareaddress" maybe (check if your filesystem can handle strings like 0:6:52:81:58:6 inside a file name).

You can change speed unit defaults with two changes in include/utility_functions.php:

line 306
$graph_vertical_label = "Bytes Per Second";

to

$graph_vertical_label = "Bits Per Second";
line 377
$sql_id = mysql_query("insert into rrd_graph_item sid,colorid,textformat,sequence,graphid,graphtypeid,consolidationfunction,hardreturn) values ($datasource_id[$o],$graph_color_array[$s],\"$graph_text_format_array[$s]\",((($o*4)+$s)+1),$graph_id,$graph_type,$graph_cf_function,\"$graph_hard_return_array[$s]\")",$cnn_id);

to

$sql_id = mysql_query("insert into rrd_graph_item sid,colorid,textformat,sequence,graphid,graphtypeid,consolidationfunction,hardreturn,cdefid) values ($datasource_id[$o],$graph_color_array[$s],\"$graph_text_format_array[$s]\",((($o*4)+$s)+1),$graph_id,$graph_type,$graph_cf_function,\"$graph_hard_return_array[$s]\",2)",$cnn_id);
You can also use the script to change already configured grpahs:
http://www.raxnet.net/board/viewtopic.php?t=444

- bulek
Japh
Posts: 7
Joined: Wed Sep 11, 2002 7:33 am

Post by Japh »

First of all, thanks for the detailed answer.

Anyway, even if my filesystem supports the ":" char (Linux, ext3 - It does) , I can't use it ... the rrdtool goes bananas with it:

ERROR: can't parse argument 'DS:traf_0:6:52:5d:7d:5:COUNTER:600:0:100000000'
ERROR: opening '/path/to/cacti/rra/traf_0:6:52:5d:7d:58_25_in.rrd': No such file or directory
ERROR: can't parse argument 'DS:traf_0:6:52:5d:7d:5:COUNTER:600:0:100000000'
ERROR: opening '/path/to/cacti/rra/traf_0:6:52:5d:7d:58_25_out.rrd': No such file or directory

Got to get around it in another way :cry:

The other stuff works great 8)

If anyone has other suggestions, I'd like to hear ... 8)
We're born naked, wet and hungry.
Then things get worse.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

There is a nice function called CleanUpName in include/functions.php. It replaces some characters to "_". You can add ":" to characters being replaced. Then use the function like this:
$snmp_description = CleanUpName(mysql_result($sql_id, 0, "hardwareaddress")) . "_" . mysql_result($sql_id, 0, "interfacenumber");
I hope it works for you.

- bulek
Japh
Posts: 7
Joined: Wed Sep 11, 2002 7:33 am

Post by Japh »

YES ! :lol:

Working great ! Thanks !

BTW, you have a little error on your suggestion on file include/utility_functions.php ... that made me less hairy :roll:

On line 377 it has to be:

$sql_id = mysql_query("insert into rrd_graph_item (dsid,colorid,textformat,

instead of your suggestion ... I guess you missed the (d on your C&P ...

Minor details :lol:

Thanks again for your help and pacience 8)
We're born naked, wet and hungry.
Then things get worse.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests