[rrd-users] Seg faults again
Eidmark, Andre
andre.eidmark at upc.no
Fri Mar 16 09:51:04 MET 2001
Hi,
I'm trying to make a graph, easy enough you say but no....
I'll just paste parts of the script here, and maybe someone sees an error
somewhere in it, or maybe not.. Either way i'd appreciate feedback, as i'm
not sure if it is my script, or if something has gone wrong during compile.
I run rrdtool 1.0.28 on a Red Hat 7.0 system.
proc rrdUpdate { hostname active } {
global rrddir
set rrdfile "$rrddir/$hostname.active.rrd"
# create rrdfile if not yet existent
if {[file exists $rrdfile] == 0} {
Rrd::create $rrdfile --step 30 \
DS:intMactive:GAUGE:1000:0:64000 \
RRA:AVERAGE:0.5:1:86000 \
RRA:MIN:0.5:24:720 \
RRA:MAX:0.5:24:720 \
RRA:AVERAGE:0.5:24:720
}
Rrd::update $rrdfile --template intMactive N:$active
}
set pngfile "$wwwdir/$hostname.active.day.png"
set rrdfile "$rrddir/$hostname.active.rrd"
Rrd::graph $pngfile --title "Active modems in the last 24H on
($hostname)" \
--height 256 --width 480 --start -86400 \
DEF:mactive=$rrdfile:intMactive:AVERAGE \
AREA:mactive#0000FF:mactive \
DEF:valuemactive=$rrdfile:intMactive:AVERAGE \
GPRINT:mactive:MIN:Min: \
GPRINT:mactive:MIN:%6.2lf \
GPRINT:mactive:AVERAGE:Average: \
GPRINT:mactive:AVERAGE:%6.2lf \
GPRINT:mactive:MAX:Max: \
GPRINT:mactive:MAX:%6.2lf
the graph-making here goes well, but if i add a
HRULE:375#0000FF:"sometexthere" \
i get a segmentation fault.. another example..
proc rrdUpdate { hostname traffic_up traffic_down } {
global rrddir
set rrdfile "$rrddir/h1c1.traffic.rrd"
# create rrdfile if not yet existent
if {[file exists $rrdfile] == 0} {
exec rrdtool create $rrdfile --step 60 \
DS:intTrafficUp:COUNTER:1000:0:64000
DS:intTrafficDown:COUNTER:1000:0:64000 \
RRA:AVERAGE:0.5:1:86000 RRA:MIN:0.5:24:720 RRA:MAX:0.5:24:720 \
RRA:AVERAGE:0.5:24:720
}
Rrd::update $rrdfile --template intTrafficUp:intTrafficDown
N:$traffic_up:$traffic_down
}
proc wwwUpdate { hostname } {
global rrddir
global wwwdir
set rrdfile "$rrddir/h1c1.traffic.rrd"
set pngfile "$wwwdir/h1c1.traffic.png"
Rrd::graph $pngfile --title "Bandwidth usage last 24H ($hostname)" \
--height 256 --width 480 --start -86400 \
DEF:trafficUp=$rrdfile:intTrafficUp:AVERAGE \
DEF:trafficDown=$rrdfile:intTrafficDown:AVERAGE \
CDEF:realup=trafficUp,402653184,/ \
CDEF:realdw=trafficUp,402653184,/ \
AREA:realup#0000FF:Upstream \
LINE1:realup:MAX:Max: \
GPRINT:realup:MAX:%6.2lf" \
LINE2:realdw#00C000:Downstream \
GPRINT:realdw:MAX:Max: \
GPRINT:realdw:MAX:%6.2lf"
}
This graph-making also generates a seg. fault, but if i remove the "CDEF's"
it's ok. The point here is to graph incoming and outgoing kbit/sec. I
collect data via snmp-mibs, and this mib is for "in/out cells".
I'm also wondering if this i do here is at all possible, or if the
db-structure prevents this.. maybe it's better to do the math on the
measurement before i enter it into the db??
Any help is appreciated..
Cheers Andre
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the rrd-users
mailing list