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

Gayan S. Amarasiri Gayan.Amarasiri at dialog.lk
Fri Jul 3 11:23:04 CEST 2009

```Thanks Steve. It is working. Now I need to plot a rate of change of values given by a OID. Let say on OID gives a counter value. I need to get the rate of change in this OID values. How can I do this?

From: Steve Shipway [mailto:s.shipway at auckland.ac.nz]
Sent: Friday, July 03, 2009 3:41 AM
To: Gayan S. Amarasiri; mrtg at lists.oetiker.ch
Subject: RE: How to add values of two OID in MRTG

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.

Steve

________________________________
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 1.3.4.5.26.626.26.26.0 gives Mathematics marks and the OID 1.3.4.5.26.626.26.27.0 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/a8f7a753/attachment.html
```