Megamind
Megamind

Reputation: 47

RRD Tool : Add 2 rrd graphs

I have 3 RRD graphs for ipTraffic. I want to add those three RRD graphs as one to display the total ipTraffic graph. Please can someone guide me on this?

Upvotes: 0

Views: 1190

Answers (1)

Steve Shipway
Steve Shipway

Reputation: 4027

If you are using RRDTool directly, and your data are in separate RRD files, then you can still use rrd graph with your DS definitions referring to different RRD files. There is no requirement in RRDTool to have only a single source of data.

rrdtool graph ...
  DEF:a=file1.rrd:ds0:AVERAGE
  DEF:b=file2.rrd:ds0:AVERAGE
  DEF:c=file3.rrd:ds0:AVERAGE
  ...
  LINE:a#ff0000:File_1
  LINE:b#00ff00:File_2
  LINE:c#0000ff:File_3

More documentation and examples exist at the RRDTool website

However, from your context I would guess that you are possibly using MRTG in confunction with RRDTool to collect and display the data? If this is the case, then the only way you can do it without coding is if you are using the Routers2 frontend for MRTG/RRD. In this case, you can use the routers.cgi*Graph directive to define a userdefined graph that displays multiple Targets on the same axis. If your Targets are in separate configuration files, then you can always build a new configuration file that uses Include to include them into a single place before defining the UserDefined graph over the top.

An alternative is if you use rrdcgi, but this will require you to compose the RRDTool commandline by hand, as in the first case.

Upvotes: 2

Related Questions