[mrtg] How to add values of two OID in MRTG

Steve Shipway s.shipway at auckland.ac.nz
Fri Jul 3 00:11:19 CEST 2009

Two possible ways.

1. Define a Target which does the calculation:
Target[xxxx]: oid1&oid1:comm at device + oid2&oud2:comm at device
This will give you a Target graph showing the total of the two OIDs
See the MRTG documentation on www.mrtg.org<http://www.mrtg.org> for more details about calculations in the Target definition.

2. If you are using RRDTool as your backend, you can use the Routers2 frontend and then define a Userdefined summary graph over the two separate Targets, and have the graphs stacked.
routers.cgi*Graph[maths]: allmarks total
routers.cgi*Graph[science]: allmarks total
routers.cgi*GraphStyle[allmarks]: stack
See http://www.steveshipway.org/cgi-bin/routers2.pl for an example of this frontend (look at the Linux system CPU graphs)

Number (2) looks prettiest and lets you see the individual components, but (1) is simpler if you don't have Routers2/RRD installed yet.


From: mrtg-bounces at lists.oetiker.ch [mrtg-bounces at lists.oetiker.ch] On Behalf Of Gayan S. Amarasiri [Gayan.Amarasiri at dialog.lk]
Sent: Thursday, 2 July 2009 10:42 p.m.

I need to add two parameters and show it in graph using MRTG. For example let say the OID gives Mathematics marks and the OID gives the Science marks. I need to draw a graph for the total marks which is the addition of the vales of the above OIDs. How to do these type of stuff? Appreciate your help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20090703/c64b5661/attachment.html 

More information about the mrtg mailing list