Making Bits the default

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

Moderators: Developers, Moderators

Post Reply
poperszky
Posts: 25
Joined: Mon Mar 04, 2002 7:00 pm

Post by poperszky »

Where are the default graphs defined? What I would like to do is change the graphs from a default bytes, to a bits per second instead.
jwiegley
Posts: 31
Joined: Mon Feb 04, 2002 7:00 pm

Post by jwiegley »

I would like to see this as well. I would assume that all network engineers like myself would rather see bits than bytes. My bandwidth costs are based on bits not bytes. If you don't deal with provider bandwidth costs then you probably don't have that many interfaces to track. I think it would be far less work for people with a few interfaces to change bits to bytes than for those with huge numbers of interfaces to convert bytes to bits. And I think anybody with 100+ interfaces will be interested in bits.

Also it isn't that hard to do an update query on the database and change all graphs in one shot. That is how I have been doing. Except I have to relearn what the update command is every time I need it :wink:
karlh
Posts: 37
Joined: Wed Mar 06, 2002 7:00 pm
Location: Reykjavik, Iceland
Contact:

Post by karlh »

Hi.
I just edited the rrd_graph_item in the mysql table. CDEF is id 2 for Turn Bytes into Bits so, make the default from 0 to 2
CDEFID smallint(5) Yes 2 Change Drop Primary Index Unique

Therefor all my graphs are using bits, and not bytes.

Best regards
Karl Heiðar
Systems Engineer
Iceland Telecom
poperszky
Posts: 25
Joined: Mon Mar 04, 2002 7:00 pm

Post by poperszky »

Ok, anyone care to take pity on me and give me that command to do the mass change? Right now cacti is only being used for Network traffic so this would be the time to change it.
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Here is the SQL needed to covert ALL of your graph items to use the bytes -> bits CDEF:

update rrd_graph_item set cdefid=2;

-Ian
poperszky
Posts: 25
Joined: Mon Mar 04, 2002 7:00 pm

Post by poperszky »

Thanks Ian and the others for this solution, cacti has just become perfect. Ian, this is absolutely a beautiful product, keep up the good work.

Terry
poperszky
Posts: 25
Joined: Mon Mar 04, 2002 7:00 pm

Post by poperszky »

Is there a command that would change the values all the labels as well?
User avatar
drub
Cacti User
Posts: 59
Joined: Thu Jan 31, 2002 7:00 pm
Location: Las Vegas
Contact:

Post by drub »

here ya go

update rrd_graph set VerticalLabel='Bits Per Second'

I also posted a way to make a button on the graph settings page to globally make these changes Here

so what I do is add 20-30 graphs then go hit that button, changes em' all on the fly.


<font size=-1>[ This Message was edited by: drub on 2002-03-08 11:18 ]</font>
poperszky
Posts: 25
Joined: Mon Mar 04, 2002 7:00 pm

Post by poperszky »

Thanks, I appreciate the help.
RandomWelshBloke
Posts: 33
Joined: Mon Feb 18, 2002 7:00 pm
Location: London, UK

Post by RandomWelshBloke »

The below mentioned MySQL statements:

update rrd_graph_item set cdefid=2;
update rrd_graph set VerticalLabel='Bits Per Second' ;

Update all graphs and graph items, only problem is I am monitoring ping responces as well. I figured a statement to change the lables from 'Bits Per Second' to 'ms'

update rrd_graph set VerticalLabel='ms' WHERE Title LIKE "Ping%";

And a statement to list the graph items to be changed:

select rrd_graph.Title from rrd_graph, rrd_graph_item Where rrd_graph.ID = rrd_graph_item.GraphID and rrd_graph.Title LIKE "Ping%";

Problem is I can't get UPDATE to use 2 tables, any ideas...

Random.
RandomWelshBloke
Posts: 33
Joined: Mon Feb 18, 2002 7:00 pm
Location: London, UK

Post by RandomWelshBloke »

Forgot to mention, the statement i'm trying to find is one to change the rrd_graph_item.cdefid field from 2 to the normal value (or ideed any value)

Random.
RandomWelshBloke
Posts: 33
Joined: Mon Feb 18, 2002 7:00 pm
Location: London, UK

Post by RandomWelshBloke »

Hoping somone has found a simple way to do this... (at the time the graph is created)

Im 1/2 way there...

To change Graph label go into the include/utility_functions.php file and change the value of

Code: Select all

$graph_vertical_label = "Bytes Per Second"; 
to

Code: Select all

$graph_vertical_label = "Bits Per Second";
The bit I am stuck on is changing the default cdef to '2'. Below is mentioned a method of changing the default rrd_graph_item to 2 in MYSQL, but I am unsure of the syntax :-?

Any one know ?

Random.
RandomWelshBloke
Posts: 33
Joined: Mon Feb 18, 2002 7:00 pm
Location: London, UK

Post by RandomWelshBloke »

Found the answer... :oops:

in MySQL

Code: Select all

alter table rrd_graph_item alter column CDEFID set default 2;
Random :wink:
ginny

Change default CDEF

Post by ginny »

I noticed that someone posted a script to change the default CDEF to the CDEF which changes bytes to bits. However, I've created my own CDEF that I would like to use as the default. How do I know what the CDEF ID is? (It was posted here that the CDEF ID for "bytes to bits" was 2.)

Thanks!
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Enter into your CDEF configuration. Look at the URL above. You will notice something like "id=N". N is your ID number.

- bulek
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests