File: ucd_cpu_solaris.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 (45 lines) | stat: -rw-r--r-- 2,026 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
37
38
39
40
41
42
43
44
45
<? 
/* This file is part of JFFNMS
 * Copyright (C) <2002> Robert Bogdon
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */

    // Solaris CPU Graph, UCD-SNMP 

    function graph_ucd_cpu_solaris ($data) { 

	$opts_DEF = rrdtool_get_def($data,array("cpu_user_ticks","cpu_idle_ticks","cpu_wait_ticks","cpu_kernel_ticks"));
         
        $opts_GRAPH = array(   
                "CDEF:user_ticks=cpu_user_ticks,UN,0,cpu_user_ticks,IF", 
                "CDEF:idle_ticks=cpu_idle_ticks,UN,0,cpu_idle_ticks,IF", 
                "CDEF:wait_ticks=cpu_wait_ticks,UN,0,cpu_wait_ticks,IF", 
                "CDEF:kernel_ticks=cpu_kernel_ticks,UN,0,cpu_kernel_ticks,IF", 

    		"HRULE:".($data["cpu_num"]*100)."#990000:'Number of Processors\: ".$options["cpu_num"]."\\n'",
                         
                "AREA:user_ticks#FF0000:'User   CPU Time'", 
                "GPRINT:user_ticks:MAX:'Max\:%8.2lf %%'", 
                "GPRINT:user_ticks:AVERAGE:'Average\:%8.2lf %%'", 
                "GPRINT:user_ticks:LAST:'Last\:%8.2lf %%\\n'", 

                "STACK:wait_ticks#0000FF:'Wait   CPU Time'", 
                "GPRINT:wait_ticks:MAX:'Max\:%8.2lf %%'", 
                "GPRINT:wait_ticks:AVERAGE:'Average\:%8.2lf %%'", 
                "GPRINT:wait_ticks:LAST:'Last\:%8.2lf %%\\n'", 

                "STACK:kernel_ticks#FFFF00:'Kernel CPU Time'", 
                "GPRINT:kernel_ticks:MAX:'Max\:%8.2lf %%'", 
                "GPRINT:kernel_ticks:AVERAGE:'Average\:%8.2lf %%'", 
                "GPRINT:kernel_ticks:LAST:'Last\:%8.2lf %%\\n'", 
                
                "STACK:idle_ticks#00CC00:'Idle   CPU Time'", 
                "GPRINT:idle_ticks:MAX:'Max\:%8.2lf %%'", 
                "GPRINT:idle_ticks:AVERAGE:'Average\:%8.2lf %%'", 
                "GPRINT:idle_ticks:LAST:'Last\:%8.2lf %%\\n'"); 

        $opts_header[] = "--vertical-label='CPU Usage'"; 
         
        return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH));     
    }       
?>