how to add multi-hosts in one graph?

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

Moderators: Developers, Moderators

joecen
Posts: 15
Joined: Wed Mar 02, 2005 10:40 am

how to add multi-hosts in one graph?

Post by joecen »

I use cacti to monitor interface traffic. There are five hosts in my LAN, and I wanna create one graph with all the a/m traffic.
what would I do?

thx.
Joe
3rd_edition
Posts: 5
Joined: Tue Mar 08, 2005 9:37 am

Re: how to add multi-hosts in one graph?

Post by 3rd_edition »

Hi, i'm also very intrested in the sollution.
In some old posts they keep referring to the cacti manual, section '8.3 combining graph traffic' but i think that part was removed or something. Because i'm not able to find it.
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

you just have to create a new graph with "None" as host. You'll then be able to choose any data source from any host.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
3rd_edition
Posts: 5
Joined: Tue Mar 08, 2005 9:37 am

Post by 3rd_edition »

Hi thanks for your response, however i can't get it to work, this is what i tried:
menu: create->New Graphs
(i can't select host 'none' so i'll have to define a new dummy host?)
then i still dont know how to combine the data from multiple hosts in one graph.
(maybe you can point me to a page in the manual i've overlooked?)

thanks again for taking the time to answer :)
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Try to go through Management -> Graph Management -> Add

You can then choose a graph template & a host.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
3rd_edition
Posts: 5
Joined: Tue Mar 08, 2005 9:37 am

Post by 3rd_edition »

fmangeant thanks for taking the time, but i isn't your answer just telling me how to add a graphtemplate to a host? Because that's what i'll get when following your instructions.

My problem is that i can't figure out how to make _one_ graph from the traffic of multiple hosts combined (added up) into _one_ picture.

Is it possible that cacti doesn't have this functionallity and i should solve this problem another way?

thanks
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

3rd_edition wrote:My problem is that i can't figure out how to make _one_ graph from the traffic of multiple hosts combined (added up) into _one_ picture.

Is it possible that cacti doesn't have this functionallity and i should solve this problem another way?
Sorry, I didn't understand your question. You'll have to write a graph template to do this.

Here's an example, with 2 network lines on the same graph :

Image

I'll try do a graph template with 4 network lines (in and out) on the same graph and post it here.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
joecen
Posts: 15
Joined: Wed Mar 02, 2005 10:40 am

Post by joecen »

I wanna ceate a graph like this:

Code: Select all

/opt/rrdtool/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="SUM for squid (xxx.xxx.com)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
DEF:a1="/opt/cacti/httpd/htdocs/cacti/rra/squid15_traffic_in_31.rrd":traffic_in:AVERAGE \
DEF:b1="/opt/cacti/httpd/htdocs/cacti/rra/squid15_traffic_in_31.rrd":traffic_out:AVERAGE \
DEF:a2="/opt/cacti/httpd/htdocs/cacti/rra/squid16_traffic_in_44.rrd":traffic_in:AVERAGE \
DEF:b2="/opt/cacti/httpd/htdocs/cacti/rra/squid16_traffic_in_44.rrd":traffic_out:AVERAGE \
DEF:a3="/opt/cacti/httpd/htdocs/cacti/rra/squid17_traffic_in_46.rrd":traffic_in:AVERAGE \
DEF:b3="/opt/cacti/httpd/htdocs/cacti/rra/squid17_traffic_in_46.rrd":traffic_out:AVERAGE \
DEF:a4="/opt/cacti/httpd/htdocs/cacti/rra/squid18_traffic_in_45.rrd":traffic_in:AVERAGE \
DEF:b4="/opt/cacti/httpd/htdocs/cacti/rra/squid18_traffic_in_45.rrd":traffic_out:AVERAGE \
DEF:a5="/opt/cacti/httpd/htdocs/cacti/rra/squid14_traffic_in_17.rrd":traffic_in:AVERAGE \
DEF:b5="/opt/cacti/httpd/htdocs/cacti/rra/squid14_traffic_in_17.rrd":traffic_out:AVERAGE \
CDEF:cdefa=8,a1,a2,a3,a4,a5,+,+,+,+,* \
CDEF:cdefe=8,b1,b2,b3,b4,b5,+,+,+,+,* \
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\n"  \
LINE1:cdefe#002A97:"Outbound"  \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s" 
but I dont know how to add multiple "DEF" by cacti.
Last edited by joecen on Wed Mar 09, 2005 10:57 am, edited 1 time in total.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

You have to create you own graph, but to get multiple hosts, you do not select a host when creating a new graph.

Click on Console -> Graph Management, then click on Add in the upper right hand corner.

Select None and None for Selected Graph Template and Host. Click create.

Then set your max value and graph title... Click create.

Now you can start adding graph items.

You should see all data sources for all hosts. Then you can add any of them you like.

Other questions, please read the documentation.. :) Then post or send me an email.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
3rd_edition
Posts: 5
Joined: Tue Mar 08, 2005 9:37 am

Post by 3rd_edition »

fmangeant wrote:
3rd_edition wrote:My problem is that i can't figure out how to make _one_ graph from the traffic of multiple hosts combined (added up) into _one_ picture.

Is it possible that cacti doesn't have this functionallity and i should solve this problem another way?
Sorry, I didn't understand your question. You'll have to write a graph template to do this.

Here's an example, with 2 network lines on the same graph :

Image

I'll try do a graph template with 4 network lines (in and out) on the same graph and post it here.
That would be great, i'd like that very much.
(is it perhaps possible to create a graph template that can handle a variable numbers of sources to combine (instead of 4))

and again thanks
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

A graph template is not the right approach for this.

Because you want to include traffic from different hosts on the same graph. Graph templates are tied to hosts. To get what you are looking for, you will each have to create you own manual graphs to include the Data sources that you want from the hosts that you desire.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
joecen
Posts: 15
Joined: Wed Mar 02, 2005 10:40 am

Post by joecen »

rony,thanks! :D
Enforcer
Posts: 10
Joined: Thu Apr 08, 2004 1:06 pm

Post by Enforcer »

I should do a RTFM i know but i just give it a shot if you think that’s wrong just awnser with RTFM.

Here i go.

I want do to nearly the same but my problem is that i dont want multiple graphs from different hosts in a graph but i want to take the sum of some data sources and graph them.

Example you have 4 ports of a switch you want to do traffic stats but not each for himself but only one graph with the sum of the traffic over all.

Meanwhile im hoping for a guru i will do some rtfm of rrd ;-)

Thx
Daniel
Enforcer
Posts: 10
Joined: Thu Apr 08, 2004 1:06 pm

Post by Enforcer »

wow maybe its really easy with "total all data sources" let me see if that do the trick ..
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

:lol:
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest