File: ups_time_remaining.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 (24 lines) | stat: -rw-r--r-- 896 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?
/* UPS Time Remaining Graph. 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_ups_time_remaining ($data) { 
    
	$opts_DEF = rrdtool_get_def($data,array("minutes_remaining"));

	$opts_GRAPH = array(                                    
	    "CDEF:minutes_remaining_h=minutes_remaining,60,/",
	    "AREA:minutes_remaining#00DD00:'Time Remaining\:'",
            "GPRINT:minutes_remaining:MAX:'Max\: %3.0lf min'",
	    "GPRINT:minutes_remaining:AVERAGE:'Average\: %3.0lf min'",
            "GPRINT:minutes_remaining:LAST:'Last\: %3.0lf min'",
	    "GPRINT:minutes_remaining_h:LAST:'(%3.2lf Hours)\\n'",
	);

	$opts_header[] = "--vertical-label='Time Remaining'";

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