multiple data sources

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

Moderators: Developers, Moderators

Post Reply
jmroth
Cacti User
Posts: 60
Joined: Sun Jan 20, 2002 7:00 pm

Post by jmroth »

Hi,
I don't know if I understood this right but since 0.6.6 I can have a script spitting out several lines as a result and I can put that data rightaway into cacti, right?
Before I always had several scripts.

Example: Before:
bw-in.sh outputs 170898
bw-out.sh output 19283746

Now:
bw.sh outputs
170898
19283746
(in 2 lines)

Now, I've tried this and it doesn't work. Anything special I need to do?
ross
Posts: 16
Joined: Sun Mar 17, 2002 7:00 pm

Post by ross »

all data should be on one line

out put should be like:
170898 19283746
then in your data input for the input sources use <in> <out> in output string feild.

good luck

<font size=-1>[ This Message was edited by: ross on 2002-03-19 14:42 ]</font>
ross
Posts: 16
Joined: Sun Mar 17, 2002 7:00 pm

Post by ross »

also, i want to see the bw-in.sh script you got, just wonder how you are gathering your bandwidth..

ross
jmroth
Cacti User
Posts: 60
Joined: Sun Jan 20, 2002 7:00 pm

Post by jmroth »

Ok, here's the bw-ip.sh
#!/bin/bash
echo `sudo /sbin/iptables -xnvL $2 | grep $1 | awk {'print $2'}`

a call like
bw-ip.sh 127.0.0.1 INPUT
gives you the result

iptables should contain a rule like this in the INPUT chain
411K 40M all -- any any anywhere 127.0.0.1

The only thing I don't like is sudo. If I sudo iptables from nobody to root anybody could theoretically compromise the firewall rules...
ross
Posts: 16
Joined: Sun Mar 17, 2002 7:00 pm

Post by ross »

yea that is a bit insecure...
i have been trying to find a way to get the bandwidth of the localhost for a while.

any other idea's ?

ross
jmroth
Cacti User
Posts: 60
Joined: Sun Jan 20, 2002 7:00 pm

Post by jmroth »

perhaps snmp
but i have no idea how to get iptables values to cacti via snmp...
if there's an snmp pro here, reveal thyself
jmroth
Cacti User
Posts: 60
Joined: Sun Jan 20, 2002 7:00 pm

Post by jmroth »

Very well
I made it to the graphs
THe source looks right
DEF:a="/i1/data/web/FV/iip/admin/acc/rra/iip_bw_16.rrd":iip_bw_16:AVERAGE
AREA:a#3D168B:"ip16 input: 116582933"
STACK:a#EACC00:"ip16 output: 714227845
It even outputs these numbers correctly in the graph's text line
But the graph itself displays nothing
What's the trick?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest