How to create graph with multiple data sources for total BW
Moderators: Developers, Moderators
How to create graph with multiple data sources for total BW
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.
-
- 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
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.
-
- Posts: 5
- Joined: Tue Sep 23, 2003 5:52 pm
- Location: Tampa, FL
- Contact:
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
#!/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
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
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
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..
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..
-
- Posts: 4
- Joined: Wed May 10, 2006 6:55 am
how to graph one entire data line?
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
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
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: how to graph one entire data line?
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 ...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
Reinhard
-
- Posts: 4
- Joined: Wed May 10, 2006 6:55 am
Re: how to graph one entire data line?
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
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: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 ...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
Reinhard
-
- Posts: 4
- Joined: Wed May 10, 2006 6:55 am
Re: how to graph one entire data line?
bingo!
tkx a lot for your "how to".
now it works!
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: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 ...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
Reinhard
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
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
Reinhard
Who is online
Users browsing this forum: No registered users and 1 guest