Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


[HOWTO] How can I make SUM of graphs
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's
Author Message
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Sun Sep 14, 2003 6:08 pm    Post subject: Reply with quote

atrocity wrote:
ehm, excuse my stupid question, but this summation, is it IN the graphs ?
If yes, then it's ok ... it's working.
But what i really want, is the possibility to put tables, with the summary of the trafic in numbers...
I have a nice PHP script, that can summarize the trafic. You can choose to see the results for a period of days, or for a whole mounth, also a year if you collected the data... Really, i will appreciate if something like that can be done in Cacti, because actually i continue to use MRTG, only for that feature ....
I will be more then happy to share this script, if someone think that it can be used / converted to and for Cacti
Jean


I actually wrote a very similar feature for an ISP/colo that I was doing some work for. It is a pretty cool idea; my biggest concern is where to put it in the UI I could write an option whether to turn it on or off depending on how many users would benefit from such a feature. Thoughts?

-Ian
Back to top
atrocity



Joined: 26 Aug 2003
Posts: 18

PostPosted: Sun Sep 14, 2003 6:14 pm    Post subject: Reply with quote

It can be simply under the detailed graph pages, no ?
Or, if it's possible, create a brand new feature in cacti....
Can you send me that script, to compare it with my one ?
Thanks
Jean
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Sun Sep 14, 2003 6:18 pm    Post subject: Reply with quote

Yeah, that's definitely one place it could go. I would send you the work I did previously, but it is not an isolated script and fairly tied into Cacti itself. What I did for them was basically create a table that gave GB transfered for each month for each user that logged in.

-Ian
Back to top
atrocity



Joined: 26 Aug 2003
Posts: 18

PostPosted: Sun Sep 14, 2003 6:33 pm    Post subject: Reply with quote

I think that if there are 2 tables, under the detailed graphs pages, it can be enough.... Something like :

Current mounth traffic : xyz Gb total
(then the last mounths like)
08 : xyz Gb total
07 : xyz Gb total
06 : xyz Gb total
05 : xyz Gb total
04 : xyz Gb total
03 : xyz Gb total
02 : xyz Gb total
01 : xyz Gb total

But, like that, it's not really easy to manage...
Will it not be a better idea, to make a new link appear in the detailed graphs, going to a page with a form, and the user can chose what he want to see ?
Like that, you can put the 'Current mounth traffic'
Jean
Back to top
atrocity



Joined: 26 Aug 2003
Posts: 18

PostPosted: Sun Sep 14, 2003 6:35 pm    Post subject: Reply with quote

Currently, i'm only interested to see this stats for each of the switch ports that i monitor... But feel free to extend it
Jean
Back to top
mike_tcis



Joined: 17 Jul 2002
Posts: 12
Location: Tulsa, OK

PostPosted: Thu Sep 25, 2003 9:51 pm    Post subject: Reply with quote

raX wrote:
Yeah, that's definitely one place it could go. I would send you the work I did previously, but it is not an isolated script and fairly tied into Cacti itself. What I did for them was basically create a table that gave GB transfered for each month for each user that logged in.

-Ian


Yea, something like that would be very useful. Right now, the summation feature works fine on the graphs themselves, but I'm still forced to use MRTS to get traffic sum data for specific time periods, e.g. per day, week, month, with the ability to go back several months.

--Mike
Back to top
skt



Joined: 06 Nov 2003
Posts: 14

PostPosted: Thu Nov 20, 2003 9:12 am    Post subject: XLM File Reply with quote

Anyone have an XML file for doing the graph sums. Just upgraded to 0.8.4 and would like to inport this feature.

Thanks!
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Fri Nov 21, 2003 12:37 am    Post subject: Reply with quote

I attached the total bandwidth in bits and bytes that comes with new versions of Cacti.

-Ian



cacti_graph_template_interface_traffic_bytessec_total_bandwidth.xml
 Description:
Interface - Traffic (bytes/sec, Total Bandwidth)

Download
 Filename:  cacti_graph_template_interface_traffic_bytessec_total_bandwidth.xml
 Filesize:  13.79 KB
 Downloaded:  618 Time(s)


cacti_graph_template_interface_traffic_bitssec_total_bandwidth.xml
 Description:
Interface - Traffic (bits/sec, Total Bandwidth)

Download
 Filename:  cacti_graph_template_interface_traffic_bitssec_total_bandwidth.xml
 Filesize:  14.77 KB
 Downloaded:  585 Time(s)

Back to top
egarnel
Cacti Pro User


Joined: 21 Nov 2002
Posts: 630
Location: Austin, TX

PostPosted: Fri Nov 21, 2003 9:05 am    Post subject: trying out the new templates Reply with quote

I imported the new templates into Cacti (.084 from upgrade) and selected 1 interface from a polling host as a test using the bits_sec_total template.

I can see the top level graph fine. It appears to be working correctly. I do not get graphs when I drill down on the graph in question.
Given the fact that the top level graph works, am I just being impatient and the other graphs will show up in a while?

Here is the source:
ERROR: no rrdtool fetch output, you probably forgot to pass a valid data source
ERROR: no rrdtool fetch output, you probably forgot to pass a valid data source

/usr/local/rrdtool/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--title="Monitor2 BigBrother/Nedi Server - Traffic - 172.20.1.204 (eth1)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
DEF:a="/usr/local/cacti/rra/monitor2_bigbrothernmis_server_traffic_in_952.rrd":traffic_in:AVERAGE \
DEF:b="/usr/local/cacti/rra/monitor2_bigbrothernmis_server_traffic_in_952.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdeff=b,8,* \
CDEF:cdefi=a,8,* \
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total In: 0 bytes\n" \
LINE1:cdeff#002A97:"Outbound" \
GPRINT:cdeff:LAST:"Current\:%8.2lf %s" \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefi:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total Out: 0 bytes"
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Wed Nov 26, 2003 3:55 pm    Post subject: Re: trying out the new templates Reply with quote

egarnel wrote:
Here is the source:
ERROR: no rrdtool fetch output, you probably forgot to pass a valid data source
ERROR: no rrdtool fetch output, you probably forgot to pass a valid data source


If you see this error, it probably means that your RRD file does not exist. Double check to make sure you have a file at /usr/local/cacti/rra/monitor2_bigbrothernmis_server_traffic_in_952.rrd.

-Ian
Back to top
egarnel
Cacti Pro User


Joined: 21 Nov 2002
Posts: 630
Location: Austin, TX

PostPosted: Mon Dec 01, 2003 8:35 am    Post subject: Files present Reply with quote

The file does indeed exist. The weird thing is that the top level graph shows up and seems to be accurate. This is on a box that has been upgraded to 0.8.4 and has had the modification previously mentioned in this thread.
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Tue Dec 02, 2003 12:30 am    Post subject: Reply with quote

Typically when the graph looks fine at the top level, but not in detail, it indicates a problem with the graph legend. When a graph is drawn as a top level graph, Cacti doesn't even bother with the graph legend code. Since your bandwidth summation items are both COMMENT types, they both reside on the legend.

In the spirit of debugging, try replacing your 'lib/rrd.php' file with the following:

http://www.raxnet.net/downloads/patches/2003-12-01/rrd.php.txt

Then show me what you get after clicking "view source" for the broken summation graph.

-Ian
Back to top
egarnel
Cacti Pro User


Joined: 21 Nov 2002
Posts: 630
Location: Austin, TX

PostPosted: Tue Dec 02, 2003 9:10 am    Post subject: results of debug Reply with quote

FETCH ARRAY:

ERROR: no rrdtool fetch output, you probably forgot to pass a valid data source
FETCH ARRAY:

ERROR: no rrdtool fetch output, you probably forgot to pass a valid data source

/usr/local/rrdtool/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--title="Monitor2 BigBrother/Nedi Server - Traffic - 172.20.1.204 (eth1)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
DEF:a="/usr/local/cacti/rra/monitor2_bigbrothernmis_server_traffic_in_952.rrd":traffic_in:AVERAGE \
DEF:b="/usr/local/cacti/rra/monitor2_bigbrothernmis_server_traffic_in_952.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdeff=b,8,* \
CDEF:cdefi=a,8,* \
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total In: 0 bytes\n" \
LINE1:cdeff#002A97:"Outbound" \
GPRINT:cdeff:LAST:"Current\:%8.2lf %s" \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefi:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total Out: 0 bytes"
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Thu Dec 04, 2003 5:20 pm    Post subject: Reply with quote

I have a feeling that your problem is a result of not having a data source selected for the two COMMENT graph items.

Go to "Graph Templates" and select "Interface - Traffic (bits/sec, Total Bandwidth)". Click "Inbound Data Source", make sure that item #5 is selected, and click "Save". Now click "Outbound Data Source", make sure that item #10 is selected, and click "Save".

Let me know if this helps.

-Ian
Back to top
sini
Cacti User


Joined: 24 Nov 2003
Posts: 55
Location: Hungary

PostPosted: Fri Dec 12, 2003 7:20 am    Post subject: graph summ Reply with quote

Hi,

On graph summation I mean the throughput summation.
Imagine that you buy internet from two different ISP and want to monitor the
sum of its in/out traffic to see what the max peak of it.

A tried to operate with CDEF creating a CDEF grap1+grap2-in/out:(cdef=current_data_source,current_data_source,+) but not worked...
Finally I done manually but I can't print out the summ of current/aver/max
values with gprint although the graph lines are in correct places showing the
sum of values.
I attached a graph to see the result.

Q:Is there a template for it?



graph_sum.png
 Description:
 Filesize:  9.89 KB
 Viewed:  9522 Time(s)

graph_sum.png


Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 



Powered by phpBB © 2001, 2005 phpBB Group