<%init>

# # # # # # # # # # # # # # # # # # # # # # # # # #
#                     N  O  T  E                  #
# =============================================== #
# The "filebase" directive in this file is not    #
# being used in this version.  You can safely     #
# ignore this setting for now.                    #
# # # # # # # # # # # # # # # # # # # # # # # # # #

     my @images = ( 

	##
	## Definition 0 - Hazzard in/out
	##
	{
	targets => [	# here, we define thar targets that we will
			# be graphing. 
                {       label  => "outbound traffic",
                        file   => "hazzard-outbytes.rrd",
                        target => "outbytes",
                        color  => "888888",
                        type   => "LINE2",
                },
		{
			label  => "inbound traffic",
			file   => "hazzard-inbytes.rrd",
			target => "inbytes",
			color  => "ff0000",
			type   => "AREA",
		},
	],
	
	# here, we set some options that define aspects of the graph 
	options => {
			# not currently used	
			filebase       => "/etc/bronc/rrd_files", 

			# Title to appear at the top of the graph
			title          => "Bike World Cisco 1402 DSL Traffic",

			# Label to put along the y-axis
			vertical_label => "Bytes / sec",

			# Width of the area inside the plot, not
			# the image as a whole
			graph_width    => "500",

			# Height of the area inside the plot, not
			# the image as a whole
			graph_height   => "200",

			# create interlaced PNGs? nah, they load too slow.
			interlaced     => "off",

			# if you want a logarithmic y-axis scale
			logarithmic    => "off",

			# The default start time of the graph in seconds.
			# -86400 will graph everything that happened in
			# the last 24 hours.
			start          => "-86400",

			# composite defs are RPN expressions used to do
			# math on the targets.  Please see the RRDtool
			# CDEF and RPN tutorials for more info.
			composite_defs => {
				realin  => "inbytes,1000,/",
				realout => "outbytes,1000,/",
			},

			# The legend is the text at the bottom of the graph
			legend         => [
				# these should be self-explanatory.  if they
				# aren't, look at the demo page
				{  target  => "realin",  # realin, from the 
							 # composite def...

				   formula => "LAST",    # the last value read

				   # read the rrdcreate manpage for details
				   # on the formatting of this string...
				   text    => "Current Inbound Kbytes/sec\\: %.3lf \\r",
				},
				{  target  => "realout",
                                   formula => "LAST",
                                   text    => "Current Outbound Kbytes/sec\\: %.3lf \\r",
                                },

			],
				
		},               # don't forget those commas!
        },

	##
	## END DEFINITION 0
	##


	## In this next definition (definition 1), we define the
	## targets to be "HIDDEN", which means that Bronc will not
	## attempt to graph them.  Then we go on to specify some
	## composite targets.  These composite targets (defined in
	## the composite_defs section) are generated using the
	## targets pulled from the RRD file.  In the composite_defs
	## section, we do some RPN math (see the RRDtool RPN tutorial
	## for more info) on them.  These composite targets are then
	## graphed using the LINE1 pen style (ie. they are visible).


        ##
        ## Definition 1 - stp.bikeworld.net in/out Kbits/sec
        ##
        {
        targets => [
                {       label  => "outbound fxp0 traffic",
                        file   => "stp-fxp0-outbytes.rrd",
                        target => "outbytes",
                        color  => "518e51",
                        type   => "HIDDEN",
                },
                {
                        label  => "inbound fxp0 traffic",
                        file   => "stp-fxp0-inbytes.rrd",
                        target => "inbytes",
                        color  => "ff0000",
                        type   => "HIDDEN",
                },
                {       label  => "outbound fxp0 traffic",
                        file   => "COMPOSITE",
                        target => "realout",
                        color  => "518e51",
                        type   => "LINE1",
                },
                {
                        label  => "inbound fxp0 traffic",
                        file   => "COMPOSITE",
                        target => "realin",
                        color  => "ff0000",
                        type   => "LINE1",
                },
        ],

        options => {    filebase       => "/etc/bronc/rrd_files",
                        title          => "stp.bikeworld.net Ethernet Traffic",
                        vertical_label => "Kbits / sec",
                        graph_width    => "500",
                        graph_height   => "200",
                        interlaced     => "off",
                        logarithmic    => "off",
                        start          => "-86400",
                        composite_defs => {
				# divide inbytes by 1000, then
				# multiply by 8, to get Kbits
                                realin  => "inbytes,1000,/,8,*",
                                # divide outbytes by 1000, then
                                # multiply by 8 to get Kbits
                                realout => "outbytes,1000,/,8,*",
                        },
                        legend         => [
                                {  target  => "realin",
                                   formula => "LAST",
                                   text    => "Current Inbound Kbits/sec\\: %.3lf \\r",
                                },
                                {  target  => "realout",
                                   formula => "LAST",
                                   text    => "Current Outbound Kbits/sec\\: %.3lf \\r",
                                },
                                {  target  => "realout",
                                   formula => "AVERAGE",
                                   text    => "Average Outbound Kbits/sec\\: %.3lf \\r",
                                },
                                {  target  => "realin",
                                   formula => "AVERAGE",
                                   text    => "Average Inbound Kbits/sec\\: %.3lf \\r",
                                },
                                {  target  => "realout",
                                   formula => "MAX",
                                   text    => "Peak Outbound Kbits/sec\\: %.3lf\\r",
                                },
                                {  target  => "realin",
                                   formula => "MAX",
                                   text    => "Peak Inbound Kbits/sec\\: %.3lf \\r",
                                },


                        ],

                },
        },

        ##
        ##  END DEFINITION 1
	##

        ##
        ## Definition 2 - SFOCA/SATTX/PDXOR/DENCO/SEAWA combination
        ##
        {
        targets => [    
                {
                        label  => "SFOCA",
                        file   => "sfoca27i-sessions.rrd",
                        target => "sfoca27i",
                        color  => "ff0000",
                        type   => "LINE2",
                },
                {       label  => "SATTX",
                        file   => "sattx27i-sessions.rrd",
                        target => "sattx27i",
                        color  => "cccccc",
                        type   => "LINE2",
                },
                {       label  => "PDXOR",
                        file   => "pdxor27i-sessions.rrd",
                        target => "pdxor27i",
                        color  => "a8f901",
                        type   => "LINE2",
                },
                {       label  => "DENCO",
                        file   => "denco27i-sessions.rrd",
                        target => "denco27i",
                        color  => "316e31",
                        type   => "LINE2",
                },
                {       label  => "SEAWA",
                        file   => "seawa27i-sessions.rrd",
                        target => "seawa27i",
                        color  => "ffaa00",
                        type   => "LINE2",
                },
        ],

        options => {    filebase       => "/etc/bronc/rrd_files",
                        title          => "Ireland: SFOCA, SEAWA, PDXOR, DENCO, SATTX",
                        vertical_label => "SESSIONS",
                        graph_width    => "500",
                        graph_height   => "100",
                        interlaced     => "off",
                        logarithmic    => "off",
                        start          => "-86400",
                        legend         => [
                                {  target  => "sfoca27i",
                                   formula => "LAST",
				   text    => "Current SFOCA Sessions\\: %.0lf \\r",
                                },
                                {  target  => "seawa27i",
                                   formula => "LAST",
                                   text    => "Current SEAWA Sessions\\: %.0lf \\r",
                                },
                                {  target  => "pdxor27i",
                                   formula => "LAST",
                                   text    => "Current PDXOR Sessions\\: %.0lf \\r",
                                },
                                {  target  => "denco27i",
                                   formula => "LAST",
                                   text    => "Current DENCO Sessions\\: %.0lf \\r",
                                },
                                {  target  => "sattx27i",
                                   formula => "LAST",
                                   text    => "Current SATTX Sessions\\: %.0lf \\r",
                                },

                        ],
                                
                },

	},

        ##
        ## END DEFINITION  2
        ##


),

</%init>



<%perl>
return (\@images);
</%perl>
