File: traffic_words.inc.php

package info (click to toggle)
jffnms 0.8.3dfsg.1-2.1etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,928 kB
  • ctags: 5,050
  • sloc: php: 19,981; sh: 266; makefile: 91; perl: 52
file content (29 lines) | stat: -rw-r--r-- 1,018 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?
/* This file is part of JFFNMS
 * Copyright (C) <2002-2005> Javier Szyszlican <javier@szysz.com>
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */
function graph_traffic_words ($data) { 

    $opts_DEF = rrdtool_get_def($data,array('rx_words','tx_words'));
    $opts_DEF[] = 'CDEF:inputbits=rx_words,UN,rx_words,rx_words,IF,32,*';
    $opts_DEF[] = 'CDEF:outputbits=tx_words,UN,tx_words,tx_words,IF,32,*';

    $opts_GRAPH = array( 		    
	"AREA:inputbits#00CC00:'Inbound '",
    	"GPRINT:inputbits:MAX:'Max\:%8.2lf %sbps'",
    	"GPRINT:inputbits:AVERAGE:'Average\:%8.2lf %sbps'",
    	"GPRINT:inputbits:LAST:'Last\:%8.2lf %sbps \\n'",

	"LINE2:outputbits#0000FF:Outbound",
    	"GPRINT:outputbits:MAX:'Max\:%8.2lf %sbps'",
    	"GPRINT:outputbits:AVERAGE:'Average\:%8.2lf %sbps'",
    	"GPRINT:outputbits:LAST:'Last\:%8.2lf %sbps'",
    );

    $opts_header[] = "--vertical-label='Bits per Second'";

    return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH));    
}

?>