load_graph ()
{
last_x="$1"
/usr/bin/rrdtool graph /srv/www/img/load-$last_x.png --title "Load - $last_x" \
--imginfo '' \
$rrd_width $rrd_height $rrd_common_opts --watermark "$rrd_watermark" \
--end now --start end-${last_x} \
--vertical-label "Load" \
--font "WATERMARK:8" \
$rrd_grid_background \
DEF:shortterm=$rrd_dbpath/load/load.rrd:shortterm:AVERAGE \
DEF:midterm=$rrd_dbpath/load/load.rrd:midterm:AVERAGE \
DEF:longterm=$rrd_dbpath/load/load.rrd:longterm:AVERAGE \
VDEF:shortterm_l=shortterm,LAST \
VDEF:midterm_l=midterm,LAST \
VDEF:longterm_l=longterm,LAST \
AREA:shortterm$rrd_col_red_light:" 1 Minute, letzter\:" GPRINT:shortterm_l:"%5.2lf\n" \
AREA:midterm$rrd_col_orange:" 5 Minuten, letzter\:" GPRINT:midterm_l:"%5.2lf\n" \
AREA:longterm$rrd_col_yellow:"15 Minuten, letzter\:" GPRINT:longterm_l:"%5.2lf\n" \
LINE1:midterm$rrd_col_orange:"" \
LINE1:shortterm$rrd_col_red_light:"" \
COMMENT:"\n" \
COMMENT:"Letztes update\:\t$rrd_last_update"
}
cpu_graph ()
{
last_x="$1"
/usr/bin/rrdtool graph /srv/www/img/cpu-$last_x.png --title "$_STAT_SYS_cpuusage - $last_x" \
--imginfo '' \
--vertical-label "Prozent" \
--font "WATERMARK:8" \
$rrd_grid_background \
$rrd_width $rrd_height $rrd_common_opts --watermark "$rrd_watermark" \
--end now --start end-${last_x} \
DEF:idle=$rrd_dbpath/cpu-0/cpu-idle.rrd:value:AVERAGE \
DEF:interrupt=$rrd_dbpath/cpu-0/cpu-interrupt.rrd:value:AVERAGE \
DEF:nice=$rrd_dbpath/cpu-0/cpu-nice.rrd:value:AVERAGE \
DEF:softirq=$rrd_dbpath/cpu-0/cpu-softirq.rrd:value:AVERAGE \
DEF:steal=$rrd_dbpath/cpu-0/cpu-steal.rrd:value:AVERAGE \
DEF:system=$rrd_dbpath/cpu-0/cpu-system.rrd:value:AVERAGE \
DEF:user=$rrd_dbpath/cpu-0/cpu-user.rrd:value:AVERAGE \
DEF:wait=$rrd_dbpath/cpu-0/cpu-wait.rrd:value:AVERAGE \
LINE1:idle$rrd_col_red_light:"idle " \
LINE1:interrupt$rrd_col_blue:"interrupt" \
LINE1:nice$rrd_col_red:"nice \n" \
LINE1:softirq$rrd_col_red_dark:"softirq " \
LINE1:steal$rrd_col_blue:"steal " \
LINE1:system$rrd_col_green:"system \n" \
LINE1:user$rrd_col_green_light:"user " \
LINE1:wait$rrd_col_green_dark:"wait \n" \
COMMENT:"Letztes update\:\t$rrd_last_update"
}
uptime_graph ()
{
last_x="$1"
/usr/bin/rrdtool graph /srv/www/img/uptime-$last_x.png --title "Uptime - $last_x" \
--imginfo '' \
$rrd_width $rrd_height $rrd_common_opts --watermark "$rrd_watermark" \
--end now --start end-${last_x} \
--vertical-label "Sekunden" \
--font "WATERMARK:8" \
$rrd_grid_background \
DEF:value=$rrd_dbpath/uptime/uptime.rrd:value:AVERAGE \
AREA:value$rrd_col_blue:"uptime \n" \
COMMENT:"Letztes update\:\t$rrd_last_update"
}
memory_graph ()
{
last_x="$1"
/usr/bin/rrdtool graph /srv/www/img/memory-$last_x.png --title "Memory - $last_x" \
--imginfo '' \
$rrd_width $rrd_height $rrd_common_opts --watermark "$rrd_watermark" \
--end now --start end-${last_x} \
--vertical-label "Byte" \
--font "WATERMARK:8" \
$rrd_grid_background \
DEF:buffered=$rrd_dbpath/memory/memory-buffered.rrd:value:AVERAGE \
DEF:cached=$rrd_dbpath/memory/memory-cached.rrd:value:AVERAGE \
DEF:free=$rrd_dbpath/memory/memory-free.rrd:value:AVERAGE \
DEF:used=$rrd_dbpath/memory/memory-used.rrd:value:AVERAGE \
AREA:used$rrd_col_red_light:"used \n" \
AREA:cached$rrd_col_orange:"cached \n":STACK \
AREA:buffered$rrd_col_yellow:"buffered \n":STACK \
AREA:free$rrd_col_green_light:"free \n":STACK \
COMMENT:"Letztes update\:\t$rrd_last_update"
}
processes_graph ()
{
last_x="$1"
/usr/bin/rrdtool graph /srv/www/img/processes-$last_x.png --title "Processes - $last_x" \
--imginfo '' \
$rrd_width $rrd_height $rrd_common_opts --watermark "$rrd_watermark" \
--end now --start end-${last_x} \
--vertical-label "Anzahl" \
--font "WATERMARK:8" \
--logarithmic \
$rrd_grid_background \
DEF:blocked=$rrd_dbpath/processes/ps_state-blocked.rrd:value:AVERAGE \
DEF:paging=$rrd_dbpath/processes/ps_state-paging.rrd:value:AVERAGE \
DEF:running=$rrd_dbpath/processes/ps_state-running.rrd:value:AVERAGE \
DEF:sleeping=$rrd_dbpath/processes/ps_state-sleeping.rrd:value:AVERAGE \
DEF:stopped=$rrd_dbpath/processes/ps_state-stopped.rrd:value:AVERAGE \
DEF:zombies=$rrd_dbpath/processes/ps_state-zombies.rrd:value:AVERAGE \
LINE1:blocked$rrd_col_blue:"blocked " \
LINE1:paging$rrd_col_yellow:"paging " \
LINE1:running$rrd_col_green:"running \n" \
LINE1:sleeping$rrd_col_green_light:"sleeping " \
LINE1:stopped$rrd_col_orange:"stopped " \
LINE1:zombies$rrd_col_red_light:"zombies \n" \
COMMENT:"Letztes update\:\t$rrd_last_update"
}
entropy_graph ()
{
last_x="$1"
/usr/bin/rrdtool graph /srv/www/img/entropy-$last_x.png --title "Entropy - $last_x" \
--imginfo '' \
$rrd_width $rrd_height $rrd_common_opts --watermark "$rrd_watermark" \
--end now --start end-${last_x} \
--vertical-label "Anzahl" \
--font "WATERMARK:8" \
$rrd_grid_background \
DEF:value=$rrd_dbpath/entropy/entropy.rrd:entropy:AVERAGE \
LINE1:value$rrd_col_blue:"Entropy \n" \
COMMENT:"Letztes update\:\t$rrd_last_update"
}