[mrtg] Script returns 4 values, Plot values via MRTG/routers2?
MMartin at jwpepper.com
MMartin at jwpepper.com
Thu Jan 3 20:31:51 CET 2013
Hey Keith,
No problem, when I started using MRTG a little over a year or so ago, this
mailing-list really helped me work my way through it.
So I'm glad to return the favor...
Anyway, I think all you would need to do is this:
- Options for each of the 4 "Modem Counters" Graph:
*For each of the Modem "Counters" Graphs (*there are 4) you could
use something like this as your
"routers.cgi*Options[...]:" Directive:
DIRECTIVE(s):
1. Options[$target_name]: growright, gauge, noo
2. routers.cgi*Options[$target_name]: fixunit, nototal,
nopercent
*If you need to use ANY of the options on the
"routers.cgi*Options" Line then you need to prefix "Options" with the
"routers.cgi*" prefix. On the cfg file I took
these directives from, I use both of the above lines for a config that
graphs
current/active VPN Sessions. Which is somewhat
similar to yours because it is just a count/number, and not a unit (i.e.
kb, b, etc...)
- "Regular" Options (*from above):
- noo - Here the "noo" is important because we
only want one value to be graphed (i.e. Tells MRTG to not do
the default, which is to graph "In" and
"Out" Values like for a router's interface traffic). So here the "noo"
says "no out" value.
- gauge - The "gauge" option is basically a
"current status" value. Not sure if that's what you want for this, I'm
thinking it probably is though..?
- growright - And I think the "growright" option
is not used anymore (deprecated), but I always include it by habit.
- "Enhanced" Options (*from above, with 'routers.cgi*' ):
- fixunit - This you will probably need as well.
This tells MRTG that this value should not be appended with the
normal "k" or "b/s", etc... since
It's only a number/count.
- nototal - This will remove the "Total" line
calculation from showing on the graph.
- nopercent - This will suppress the calculation
of the percentage of the MaxBytes value for the displayed values.
Without this, a line will be
graphed showing a percentage/ratio of the current value compared to
the "MaxBytes" value.
DIRECTIVE(s):
3. routers.cgi*Graph[$target_name]: All-Counters
*This Directive must be included in ALL 4 of the
"Modem Counters" Graph's Directives. You may include the
"Enhanced" Options on this line as well, after
the new Graph's name (i.e. After "All-Counters" ). But I THINK the
graph will inherit Options From the 4 parent
graphs...
- "Graph" Directive (*from "routers.cgi*Graph[...]:" ):
- "All-Counters" - You can change the name to
whatever you'd like to call it, but just make sure it's the same for all
of them.
- Options for the One UserDefined Graph (*Single Graph containg all 4
counters):
*These options will define the "UserDefined" graph that will
display ALL 4 Targets on a single graph.
- Here is an example from my cfg for Active VPN Sessions on a
VPN Concentrator:
**This will basically be the same for yours because the
values are just regular "numbers/a count" of something...
DIRECTIVE(s):
4. routers.cgi*ShortName[$target_name]: All-Counters
routers.cgi*Description[$target_name]: All Active
VPN-Sessions (Active, Remote-Access, LAN-to-LAN)
routers.cgi*Title[$target_name]: All Modem Counters
routers.cgi*YLegend[$target_name]: Count
routers.cgi*MaxBytes[$target_name]: 100000000 #
---> Or whatever the max is if there is any...?
routers.cgi*UnScaled[$target_name]: dwmy
routers.cgi*WithPeak[$target_name]: dwmy
routers.cgi*Options[$target_name]: nototal
routers.cgi*InSummary[$target_name]: yes
routers.cgi*InCompact[$target_name]: yes
routers.cgi*GraphStyle[$target_name]: range
*This "UserDefined" Graph will also inherit the "Legend1"
values from the other 4 graphs, so you don't have to
specify them here...
Anyway, let me know if that helps... If something there doesn't make sense
just let me know and I'll try to clairfy it...
Thanks,
Matt
From: Keith <kwoody at citytel.net>
To: Steve Shipway <s.shipway at auckland.ac.nz>
Cc: "mrtg at lists.oetiker.ch" <mrtg at lists.oetiker.ch>
Date: 01/02/2013 09:06 PM
Subject: Re: [mrtg] Script returns 4 values, Plot values via
MRTG/routers2?
Sent by: <mrtg-bounces+mmartin=jwpepper.com at lists.oetiker.ch>
On Thu, 3 Jan 2013, Steve Shipway wrote:
|->Matt has it right (and saves me having to make the answer myself!)
|->
|->
|->
|->A few enhancements I could suggest ¨C
Thanks for the extra info Steve. Matt, your config definately did the
trick.
A few minor script probs to work out, but its there. I was on the right
track, but now that I see how its done I understand it.
Though one question, I dont want an average calculated. I just want each
value plotted on the graph as it comes out.
Which Option[] would I use?
Thanks again guys.
Regards,
Keith
_______________________________________________
mrtg mailing list
mrtg at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20130103/6ba370cc/attachment.htm
More information about the mrtg
mailing list