Cheshire Cat Computing

Software support and information
It is currently Thu Jul 31, 2014 12:05 am

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Adding graphs together ?
PostPosted: Wed Nov 15, 2006 12:17 pm 
Offline
Silver User

Joined: Tue May 31, 2005 1:42 pm
Posts: 12
Hi guys..

Ive been using routers2cgi for many years now and all has been quite happy..

Ive got a situation at teh moment though where i need to add a number graphs together to display one 'total' graph..

a bit like using the 'incoming' and 'outgoing' graphs but instead of showing them individually per device, to total them together based on the category they're in.. and display both total incoming and outgoing on one graph..

for example.. i have 20 interfaces in 1 x .cfg file (so i dont have to include nultiple cfgs).. and i want to 'add' them all up to create 1 x graph with total incoming and outgoing on a graph..

does that make sense..

possible ?
Steve


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Wed Nov 15, 2006 3:29 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 2955
Location: Auckland, New Zealand
Yes, possible. You need to make a userdefined graph.

You can make the sub-graphs either as normal lines (like in the incoming graph) or as stacked areas. Then, you can optionally add a total line, and/or an Average line.

For an example, see the demo routers2 system on this website, and look at the CPU graph for the linux server. This is 3 stacked sub-graphs. You can also see the .cfg file used to generate it here.
http://www.steveshipway.org/cgi-bin/routers2.pl?rtr=hosts%2Fhost-a.cfg&xgtype=d&if=_CPU

Read the doc/HOWTO for details, but the directive you need is

routers.cgi*Graph[subtarget]: summaryname withtotal

for each subtarget, and then

routers.cgi*GraphStyle[summaryname]: stack

if you want it stacked. Many other options are available as well. If you don't have noo or noi set, then it totals both incoming and outgoing. You may also want nodetails set, if you are only interest in the final total and not the legends for the sub-lines. If you have v2.17b2 or later, you can use the 'nolines' option to hide the sub-lines entirely.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 11:57 am 
Offline
Silver User

Joined: Tue May 31, 2005 1:42 pm
Posts: 12
Thanks for that Steve..

I am running routers2 v.2.16beta6
FreeBSD v5.4-STABLE #1
rrdtool-1.2.12_1


I have implemented it to the best of my understanding, which in summary is:

Edit the existing .cfg file and added the following lines to the end of each item:
Code:
routers.cgi*Options[192.168.1.2_1]: fixunit nopercent nomax
routers.cgi*Icon[192.168.1.2_1]: mail-sm.gif
routers.cgi*InCompact[192.168.1.2_1]: yes
routers.cgi*Graph[192.168.1.2_1]: LINETOTAL total

<snip>
Code:
routers.cgi*Options[192.168.1.3_1]: fixunit nopercent nomax
routers.cgi*Icon[192.168.1.3_1]: mail-sm.gif
routers.cgi*InCompact[192.168.1.3_1]: yes
routers.cgi*Graph[192.168.1.3_1]: LINETOTAL total

<snip>

then.. at the end of that same .cfg file i added..

Code:
routers.cgi*GraphStyle[LINETOTAL]: stack
routers.cgi*Description[LINETOTAL]: Total Bandwidth Used
routers.cgi*ShortDesc[LINETOTAL]: Summary of Links


Which seems correct to me.. (Please correct me if i have misunderstood anything)..

now when i go to that target.. i get the 'Summary of Links' on the right menu..
but if i click it.. i get :

Code:
RRD Error: Garbage ':\l' after command: COMMENT:Traffic Analysis for Port 1:\l

You can visit the configuration verification page here.

RRD: /home/mrtg/switch4/192.168.1.2_1.rrd
Device: [Switch4.cfg] Switch4
Interface: _LINETOTAL
Interfaces: 192.168.1.2_1,192.168.1.3_1,192.168.1.157_1,192.168.1.115_1,
192.168.1.241_1,192.168.1.102_1,192.168.1.100_1,192.168.1.114_1,
192.168.1.118_1,192.168.1.105_1,192.168.1.99_1,192.168.1.109_1,
192.168.1.129_1,192.168.1.98_1,192.168.1.108_1,192.168.1.141_1,
192.168.1.149_1,192.168.1.137_1,192.168.1.101_1,192.168.1.116_1,
192.168.1.113_3,_incoming,192.168.1.117_1,192.168.1.153_1,
192.168.1.2_1,192.168.1.111_1,_outgoing,_summary_,192.168.1.249_1,
_LINETOTAL,192.168.1.103_1,192.168.1.209_12,192.168.1.110_1
Params: /home/mrtg/graphs/Switch4.cfg-_LINETOTAL-d-l2.png -nd-2000m -u 1 -w 530 -h 200 --x-grid HOUR:1:HOUR:24:HOUR:2:0:%k --title Total <snip>


what is wrong ?? i thought initially that the rrdfile for that interface was faulty.. so i remarked out the routers.cgi* commands for that interface.. and only had the others.. same error.. it just moved..

ideas ?

Steve


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 1:30 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 2955
Location: Auckland, New Zealand
This is a bug in 2.16b6 that was later corrected (the risks of using a beta version!). Upgrade to 2.16, or else to the latest 2.17 beta. Thanks for letting me know your routers2 version which helped immediately identify the issue (this version had not escaped the : in the comment which became necessary for supporting RRD 1.2)

Your directives look correct to me, and it should work.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group