ubuntuusers.de

HAHA

Datum:
8. September 2011 20:11
Code:
 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
46
47
48
49
50
51
52
<?php
#
#
$opt[1] = "--vertical-label \"Memory [%]\" -u 100 -l 0 -r --title \"Memory Usage for $hostname / $servicedesc\" ";
#
#
#
$def[1] =  "DEF:used=$rrdfile:$DS[1]:AVERAGE " ;
$def[1] .= "DEF:free=$rrdfile:$DS[2]:AVERAGE " ;
$def[1] .= "DEF:buffers=$rrdfile:$DS[3]:AVERAGE " ;
$def[1] .= "DEF:cache=$rrdfile:$DS[4]:AVERAGE " ;
#$def[1] .= "HRULE:$WARN[1]#FFFF00 ";
#$def[1] .= "HRULE:$CRIT[1]#FF0000 ";

$def[1] .= "CDEF:used-prc=used,100,*,$MAX[1],/ " ;
$def[1] .= "CDEF:free-prc=free,100,*,$MAX[1],/ " ;
$def[1] .= "CDEF:buffers-prc=buffers,100,*,$MAX[1],/ " ;
$def[1] .= "CDEF:cache-prc=cache,100,*,$MAX[1],/ " ;



$def[1] .= "COMMENT:\"\\t\\t\\t\\tLAST\\t\\t\\tAVERAGE\\t\\tMAX\\n\" " ;

$def[1] .= "AREA:used-prc#DC0000:\"Used\\t\" " ;
$def[1] .= "GPRINT:used-prc:LAST:\"%6.2lf %%\" " ;
$def[1] .= "GPRINT:used:LAST:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:used:AVERAGE:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:used:MAX:\"%6.2lf MB\\n\" " ;

$def[1] .= "AREA:buffers-prc#00F000:\"Buffers\\t\":STACK " ;
$def[1] .= "GPRINT:buffers-prc:LAST:\"%6.2lf %%\" " ;
$def[1] .= "GPRINT:buffers:LAST:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:buffers:AVERAGE:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:buffers:MAX:\"%6.2lf MB\\n\" ";

$def[1] .= "AREA:cache-prc#00A100:\"Cached\\t\":STACK " ;
$def[1] .= "GPRINT:cache-prc:LAST:\"%6.2lf %%\" " ;
$def[1] .= "GPRINT:cache:LAST:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:cache:AVERAGE:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:cache:MAX:\"%6.2lf MB\\n\" ";

$def[1] .= "AREA:free-prc#006800:\"Free\\t\":STACK " ;
$def[1] .= "GPRINT:free-prc:LAST:\"%6.2lf %%\" " ;
$def[1] .= "GPRINT:free:LAST:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:free:AVERAGE:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:free:MAX:\"%6.2lf MB\\n\" " ;

$def[1] .= "LINE0.5:used-prc#000000: " ;
$def[1] .= "LINE0.5:buffers-prc#000000::STACK " ;
$def[1] .= "LINE0.5:cache-prc#000000::STACK " ;
$def[1] .= "LINE0.5:free-prc#000000::STACK " ;
?>