How to create graph with multiple data sources for total BW

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Justler
Posts: 12
Joined: Tue Oct 28, 2003 1:52 pm

How to create graph with multiple data sources for total BW

Post by Justler »

I want to create a single graph for total bandwidth that has each Polling Hosts' Serial 1/0 output Total bandwidth. What is the easiest way to do this? All my data points will be Cisco Routers.
Justler
Posts: 12
Joined: Tue Oct 28, 2003 1:52 pm

Post by Justler »

Someone must have tried this! All I want is Total Bandwidth for each host I am polling in 1 graph represented by different colored lines.
linuxchris
Posts: 5
Joined: Tue Sep 23, 2003 5:52 pm
Location: Tampa, FL
Contact:

Re: How to create graph with multiple data sources for total

Post by linuxchris »

Hey, I just had the same issue (I needed total www and sendmail numbers). What I did was wrote a small (very simple) bash script that queries the information and does that addition (totals the hosts data). I then created a new data input method with the script as the source. It is working great now, if you would like a sample script, let me know.
skt
Posts: 14
Joined: Thu Nov 06, 2003 10:23 am

Post by skt »

Sample script, would be great!
linuxchris
Posts: 5
Joined: Tue Sep 23, 2003 5:52 pm
Location: Tampa, FL
Contact:

Post by linuxchris »

Here is a sample of a www counter to track how many sessions go through our http compression devices. This is a bash shell script for a UNIX/Linux system, if you are using Windows I am not sure how you would go about it... maybe perl.

#!/bin/bash
#
# Script to collect total http web sessions
# Written By: Chris Adams
# Date: 10 December 2003
# For:
#
# Set variables
#
COM=your_snmp_community
GET=/usr/bin/snmpget
CRED1=192.168.1.1
CRED2=192.168.1.2
MRED1=192.168.2.1
MRED2=192.168.2.2
OIDWWW=.1.3.6.1.4.1.6213.2.4.2.1.1.2.1
OIDIMG=.1.3.6.1.4.1.6213.2.4.2.1.1.2.3
#
# Get numbers and add them up
#
TOT1=`$GET -v 2c -c $COM $CRED1 $OIDWWW | cut -f4 -d' '`
TOT2=`$GET -v 2c -c $COM $CRED2 $OIDWWW | cut -f4 -d' '`
TOT3=`$GET -v 2c -c $COM $MRED1 $OIDWWW | cut -f4 -d' '`
TOT4=`$GET -v 2c -c $COM $MRED2 $OIDWWW | cut -f4 -d' '`
TOT=`expr $TOT1 + $TOT2 + $TOT3 + $TOT4`
echo $TOT
Justler
Posts: 12
Joined: Tue Oct 28, 2003 1:52 pm

Post by Justler »

Excellent. I will give this a try and just switch the OIDs to the in/out octets of my cisco routers and put it in my excel report instead of Cacti.

Thanks a lot!
Lux
Cacti User
Posts: 195
Joined: Tue Nov 11, 2003 10:57 am
Location: Luxembourg

Post by Lux »

If I understand your requirements correctly, all that you need to do is create a new graph template based on the total bandwidth graph template. (make a copy of the total bandwidth template and modify that one)

I am doing something similar for my dual attached servers. I am graphing the throughput of each network card on a single graph.

It is fairly simple to set up. After copying the total bandwidth template, open the new template and add a new template item. It should be nearly identical to the traffic in field that already exists. Once you have done that, add a new graph item input and associate that input with the graph item you just created. You will need to do two of these for every interface that you want to graph (in and out traffic).

Save your new template and then go to new graphs. Create a new graph but do not associate it with a data source. Then you simply select the data sources that you want to appear on your graph, save it and view the results.

I know that this isn't very detailed. If you need more information just ask...

Mike
foo
Posts: 26
Joined: Tue Feb 24, 2004 12:06 am

Post by foo »

It seems that cacti doesn't like it when you've got any data sources (created via a template) set to none when creating the graph itself. It bombs out.

For example, for totaling bandwidth of multiple machines, I've created a template with 10 data sources. I then created a graph, and only filled up 5 of the data sources. I set the rest to 'none'. Saved, and rrdtool bombs out. It errors unless I fill up ALL of the data sources.

It would appear 'none' for a datasource is .. useless.

I don't want to have to create templates for 1000 customers with multiple machines..
alexsanderar
Posts: 4
Joined: Wed May 10, 2006 6:55 am

how to graph one entire data line?

Post by alexsanderar »

Hi,
I make a bash script:
./zimcount.sh <server>

output:
zim42:0 zim54:0 zim54qrt:11 zim54rt:0 zim56:1 zim56rt:0 zim71:0 zim711:101 zim811:0

how to put all values on only on graphic? (to compare this values)

tkx
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: how to graph one entire data line?

Post by gandalf »

alexsanderar wrote:Hi,
I make a bash script:
./zimcount.sh <server>

output:
zim42:0 zim54:0 zim54qrt:11 zim54rt:0 zim56:1 zim56rt:0 zim71:0 zim711:101 zim811:0

how to put all values on only on graphic? (to compare this values)

tkx
Before answering this, please clarify: Are those values (zim42, ...) printed always? Or are those "zimXX" values (XX being a variable)? Is the number of output variables constant? See last two links of my signature as a start ...
Reinhard
alexsanderar
Posts: 4
Joined: Wed May 10, 2006 6:55 am

Re: how to graph one entire data line?

Post by alexsanderar »

yes, zimxx always are printed, followed by number of instances of zimxx process.
ex.:
zim42:0 zim54:0 zim54qrt:11 zim54rt:0 zim56:1 zim56rt:0 zim71:0 zim711:101 zim811:0
zim42:3 zim54:0 zim54qrt:31 zim54rt:0 zim56:1 zim56rt:0 zim71:0 zim711:65 zim811:1
zim42:5 zim54:0 zim54qrt:20 zim54rt:0 zim56:7 zim56rt:0 zim71:0 zim711:48 zim811:3
zim42:56 zim54:2 zim54qrt:0 zim54rt:23 zim56:0 zim56rt:0 zim71:0 zim711:0 zim811:10
lvm wrote:
alexsanderar wrote:Hi,
I make a bash script:
./zimcount.sh <server>

output:
zim42:0 zim54:0 zim54qrt:11 zim54rt:0 zim56:1 zim56rt:0 zim71:0 zim711:101 zim811:0

how to put all values on only on graphic? (to compare this values)

tkx
Before answering this, please clarify: Are those values (zim42, ...) printed always? Or are those "zimXX" values (XX being a variable)? Is the number of output variables constant? See last two links of my signature as a start ...
Reinhard
alexsanderar
Posts: 4
Joined: Wed May 10, 2006 6:55 am

Re: how to graph one entire data line?

Post by alexsanderar »

bingo!
tkx a lot for your "how to".
now it works!
alexsanderar wrote:yes, zimxx always are printed, followed by number of instances of zimxx process.
ex.:
zim42:0 zim54:0 zim54qrt:11 zim54rt:0 zim56:1 zim56rt:0 zim71:0 zim711:101 zim811:0
zim42:3 zim54:0 zim54qrt:31 zim54rt:0 zim56:1 zim56rt:0 zim71:0 zim711:65 zim811:1
zim42:5 zim54:0 zim54qrt:20 zim54rt:0 zim56:7 zim56rt:0 zim71:0 zim711:48 zim811:3
zim42:56 zim54:2 zim54qrt:0 zim54rt:23 zim56:0 zim56rt:0 zim71:0 zim711:0 zim811:10
lvm wrote:
alexsanderar wrote:Hi,
I make a bash script:
./zimcount.sh <server>

output:
zim42:0 zim54:0 zim54qrt:11 zim54rt:0 zim56:1 zim56rt:0 zim71:0 zim711:101 zim811:0

how to put all values on only on graphic? (to compare this values)

tkx
Before answering this, please clarify: Are those values (zim42, ...) printed always? Or are those "zimXX" values (XX being a variable)? Is the number of output variables constant? See last two links of my signature as a start ...
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please see docs at http://www.cacti.net/downloads/docs/htm ... PUT_METHOD. Perhaps the second to last link of my signature may help as well (but pay attention: the example uses a script with a single output only. But the extension to more than one output should be clear from the cacti docs)
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests