From 02024f510afb147c8bf31f4f0c4fe438ba8b3b6d Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sun, 18 Sep 2011 18:22:07 +0000 Subject: [PATCH] fix a bunch of graph definitions to work with pipe. replace escaping with quoting. git-svn-id: http://www.observium.org/svn/observer/trunk@2494 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/functions.inc.php | 10 +- .../graphs/device/hr_processes.inc.php | 10 +- html/includes/graphs/device/hr_users.inc.php | 10 +- html/includes/graphs/device/ucd_cpu.inc.php | 28 ++--- html/includes/graphs/device/ucd_load.inc.php | 28 ++--- .../includes/graphs/device/ucd_memory.inc.php | 112 +++++++++--------- html/includes/graphs/device/uptime.inc.php | 10 +- html/pages/device/graphs.inc.php | 25 ++-- 8 files changed, 119 insertions(+), 114 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 68241ce084..c0ce5c3c36 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -1,9 +1,11 @@ readable handle connected to child stdout // Any error output will be appended to /tmp/error-output.txt - fwrite($pipes[0], "graph $rrdfile $options"); +# echo (strlen("graph $graph_file $options")); + + fwrite($pipes[0], "graph $graph_file $options"); fclose($pipes[0]); fclose($pipes[1]); diff --git a/html/includes/graphs/device/hr_processes.inc.php b/html/includes/graphs/device/hr_processes.inc.php index c37b7e46f0..6f0faede23 100644 --- a/html/includes/graphs/device/hr_processes.inc.php +++ b/html/includes/graphs/device/hr_processes.inc.php @@ -9,12 +9,12 @@ include("includes/graphs/common.inc.php"); $database = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_processes.rrd"; $rrd_options .= " DEF:procs=$database:procs:AVERAGE"; -$rrd_options .= " COMMENT:Processes\ \ \ \ Cur\ \ \ \ \ Ave\ \ \ \ \ \ Min\ \ \ \ \ Max\\\\n"; +$rrd_options .= " COMMENT:'Processes Cur Ave Min Max\\n'"; $rrd_options .= " AREA:procs#CDEB8B:"; -$rrd_options .= " LINE1.25:procs#008C00:\ "; -$rrd_options .= " GPRINT:procs:LAST:\ \ \ \ %6.2lf"; +$rrd_options .= " LINE1.25:procs#008C00:' '"; +$rrd_options .= " GPRINT:procs:LAST:' %6.2lf'"; $rrd_options .= " GPRINT:procs:AVERAGE:%6.2lf"; $rrd_options .= " GPRINT:procs:MIN:%6.2lf"; -$rrd_options .= " GPRINT:procs:MAX:%6.2lf\\\\n"; +$rrd_options .= " GPRINT:procs:MAX:'%6.2lf\\n'"; -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/device/hr_users.inc.php b/html/includes/graphs/device/hr_users.inc.php index dabec19e21..58c889c656 100644 --- a/html/includes/graphs/device/hr_users.inc.php +++ b/html/includes/graphs/device/hr_users.inc.php @@ -10,13 +10,13 @@ $database = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_users.rrd"; $rrd_options .= " DEF:users=$database:users:AVERAGE"; $rrd_options .= " DEF:users_max=$database:users:MAX"; -$rrd_options .= " COMMENT:Users\ \ \ \ \ \ Cur\ \ \ \ \ Ave\ \ \ \ \ \ Min\ \ \ \ \ Max\\\\n"; +$rrd_options .= " COMMENT:'Users Cur Ave Min Max\\n'"; $rrd_options .= " AREA:users_max#defc9c:"; $rrd_options .= " AREA:users#CDEB8B:"; -$rrd_options .= " LINE1.25:users#008C00:\ "; -$rrd_options .= " GPRINT:users:LAST:\ \ \ \ %6.2lf"; +$rrd_options .= " LINE1.25:users#008C00: "; +$rrd_options .= " GPRINT:users:LAST:' %6.2lf'"; $rrd_options .= " GPRINT:users:AVERAGE:%6.2lf"; $rrd_options .= " GPRINT:users:MIN:%6.2lf"; -$rrd_options .= " GPRINT:users_max:MAX:%6.2lf\\\\n"; +$rrd_options .= " GPRINT:users_max:MAX:'%6.2lf\\n'"; -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/device/ucd_cpu.inc.php b/html/includes/graphs/device/ucd_cpu.inc.php index d894f090c6..9b0c7ceecf 100644 --- a/html/includes/graphs/device/ucd_cpu.inc.php +++ b/html/includes/graphs/device/ucd_cpu.inc.php @@ -11,22 +11,22 @@ $rrd_options .= " CDEF:user_perc=user,total,/,100,*"; $rrd_options .= " CDEF:nice_perc=nice,total,/,100,*"; $rrd_options .= " CDEF:system_perc=system,total,/,100,*"; $rrd_options .= " CDEF:idle_perc=idle,total,/,100,*"; -$rrd_options .= " COMMENT:Usage\ \ \ \ \ \ \ Current\ \ \ \ \ Average\ \ \ \ Maximum\\\\n"; +$rrd_options .= " COMMENT:'Usage Current Average Maximum\\n'"; $rrd_options .= " AREA:user_perc#c02020:user"; -$rrd_options .= " GPRINT:user_perc:LAST:\ \ \ \ \ %5.2lf%%"; -$rrd_options .= " GPRINT:user_perc:AVERAGE:\ \ \ %5.2lf%%"; -$rrd_options .= " GPRINT:user_perc:MAX:\ \ \ %5.2lf%%\\\\n"; +$rrd_options .= " GPRINT:user_perc:LAST:' %5.2lf%%'"; +$rrd_options .= " GPRINT:user_perc:AVERAGE:' %5.2lf%%'"; +$rrd_options .= " GPRINT:user_perc:MAX:' %5.2lf%%\\n'"; $rrd_options .= " AREA:nice_perc#008f00:nice:STACK"; -$rrd_options .= " GPRINT:nice_perc:LAST:\ \ \ \ \ %5.2lf%%"; -$rrd_options .= " GPRINT:nice_perc:AVERAGE:\ \ \ %5.2lf%%"; -$rrd_options .= " GPRINT:nice_perc:MAX:\ \ \ %5.2lf%%\\\\n"; +$rrd_options .= " GPRINT:nice_perc:LAST:' %5.2lf%%'"; +$rrd_options .= " GPRINT:nice_perc:AVERAGE:' %5.2lf%%'"; +$rrd_options .= " GPRINT:nice_perc:MAX:' %5.2lf%%\\n'"; $rrd_options .= " AREA:system_perc#ea8f00:system:STACK"; -$rrd_options .= " GPRINT:system_perc:LAST:\ \ \ %5.2lf%%"; -$rrd_options .= " GPRINT:system_perc:AVERAGE:\ \ \ %5.2lf%%"; -$rrd_options .= " GPRINT:system_perc:MAX:\ \ \ %5.2lf%%\\\\n"; +$rrd_options .= " GPRINT:system_perc:LAST:' %5.2lf%%'"; +$rrd_options .= " GPRINT:system_perc:AVERAGE:' %5.2lf%%'"; +$rrd_options .= " GPRINT:system_perc:MAX:' %5.2lf%%\\n'"; $rrd_options .= " AREA:idle_perc#f5f5e5:idle:STACK"; -$rrd_options .= " GPRINT:idle_perc:LAST:\ \ \ \ \ %5.2lf%%"; -$rrd_options .= " GPRINT:idle_perc:AVERAGE:\ \ \ %5.2lf%%"; -$rrd_options .= " GPRINT:idle_perc:MAX:\ \ \ %5.2lf%%\\\\n"; +$rrd_options .= " GPRINT:idle_perc:LAST:' %5.2lf%%'"; +$rrd_options .= " GPRINT:idle_perc:AVERAGE:' %5.2lf%%'"; +$rrd_options .= " GPRINT:idle_perc:MAX:' %5.2lf%%\\n'"; -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/device/ucd_load.inc.php b/html/includes/graphs/device/ucd_load.inc.php index 2238cf4e2a..76330e1795 100644 --- a/html/includes/graphs/device/ucd_load.inc.php +++ b/html/includes/graphs/device/ucd_load.inc.php @@ -14,19 +14,19 @@ $rrd_options .= " CDEF:a=1min,100,/"; $rrd_options .= " CDEF:b=5min,100,/"; $rrd_options .= " CDEF:c=15min,100,/"; $rrd_options .= " CDEF:cdefd=a,b,c,+,+"; -$rrd_options .= " COMMENT:Load\ Average\ \ Current\ \ \ \ Average\ \ \ \ Maximum\\\\n"; -$rrd_options .= " AREA:a#ffeeaa:1\ Min:"; +$rrd_options .= " COMMENT:'Load Average Current Average Maximum\\n'"; +$rrd_options .= " AREA:a#ffeeaa:'1 Min':"; $rrd_options .= " LINE1:a#c5aa00:"; -$rrd_options .= " GPRINT:a:LAST:\ \ \ \ %7.2lf"; -$rrd_options .= " GPRINT:a:AVERAGE:\ \ %7.2lf"; -$rrd_options .= " GPRINT:a:MAX:\ \ %7.2lf\\\\n"; -$rrd_options .= " LINE1.25:b#ea8f00:5\ Min:"; -$rrd_options .= " GPRINT:b:LAST:\ \ \ \ %7.2lf"; -$rrd_options .= " GPRINT:b:AVERAGE:\ \ %7.2lf"; -$rrd_options .= " GPRINT:b:MAX:\ \ %7.2lf\\\\n"; -$rrd_options .= " LINE1.25:c#cc0000:15\ Min"; -$rrd_options .= " GPRINT:c:LAST:\ \ \ %7.2lf"; -$rrd_options .= " GPRINT:c:AVERAGE:\ \ %7.2lf"; -$rrd_options .= " GPRINT:c:MAX:\ \ %7.2lf\\\\n"; +$rrd_options .= " GPRINT:a:LAST:' %7.2lf'"; +$rrd_options .= " GPRINT:a:AVERAGE:' %7.2lf'"; +$rrd_options .= " GPRINT:a:MAX:' %7.2lf\\n'"; +$rrd_options .= " LINE1.25:b#ea8f00:'5 Min':"; +$rrd_options .= " GPRINT:b:LAST:' %7.2lf'"; +$rrd_options .= " GPRINT:b:AVERAGE:' %7.2lf'"; +$rrd_options .= " GPRINT:b:MAX:' %7.2lf\\n'"; +$rrd_options .= " LINE1.25:c#cc0000:'15 Min'"; +$rrd_options .= " GPRINT:c:LAST:' %7.2lf'"; +$rrd_options .= " GPRINT:c:AVERAGE:' %7.2lf'"; +$rrd_options .= " GPRINT:c:MAX:' %7.2lf\\n'"; -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/device/ucd_memory.inc.php b/html/includes/graphs/device/ucd_memory.inc.php index 7f5f624f2f..167d099e91 100644 --- a/html/includes/graphs/device/ucd_memory.inc.php +++ b/html/includes/graphs/device/ucd_memory.inc.php @@ -5,61 +5,61 @@ $device = device_by_id_cache($id); $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_mem.rrd"; -$rrd_options .= " -b 1024"; +$rrd_options .= " '-b 1024'"; -$rrd_options .= " DEF:atotalswap=$rrd_filename:totalswap:AVERAGE"; -$rrd_options .= " DEF:aavailswap=$rrd_filename:availswap:AVERAGE"; -$rrd_options .= " DEF:atotalreal=$rrd_filename:totalreal:AVERAGE"; -$rrd_options .= " DEF:aavailreal=$rrd_filename:availreal:AVERAGE"; -$rrd_options .= " DEF:atotalfree=$rrd_filename:totalfree:AVERAGE"; -$rrd_options .= " DEF:ashared=$rrd_filename:shared:AVERAGE"; -$rrd_options .= " DEF:abuffered=$rrd_filename:buffered:AVERAGE"; -$rrd_options .= " DEF:acached=$rrd_filename:cached:AVERAGE"; -$rrd_options .= " CDEF:totalswap=atotalswap,1024,*"; -$rrd_options .= " CDEF:availswap=aavailswap,1024,*"; -$rrd_options .= " CDEF:totalreal=atotalreal,1024,*"; -$rrd_options .= " CDEF:availreal=aavailreal,1024,*"; -$rrd_options .= " CDEF:totalfree=atotalfree,1024,*"; -$rrd_options .= " CDEF:shared=ashared,1024,*"; -$rrd_options .= " CDEF:buffered=abuffered,1024,*"; -$rrd_options .= " CDEF:cached=acached,1024,*"; -$rrd_options .= " CDEF:usedreal=totalreal,availreal,-"; -$rrd_options .= " CDEF:usedswap=totalswap,availswap,-"; -$rrd_options .= " CDEF:cusedswap=usedswap,-1,*"; -$rrd_options .= " CDEF:cdeftot=availreal,shared,buffered,usedreal,cached,usedswap,+,+,+,+,+"; -$rrd_options .= " COMMENT:'Bytes Current Average Maximum\\n'"; -$rrd_options .= " LINE1:usedreal#d0b080:"; -$rrd_options .= " AREA:usedreal#f0e0a0:used"; -$rrd_options .= " GPRINT:usedreal:LAST:\ \ \ %7.2lf%sB"; -$rrd_options .= " GPRINT:usedreal:AVERAGE:%7.2lf%sB"; -$rrd_options .= " GPRINT:usedreal:MAX:%7.2lf%sB\\\\n"; -$rrd_options .= " STACK:availreal#e5e5e5:free"; -$rrd_options .= " GPRINT:availreal:LAST:\ \ \ %7.2lf%sB"; -$rrd_options .= " GPRINT:availreal:AVERAGE:%7.2lf%sB"; -$rrd_options .= " GPRINT:availreal:MAX:%7.2lf%sB\\\\n"; -$rrd_options .= " LINE1:usedreal#d0b080:"; -$rrd_options .= " AREA:shared#afeced::"; -$rrd_options .= " AREA:buffered#cc0000::STACK"; -$rrd_options .= " AREA:cached#ffaa66::STACK"; -$rrd_options .= " LINE1.25:shared#008fea:shared"; -$rrd_options .= " GPRINT:shared:LAST:\ %7.2lf%sB"; -$rrd_options .= " GPRINT:shared:AVERAGE:%7.2lf%sB"; -$rrd_options .= " GPRINT:shared:MAX:%7.2lf%sB\\\\n"; -$rrd_options .= " LINE1.25:buffered#ff1a00:buffers:STACK"; -$rrd_options .= " GPRINT:buffered:LAST:%7.2lf%sB"; -$rrd_options .= " GPRINT:buffered:AVERAGE:%7.2lf%sB"; -$rrd_options .= " GPRINT:buffered:MAX:%7.2lf%sB\\\\n"; -$rrd_options .= " LINE1.25:cached#ea8f00:cached:STACK"; -$rrd_options .= " GPRINT:cached:LAST:\ %7.2lf%sB"; -$rrd_options .= " GPRINT:cached:AVERAGE:%7.2lf%sB"; -$rrd_options .= " GPRINT:cached:MAX:%7.2lf%sB\\\\n"; -$rrd_options .= " LINE1:totalreal#050505:"; -$rrd_options .= " AREA:cusedswap#C3D9FF:swap"; -$rrd_options .= " LINE1.25:cusedswap#356AA0:"; -$rrd_options .= " GPRINT:usedswap:LAST:\ \ \ %7.2lf%sB"; -$rrd_options .= " GPRINT:usedswap:AVERAGE:%7.2lf%sB"; -$rrd_options .= " GPRINT:usedswap:MAX:%7.2lf%sB\\\\n"; -$rrd_options .= " LINE1:totalreal#050505:total"; -$rrd_options .= " GPRINT:totalreal:AVERAGE:\ \ %7.2lf%sB"; +$rrd_options .= " 'DEF:atotalswap=$rrd_filename:totalswap:AVERAGE'"; +$rrd_options .= " 'DEF:aavailswap=$rrd_filename:availswap:AVERAGE'"; +$rrd_options .= " 'DEF:atotalreal=$rrd_filename:totalreal:AVERAGE'"; +$rrd_options .= " 'DEF:aavailreal=$rrd_filename:availreal:AVERAGE'"; +$rrd_options .= " 'DEF:atotalfree=$rrd_filename:totalfree:AVERAGE'"; +$rrd_options .= " 'DEF:ashared=$rrd_filename:shared:AVERAGE'"; +$rrd_options .= " 'DEF:abuffered=$rrd_filename:buffered:AVERAGE'"; +$rrd_options .= " 'DEF:acached=$rrd_filename:cached:AVERAGE'"; +$rrd_options .= " 'CDEF:totalswap=atotalswap,1024,*'"; +$rrd_options .= " 'CDEF:availswap=aavailswap,1024,*'"; +$rrd_options .= " 'CDEF:totalreal=atotalreal,1024,*'"; +$rrd_options .= " 'CDEF:availreal=aavailreal,1024,*'"; +$rrd_options .= " 'CDEF:totalfree=atotalfree,1024,*'"; +$rrd_options .= " 'CDEF:shared=ashared,1024,*'"; +$rrd_options .= " 'CDEF:buffered=abuffered,1024,*'"; +$rrd_options .= " 'CDEF:cached=acached,1024,*'"; +$rrd_options .= " 'CDEF:usedreal=totalreal,availreal,-'"; +$rrd_options .= " 'CDEF:usedswap=totalswap,availswap,-'"; +$rrd_options .= " 'CDEF:cusedswap=usedswap,-1,*'"; +$rrd_options .= " 'CDEF:cdeftot=availreal,shared,buffered,usedreal,cached,usedswap,+,+,+,+,+'"; +$rrd_options .= " 'COMMENT:Bytes Current Average Maximum\\n'"; +$rrd_options .= " 'LINE1:usedreal#d0b080:'"; +$rrd_options .= " 'AREA:usedreal#f0e0a0:used'"; +$rrd_options .= " 'GPRINT:usedreal:LAST: %7.2lf%sB'"; +$rrd_options .= " 'GPRINT:usedreal:AVERAGE:%7.2lf%sB'"; +$rrd_options .= " 'GPRINT:usedreal:MAX:%7.2lf%sB\\n'"; +$rrd_options .= " 'STACK:availreal#e5e5e5:free'"; +$rrd_options .= " 'GPRINT:availreal:LAST: %7.2lf%sB'"; +$rrd_options .= " 'GPRINT:availreal:AVERAGE:%7.2lf%sB'"; +$rrd_options .= " 'GPRINT:availreal:MAX:%7.2lf%sB\\n'"; +$rrd_options .= " 'LINE1:usedreal#d0b080:'"; +$rrd_options .= " 'AREA:shared#afeced::'"; +$rrd_options .= " 'AREA:buffered#cc0000::STACK'"; +$rrd_options .= " 'AREA:cached#ffaa66::STACK'"; +$rrd_options .= " 'LINE1.25:shared#008fea:shared'"; +$rrd_options .= " 'GPRINT:shared:LAST: %7.2lf%sB'"; +$rrd_options .= " 'GPRINT:shared:AVERAGE:%7.2lf%sB'"; +$rrd_options .= " 'GPRINT:shared:MAX:%7.2lf%sB\\n'"; +$rrd_options .= " 'LINE1.25:buffered#ff1a00:buffers:STACK'"; +$rrd_options .= " 'GPRINT:buffered:LAST:%7.2lf%sB'"; +$rrd_options .= " 'GPRINT:buffered:AVERAGE:%7.2lf%sB'"; +$rrd_options .= " 'GPRINT:buffered:MAX:%7.2lf%sB\\n'"; +$rrd_options .= " 'LINE1.25:cached#ea8f00:cached:STACK'"; +$rrd_options .= " 'GPRINT:cached:LAST: %7.2lf%sB'"; +$rrd_options .= " 'GPRINT:cached:AVERAGE:%7.2lf%sB'"; +$rrd_options .= " 'GPRINT:cached:MAX:%7.2lf%sB\\n'"; +$rrd_options .= " 'LINE1:totalreal#050505:'"; +$rrd_options .= " 'AREA:cusedswap#C3D9FF:swap'"; +$rrd_options .= " 'LINE1.25:cusedswap#356AA0:'"; +$rrd_options .= " 'GPRINT:usedswap:LAST: %7.2lf%sB'"; +$rrd_options .= " 'GPRINT:usedswap:AVERAGE:%7.2lf%sB'"; +$rrd_options .= " 'GPRINT:usedswap:MAX:%7.2lf%sB\\n'"; +$rrd_options .= " 'LINE1:totalreal#050505:total'"; +$rrd_options .= " 'GPRINT:totalreal:AVERAGE: %7.2lf%sB'"; -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/device/uptime.inc.php b/html/includes/graphs/device/uptime.inc.php index 7d892a33bf..c846c23241 100644 --- a/html/includes/graphs/device/uptime.inc.php +++ b/html/includes/graphs/device/uptime.inc.php @@ -7,12 +7,12 @@ $device = device_by_id_cache($id); $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/uptime.rrd"; -$rrd_options .= " DEF:uptime=$rrd_filename:uptime:AVERAGE"; +$rrd_options .= " DEF:uptime=".$rrd_filename.":uptime:AVERAGE"; $rrd_options .= " CDEF:cuptime=uptime,86400,/"; -$rrd_options .= " COMMENT:Days\ \ \ \ \ \ Current\ \ Minimum\ \ Maximum\ \ Average\\\\n"; +$rrd_options .= " 'COMMENT:Days Current Minimum Maximum Average\\n'"; $rrd_options .= " AREA:cuptime#EEEEEE:Uptime"; $rrd_options .= " LINE1.25:cuptime#36393D:"; -$rrd_options .= " GPRINT:cuptime:LAST:%6.2lf\ GPRINT:cuptime:AVERAGE:%6.2lf\ "; -$rrd_options .= " GPRINT:cuptime:MAX:%6.2lf\ GPRINT:cuptime:AVERAGE:%6.2lf\\\\n"; +$rrd_options .= " GPRINT:cuptime:LAST:%6.2lf GPRINT:cuptime:AVERAGE:%6.2lf"; +$rrd_options .= " GPRINT:cuptime:MAX:%6.2lf 'GPRINT:cuptime:AVERAGE:%6.2lf\\n'"; -?> \ No newline at end of file +?> diff --git a/html/pages/device/graphs.inc.php b/html/pages/device/graphs.inc.php index ee26dc3443..77ae29e571 100644 --- a/html/pages/device/graphs.inc.php +++ b/html/pages/device/graphs.inc.php @@ -1,6 +1,6 @@ 'device', @@ -11,7 +11,7 @@ $bg="#ffffff"; echo('
'); -print_optionbar_start('', ''); +print_optionbar_start(); echo("Graphs » "); @@ -19,24 +19,25 @@ $sep = ""; foreach (dbFetchRows("SELECT * FROM device_graphs WHERE device_id = ?", array($device['device_id'])) as $graph) { - $tab = $config['graph_types']['device'][$graph['graph']]['tab']; - $graph_enable[$tab][$graph['graph']] = $graph['graph']; + $section = $config['graph_types']['device'][$graph['graph']]['section']; + $graph_enable[$section][$graph['graph']] = $graph['graph']; } -foreach ($config['graph_tabs'] as $tab) +foreach ($config['graph_sections'] as $section) { - if (isset($graph_enable) && is_array($graph_enable[$tab])) + if (isset($graph_enable) && is_array($graph_enable[$section])) { - $type = strtolower($tab); - if (!$_GET['optc']) { $_GET['optc'] = $type; } + $type = strtolower($section); + if (!$vars['group']) { $vars['group'] = $type; } echo($sep); - if ($_GET['optc'] == $type) + if ($vars['group'] == $type) { echo(''); } - echo(" " . ucfirst($type) .""); - if ($_GET['optc'] == $type) + echo(generate_link(ucfirst($type),$link_array,array('group'=>$type))); + + if ($vars['group'] == $type) { echo(""); } @@ -47,7 +48,7 @@ foreach ($config['graph_tabs'] as $tab) unset ($sep); print_optionbar_end(); -$graph_enable = $graph_enable[$_GET['optc']]; +$graph_enable = $graph_enable[$vars['group']]; foreach ($config['graph_types']['device'] as $graph => $entry) {