File: inf_ldisk_rate.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 (36 lines) | stat: -rw-r--r-- 1,310 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
30
31
32
33
34
35
36
<?php
/* SNMP Informant Disk Graph. This file is part of JFFNMS.
 * Copyright (C) <2005> David LIMA <dlima@fr.scc.com>
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
*/

   function graph_inf_ldisk_rate ($data) {

	$opts_DEF = rrdtool_get_def($data,array("read_rate"=>"inf_d_read_rate","write_rate"=>"inf_d_write_rate"));
    
    	$opts_GRAPH = array(
    	    "CDEF:ldisk_rate_total=read_rate,write_rate,+",
	    "CDEF:write_rate_graph=write_rate,-1,*",

	    "COMMENT:'  Disk Total '",
    	    "GPRINT:ldisk_rate_total:MAX:'Max\:%8.2lf %sBps '",
	    "GPRINT:ldisk_rate_total:AVERAGE:'Average\:%8.2lf %sBps '",
	    "GPRINT:ldisk_rate_total:LAST:'Last\:%8.2lf %sBps \\n'",
	
	    "AREA:read_rate#0000CC:'Disk Reads '",
    	    "GPRINT:read_rate:MAX:'Max\:%8.2lf %sBps '",
    	    "GPRINT:read_rate:AVERAGE:'Average\:%8.2lf %sBps '",
    	    "GPRINT:read_rate:LAST:'Last\:%8.2lf %sBps \\n'",

	    "AREA:write_rate_graph#FF0000:'Disk Writes'",
    	    "GPRINT:write_rate:MAX:'Max\:%8.2lf %sBps '",
    	    "GPRINT:write_rate:AVERAGE:'Average\:%8.2lf %sBps '",
    	    "GPRINT:write_rate:LAST:'Last\:%8.2lf %sBps \\n'"
	);

	$opts_header[] = "--vertical-label='Disk Rate (Bytes per Second)'";

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

?>