function graph_haproxy_requests_report(&$rrdtool_graph) { global $context, $cpu_num_color, $cpu_user_color, $hostname, $load_one_color, $num_nodes_color, $proc_run_color, $mem_swapped_color, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $title = 'HAProxy Requests'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'Requests'; $rrdtool_graph['extras'] = '--rigid'; if (file_exists("{$rrd_dir}/lb_total_current_sess.rrd")) { $series = "DEF:'haproxy_current_sessions'='{$rrd_dir}/lb_total_current_sess.rrd':'sum':AVERAGE "; $series .= "DEF:'haproxy_req_per_s'='{$rrd_dir}/lb_total_req_per_s.rrd':'sum':AVERAGE "; $series .= "LINE2:'haproxy_req_per_s'#{$cpu_num_color}:'Requests/sec' "; $series .= "LINE2:'haproxy_current_sessions'#{$proc_run_color}:'Sessions' "; } else { # If there are no Passenger metrics put something so that the report doesn't barf $series = "DEF:'cpu_num'='{$rrd_dir}/cpu_num.rrd':'sum':AVERAGE "; $series .= "LINE2:'cpu_num'#{$mem_swapped_color}:'HAProxy metrics not collected' "; } $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_varnish_report(&$rrdtool_graph) { global $conf, $context, $range, $rrd_dir, $size; $title = 'Varnish Report'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = strip_domainname($GLOBALS['hostname']) . " {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'req_per_sec'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; if ($conf['graphreport_stats']) { $rrdtool_graph['height'] += $size == 'medium' ? 16 : 0; $rmspace = '\\g'; } else { $rmspace = ''; } if ($context != "host") { /* If we are not in a host context, then we need to calculate the average */ $rrdtool_graph['series'] = "DEF:'num_nodes'='{$rrd_dir}/varnish_200.rrd':'num':AVERAGE " . "DEF:'varnish_200'='{$rrd_dir}/varnish_200.rrd':'sum':AVERAGE " . "CDEF:'cvarnish_200'=varnish_200,num_nodes,/ " . "DEF:'varnish_300'='{$rrd_dir}/varnish_300.rrd':'sum':AVERAGE " . "CDEF:'cvarnish_300'=varnish_300,num_nodes,/ " . "DEF:'varnish_400'='{$rrd_dir}/varnish_400.rrd':'sum':AVERAGE " . "CDEF:'cvarnish_400'=varnish_400,num_nodes,/ " . "DEF:'varnish_500'='{$rrd_dir}/varnish_500.rrd':'sum':AVERAGE " . "CDEF:'cvarnish_500'=varnish_500,num_nodes,/ " . "DEF:'varnish_other'='{$rrd_dir}/varnish_other.rrd':'sum':AVERAGE " . "AREA:'varnish_200'#{$conf['cpu_user_color']}:'200' " . "STACK:'varnish_300'#{$conf['cpu_nice_color']}:'300' " . "STACK:'varnish_400'#{$conf['cpu_system_color']}:'400' " . "STACK:'varnish_500'#{$conf['cpu_wio_color']}:'500' " . "STACK:'varnish_other'#{$conf['cpu_idle_color']}:'other' " . "LINE2:'varnish_unique_users'#{$conf['mem_swapped_color']}:'Unique IPs' "; } else { $rrdtool_graph['series'] = "DEF:'varnish_200'='{$rrd_dir}/varnish_200.rrd':'sum':AVERAGE " . "DEF:'varnish_300'='{$rrd_dir}/varnish_300.rrd':'sum':AVERAGE " . "DEF:'varnish_400'='{$rrd_dir}/varnish_400.rrd':'sum':AVERAGE " . "DEF:'varnish_500'='{$rrd_dir}/varnish_500.rrd':'sum':AVERAGE " . "AREA:'varnish_200'#{$conf['cpu_user_color']}:'200' " . "STACK:'varnish_300'#{$conf['cpu_nice_color']}:'300' " . "STACK:'varnish_400'#{$conf['cpu_system_color']}:'400' " . "STACK:'varnish_500'#{$conf['cpu_wio_color']}:'500' "; } ################################################################################# # If there are no Apache metrics put something so that the report doesn't barf # I am using the CPU number metric since that one should always be there. ################################################################################# if (!file_exists("{$rrd_dir}/varnish_200.rrd")) { $rrdtool_graph['series'] = "DEF:'cpu_num'='{$rrd_dir}/cpu_num.rrd':'sum':AVERAGE " . "LINE2:'cpu_num'#{$conf['mem_swapped_color']}:'Varnish metrics not collected' "; } return $rrdtool_graph; }
function graph_procstat_mem_report(&$rrdtool_graph) { global $context, $hostname, $graph_var, $range, $rrd_dir, $size, $strip_domainname; $rainbow = array('008000', '0000FF', 'FF0000', 'FFEA00', '9900CC', '00FF00', '00FFFF', 'FF00FF', '808000', '008080', '808080', '000000'); if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Process Memory Usage'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'Bytes'; $rrdtool_graph['extras'] = '--rigid --base 1024'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = ''; foreach (explode(',', $graph_var) as $k => $proc) { $color = $rainbow[$k % count($rainbow)]; $series .= "DEF:'{$proc}'='{$rrd_dir}/procstat_{$proc}_mem.rrd':'sum':AVERAGE " . "CDEF:'{$proc}_bytes'={$proc},1024,* " . "LINE2:'{$proc}_bytes'#{$color}:'{$proc}' "; } $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_passenger_memory_stats_report(&$rrdtool_graph) { global $context, $cpu_num_color, $cpu_user_color, $hostname, $load_one_color, $num_nodes_color, $proc_run_color, $mem_swapped_color, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $title = 'Passenger Memory Stats'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'MB'; $rrdtool_graph['extras'] = '--base 1024 --rigid'; if (file_exists("{$rrd_dir}/passenger_avg_memory.rrd")) { $series = "DEF:'passenger_avg_memory'='{$rrd_dir}/passenger_avg_memory.rrd':'sum':AVERAGE " . "DEF:'passenger_total_memory'='{$rrd_dir}/passenger_total_memory.rrd':'sum':AVERAGE "; $series .= "LINE2:'passenger_avg_memory'#{$proc_run_color}:'AVG Memory per Passenger' "; $series .= "LINE2:'passenger_total_memory'#{$cpu_num_color}:'Total Memory' "; } else { # If there are no Passenger metrics put something so that the report doesn't barf $series = "DEF:'cpu_num'='{$rrd_dir}/cpu_num.rrd':'sum':AVERAGE "; $series .= "LINE2:'cpu_num'#{$mem_swapped_color}:'Passenger metrics not collected' "; } $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_sample_report(&$rrdtool_graph) { /* * this is just the cpu_report (from revision r920) as an example, but * with extra comments */ // pull in a number of global variables, many set in conf.php (such as colors) // but other from elsewhere, such as get_context.php global $conf, $context, $range, $rrd_dir, $size; if ($conf['strip_domainname']) { $hostname = strip_domainname($GLOBALS['hostname']); } else { $hostname = $GLOBALS['hostname']; } // // You *MUST* set at least the 'title', 'vertical-label', and 'series' // variables otherwise, the graph *will not work*. // $title = 'Sample'; if ($context != 'host') { // This will be turned into: "Clustername $TITLE last $timerange", // so keep it short $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['vertical-label'] = 'Sample Percent'; // Fudge to account for number of lines in the chart legend $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $rrdtool_graph['upper-limit'] = '100'; $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; /* * Here we actually build the chart series. This is moderately complicated * to show off what you can do. For a simpler example, look at * network_report.php */ if ($context != "host") { /* * If we are not in a host context, then we need to calculate * the average */ $series = "'DEF:num_nodes={$rrd_dir}/cpu_user.rrd:num:AVERAGE' " . "'DEF:cpu_user={$rrd_dir}/cpu_user.rrd:sum:AVERAGE' " . "'CDEF:ccpu_user=cpu_user,num_nodes,/' " . "'DEF:cpu_nice={$rrd_dir}/cpu_nice.rrd:sum:AVERAGE' " . "'CDEF:ccpu_nice=cpu_nice,num_nodes,/' " . "'DEF:cpu_system={$rrd_dir}/cpu_system.rrd:sum:AVERAGE' " . "'CDEF:ccpu_system=cpu_system,num_nodes,/' " . "'DEF:cpu_idle={$rrd_dir}/cpu_idle.rrd:sum:AVERAGE' " . "'CDEF:ccpu_idle=cpu_idle,num_nodes,/' " . "'AREA:ccpu_user#{$conf['cpu_user_color']}:User CPU' " . "'STACK:ccpu_nice#{$conf['cpu_nice_color']}:Nice CPU' " . "'STACK:ccpu_system#{$conf['cpu_system_color']}:System CPU' "; if (file_exists("{$rrd_dir}/cpu_wio.rrd")) { $series .= "'DEF:cpu_wio={$rrd_dir}/cpu_wio.rrd:sum:AVERAGE' " . "'CDEF:ccpu_wio=cpu_wio,num_nodes,/' " . "'STACK:ccpu_wio#{$conf['cpu_wio_color']}:WAIT CPU' "; } $series .= "'STACK:ccpu_idle#{$conf['cpu_idle_color']}:Idle CPU' "; } else { // Context is not "host" $series = "'DEF:cpu_user={$rrd_dir}/cpu_user.rrd:sum:AVERAGE' " . "'DEF:cpu_nice={$rrd_dir}/cpu_nice.rrd:sum:AVERAGE' " . "'DEF:cpu_system={$rrd_dir}/cpu_system.rrd:sum:AVERAGE' " . "'DEF:cpu_idle={$rrd_dir}/cpu_idle.rrd:sum:AVERAGE' " . "'AREA:cpu_user#{$conf['cpu_user_color']}:User CPU' " . "'STACK:cpu_nice#{$conf['cpu_nice_color']}:Nice CPU' " . "'STACK:cpu_system#{$conf['cpu_system_color']}:System CPU' "; if (file_exists("{$rrd_dir}/cpu_wio.rrd")) { $series .= "'DEF:cpu_wio={$rrd_dir}/cpu_wio.rrd:sum:AVERAGE' "; $series .= "'STACK:cpu_wio#{$conf['cpu_wio_color']}:WAIT CPU' "; } $series .= "'STACK:cpu_idle#{$conf['cpu_idle_color']}:Idle CPU' "; } // We have everything now, so add it to the array, and go on our way. $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_gpu_core_speed_report(&$rrdtool_graph) { global $context, $hostname, $mem_cached_color, $mem_used_color, $mem_swapped_color, $cpu_num_color, $range, $rrd_dir, $size, $strip_domainname; if (!file_exists("{$rrd_dir}/gpu_num.rrd")) { return; } if (!file_exists("{$rrd_dir}/gpu0_core_speed.rrd")) { return; } if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'GPU Core Speed'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'MHz'; $rrdtool_graph['extras'] = '--rigid --base 1024'; $color = array($mem_cached_color, $mem_used_color, $mem_swapped_color, $cpu_num_color); $gpu_count = exec("find {$rrd_dir}/gpu?_core_speed.rrd | wc -l"); $series = ''; foreach (range(0, $gpu_count - 1) as $i) { $series .= "DEF:'gpu{$i}'='{$rrd_dir}/gpu{$i}_core_speed.rrd':'sum':AVERAGE "; } foreach (range(0, $gpu_count - 1) as $i) { $series .= "LINE2:'gpu{$i}'#{$color[$i]}:'gpu{$i}' "; } $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_nginx_status_report(&$rrdtool_graph) { global $context, $cpu_num_color, $cpu_user_color, $hostname, $load_one_color, $num_nodes_color, $proc_run_color, $mem_swapped_color, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $rrdtool_graph['height'] += $size == 'medium' ? 14 : 0; $title = 'Nginx Connections'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'Connections'; $rrdtool_graph['extras'] = '--rigid'; if (file_exists("{$rrd_dir}/nginx_active_connections.rrd")) { $series = "DEF:'nginx_active_connections'='{$rrd_dir}/nginx_active_connections.rrd':'sum':AVERAGE "; $series .= "DEF:'nginx_reading'='{$rrd_dir}/nginx_reading.rrd':'sum':AVERAGE "; $series .= "DEF:'nginx_writing'='{$rrd_dir}/nginx_writing.rrd':'sum':AVERAGE "; $series .= "DEF:'nginx_waiting'='{$rrd_dir}/nginx_waiting.rrd':'sum':AVERAGE "; $series .= "LINE2:'nginx_active_connections'#{$cpu_num_color}:'Active Connections' "; $series .= "LINE2:'nginx_reading'#{$proc_run_color}:'Reading Connections' "; $series .= "LINE2:'nginx_writing'#33FF11:'Writing Connections' "; $series .= "LINE2:'nginx_waiting'#{$load_one_color}:'Waiting Connections' "; } else { # If there are no Nginx metrics put something so that the report doesn't barf $series = "DEF:'cpu_num'='{$rrd_dir}/cpu_num.rrd':'sum':AVERAGE "; $series .= "LINE2:'cpu_num'#{$mem_swapped_color}:'Nginx metrics not collected' "; } $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_network_report(&$rrdtool_graph) { global $context, $hostname, $mem_cached_color, $mem_used_color, $cpu_num_color, $range, $rrd_dir, $size, $strip_domainname, $graphreport_stats; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Network'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; if ($graphreport_stats) { $rrdtool_graph['height'] += $size == 'medium' ? 52 : 0; $rmspace = '\\g'; } else { $rmspace = ''; } if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} Network last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'Bytes/sec'; $rrdtool_graph['extras'] = '--base 1024'; $rrdtool_graph['extras'] .= $graphreport_stats == true ? ' --font LEGEND:7' : ''; if ($size == 'small') { $eol1 = '\\l'; $space1 = ' '; $space2 = ' '; } else { if ($size == 'medium' || $size == 'default') { $eol1 = ''; $space1 = ' '; $space2 = ''; } else { if ($size == 'large') { $eol1 = ''; $space1 = ' '; $space2 = ' '; } } } $series = "DEF:'bytes_in'='{$rrd_dir}/bytes_in.rrd':'sum':AVERAGE " . "DEF:'bytes_out'='{$rrd_dir}/bytes_out.rrd':'sum':AVERAGE " . "LINE2:'bytes_in'#{$mem_cached_color}:'In{$rmspace}' "; if ($graphreport_stats) { $series .= "CDEF:bytesin_pos=bytes_in,0,INF,LIMIT " . "VDEF:bytesin_last=bytesin_pos,LAST " . "VDEF:bytesin_min=bytesin_pos,MINIMUM " . "VDEF:bytesin_avg=bytesin_pos,AVERAGE " . "VDEF:bytesin_max=bytesin_pos,MAXIMUM " . "GPRINT:'bytesin_last':' {$space1}Now\\:%6.1lf%s' " . "GPRINT:'bytesin_min':'{$space1}Min\\:%6.1lf%s{$eol1}' " . "GPRINT:'bytesin_avg':'{$space2}Avg\\:%6.1lf%s' " . "GPRINT:'bytesin_max':'{$space1}Max\\:%6.1lf%s\\l' "; } $series .= "LINE2:'bytes_out'#{$mem_used_color}:'Out{$rmspace}' "; if ($graphreport_stats) { $series .= "CDEF:bytesout_pos=bytes_out,0,INF,LIMIT " . "VDEF:bytesout_last=bytesout_pos,LAST " . "VDEF:bytesout_min=bytesout_pos,MINIMUM " . "VDEF:bytesout_avg=bytesout_pos,AVERAGE " . "VDEF:bytesout_max=bytesout_pos,MAXIMUM " . "GPRINT:'bytesout_last':'{$space1}Now\\:%6.1lf%s' " . "GPRINT:'bytesout_min':'{$space1}Min\\:%6.1lf%s{$eol1}' " . "GPRINT:'bytesout_avg':'{$space2}Avg\\:%6.1lf%s' " . "GPRINT:'bytesout_max':'{$space1}Max\\:%6.1lf%s\\l' "; } $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_apache_response_time_report( &$rrdtool_graph ) { global $context, $cpu_num_color, $cpu_user_color, $hostname, $load_one_color, $num_nodes_color, $proc_run_color, $mem_swapped_color, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0; $title = 'Apache Resp Times'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "$hostname $title last $range"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'seconds'; $rrdtool_graph['extras'] = '--rigid'; if ( file_exists("$rrd_dir/apache_90th_dur.rrd")) { $series = "DEF:'apache_90th_dur'='${rrd_dir}/apache_90th_dur.rrd':'sum':AVERAGE "; $series .="DEF:'apache_avg_dur'='${rrd_dir}/apache_avg_dur.rrd':'sum':AVERAGE "; $series .="LINE2:'apache_90th_dur'#$cpu_num_color:'90th duration' "; $series .="LINE2:'apache_avg_dur'#$proc_run_color:'AVG duration' "; } else { # If there are no Apache metrics put something so that the report doesn't barf $series = "DEF:'cpu_num'='${rrd_dir}/cpu_num.rrd':'sum':AVERAGE "; $series .= "LINE2:'cpu_num'#$mem_swapped_color:'Apache metrics not collected' "; } $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_gpu_power_violation_report(&$rrdtool_graph) { global $context, $hostname, $mem_shared_color, $mem_cached_color, $mem_buffered_color, $mem_swapped_color, $mem_used_color, $cpu_num_color, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $dIndex = $rrdtool_graph["arguments"]["dindex"]; $title = 'GPU' . $dIndex . ' Power Violation'; $rrdtool_graph['title'] = $title; $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = '% Violation'; $rrdtool_graph['extras'] = '--rigid --base 1024'; $series = "DEF:'gpu_power_violation'='{$rrd_dir}/gpu" . $dIndex . "_power_violation_report.rrd':'sum':AVERAGE " . "LINE2:'gpu_power_violation'#555555:'GPU" . $dIndex . " Power Violation' " . "CDEF:nice_pos=gpu_power_violation,0,INF,LIMIT " . "VDEF:nice_last=nice_pos,LAST " . "VDEF:nice_min=nice_pos,MINIMUM " . "VDEF:nice_avg=nice_pos,AVERAGE " . "VDEF:nice_max=nice_pos,MAXIMUM " . "GPRINT:'nice_last':' Now\\:%5.0lf' " . "GPRINT:'nice_min':' Min\\:%5.0lf\\l' " . "GPRINT:'nice_avg':' Avg\\:%5.0lf ' " . "GPRINT:'nice_max':' Max\\:%5.0lf\\l' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_temporary_objects_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql Temporary Objects'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'tables'='{$rrd_dir}/mysql_created_tmp_tables.rrd':'sum':AVERAGE " . "DEF:'disk_tables'='{$rrd_dir}/mysql_created_tmp_disk_tables.rrd':'sum':AVERAGE " . "DEF:'files'='{$rrd_dir}/mysql_created_tmp_files.rrd':'sum':AVERAGE " . "AREA:'tables'#FFAB00:'Temp Tables' " . "LINE:'tables'#837C04:'' " . "LINE:'disk_tables'#F51D30:'Temp Disk Tables' " . "LINE:'files'#157419:'Temp Files' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_qcache_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql Query Cache'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'hits'='{$rrd_dir}/mysql_qcache_hits.rrd':'sum':AVERAGE " . "DEF:'inserts'='{$rrd_dir}/mysql_qcache_inserts.rrd':'sum':AVERAGE " . "DEF:'not_cached'='{$rrd_dir}/mysql_qcache_not_cached.rrd':'sum':AVERAGE " . "DEF:'lowmem_prunes'='{$rrd_dir}/mysql_qcache_lowmem_prunes.rrd':'sum':AVERAGE " . "AREA:'hits'#EAAF00:'Hits' " . "STACK:'inserts'#157419:'Inserts' " . "STACK:'not_cached'#00A0C1:'Not Cached' " . "STACK:'lowmem_prunes'#FF0000:'Low-Memory Prunes' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_query_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql Query Report'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'questions'='{$rrd_dir}/mysql_questions.rrd':'sum':AVERAGE " . "DEF:'qc_hits'='{$rrd_dir}/mysql_qcache_hits.rrd':'sum':AVERAGE " . "DEF:'select'='{$rrd_dir}/mysql_com_select.rrd':'sum':AVERAGE " . "DEF:'insert'='{$rrd_dir}/mysql_com_insert.rrd':'sum':AVERAGE " . "DEF:'update'='{$rrd_dir}/mysql_com_update.rrd':'sum':AVERAGE " . "DEF:'replace'='{$rrd_dir}/mysql_com_replace.rrd':'sum':AVERAGE " . "DEF:'delete'='{$rrd_dir}/mysql_com_delete.rrd':'sum':AVERAGE " . "AREA:'questions'#CCCCCC:'Questions' " . "AREA:'select'#0000FF:'Select' " . "STACK:'delete'#FF0000:'Delete' " . "STACK:'insert'#00FFFF:'Insert' " . "STACK:'update'#FF00FF:'Update' " . "STACK:'replace'#2175D9:'Replace' " . "STACK:'qc_hits'#00FF00:'QC Hits' " . "LINE:'questions'#00000033:'' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_innodb_io_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql InnoDB I/O'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'file_reads'='{$rrd_dir}/mysql_innodb_data_reads.rrd':'sum':AVERAGE " . "DEF:'file_writes'='{$rrd_dir}/mysql_innodb_data_writes.rrd':'sum':AVERAGE " . "DEF:'file_syncs'='{$rrd_dir}/mysql_innodb_data_fsyncs.rrd':'sum':AVERAGE " . "DEF:'log_writes'='{$rrd_dir}/mysql_innodb_log_writes.rrd':'sum':AVERAGE " . "LINE2:'file_reads'#ED7600:'File Reads' " . "LINE2:'file_writes'#157419:'File Writes' " . "LINE2:'file_syncs'#4444FF:'File Syncs' " . "LINE2:'log_writes'#DA4725:'Log Writes' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_innodb_bp_activity_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql InnoDB Buffer Pool Activity'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'created'='{$rrd_dir}/mysql_innodb_pages_created.rrd':'sum':AVERAGE " . "DEF:'read'='{$rrd_dir}/mysql_innodb_pages_read.rrd':'sum':AVERAGE " . "DEF:'written'='{$rrd_dir}/mysql_innodb_pages_written.rrd':'sum':AVERAGE " . "AREA:'created'#FFAB00:'Pages Created' " . "STACK:'read'#D8ACE0:'Pages Read' " . "STACK:'written'#7CB3F1:'Pages Written' " . "LINE:'0'#5291D3:'':STACK "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_connections_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql Connections'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'max_used_connections'='{$rrd_dir}/mysql_max_used_connections.rrd':'sum':AVERAGE " . "DEF:'max_connections'='{$rrd_dir}/mysql_max_connections.rrd':'sum':AVERAGE " . "DEF:'aborted_clients'='{$rrd_dir}/mysql_aborted_clients.rrd':'sum':AVERAGE " . "DEF:'aborted_connects'='{$rrd_dir}/mysql_aborted_connects.rrd':'sum':AVERAGE " . "DEF:'threads_connected'='{$rrd_dir}/mysql_threads_connected.rrd':'sum':AVERAGE " . "DEF:'connections'='{$rrd_dir}/mysql_connections.rrd':'sum':AVERAGE " . "AREA:'max_connections'#C0C0C0:'Max Connections' " . "LINE:'max_connections'#00000033:'' " . "AREA:'max_used_connections'#FFD660:'Max Used Connections' " . "LINE:'max_used_connections'#00000033:'' " . "LINE2:'aborted_clients'#FF3932:'Aborted Clients' " . "LINE2:'aborted_connects'#00FF00:'Aborted Connects' " . "LINE2:'threads_connected'#FF7D00:'Threads Connected' " . "LINE2:'connections'#4444FF:'New Connections' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_nginx_accepts_ratio_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Nginx Accepts Ratio'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'accepts'='{$rrd_dir}/nginx_accepts.rrd':'sum':AVERAGE " . "DEF:'handled'='{$rrd_dir}/nginx_handled.rrd':'sum':AVERAGE " . "DEF:'requests'='{$rrd_dir}/nginx_requests.rrd':'sum':AVERAGE " . "CDEF:'handled_ratio'='accepts,handled,/' " . "CDEF:'requests_ratio'='requests,accepts,/' " . "LINE2:'handled_ratio'#850707:'Accepted / Handled' " . "LINE2:'requests_ratio'#D1642E:'Requests / Accepted' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_traffic_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql Network Traffic'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['vertical-label'] = 'Bytes'; $rrdtool_graph['extras'] = '--rigid --base 1024'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'sent'='{$rrd_dir}/mysql_bytes_sent.rrd':'sum':AVERAGE " . "DEF:'received'='{$rrd_dir}/mysql_bytes_received.rrd':'sum':AVERAGE " . "AREA:'sent'#980000:'Sent' " . "AREA:'received'#000098:'Received' " . "LINE1:'0'#00000066:'' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_select_types_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql Select Types'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'full_join'='{$rrd_dir}/mysql_select_full_join.rrd':'sum':AVERAGE " . "DEF:'full_range'='{$rrd_dir}/mysql_select_full_range_join.rrd':'sum':AVERAGE " . "DEF:'range'='{$rrd_dir}/mysql_select_range.rrd':'sum':AVERAGE " . "DEF:'range_check'='{$rrd_dir}/mysql_select_range_check.rrd':'sum':AVERAGE " . "DEF:'scan'='{$rrd_dir}/mysql_select_scan.rrd':'sum':AVERAGE " . "AREA:'full_join'#FF0000:'Full Join' " . "STACK:'full_range'#FF7D00:'Full Range' " . "STACK:'range'#FFF200:'Range' " . "STACK:'range_check'#00CF00:'Range Check' " . "STACK:'scan'#7CB3F1:'Scan' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_table_locks_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql Table Locks'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'locks_immediate'='{$rrd_dir}/mysql_table_locks_immediate.rrd':'sum':AVERAGE " . "DEF:'locks_waited'='{$rrd_dir}/mysql_table_locks_waited.rrd':'sum':AVERAGE " . "DEF:'slow_queries'='{$rrd_dir}/mysql_slow_queries.rrd':'sum':AVERAGE " . "AREA:'locks_immediate'#D2D8F9:'Locks Immediate' " . "STACK:'locks_waited'#FF3932:'Locks Waited' " . "STACK:'slow_queries'#35962B:'Slow Queries' " . "LINE:'locks_immediate'#002A8F66:'' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_roxie_instances_report(&$rrdtool_graph) { global $context, $cpu_num_color, $cpu_user_color, $hostname, $load_one_color, $num_nodes_color, $proc_run_color, $range, $rrd_dir, $size, $strip_domainname, $value, $mem_used_color; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $title = 'Roxie Instances'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'Instances'; $rrdtool_graph['extras'] = '--rigid'; $series = "DEF:'roxie_instances'='{$rrd_dir}/roxie_instances.rrd':'sum':AVERAGE " . "LINE2:'roxie_instances'#{$mem_used_color}:'roxie instances (now {$value})'"; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_diskstat_operations_report(&$rrdtool_graph) { global $context, $hostname, $graph_var, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $disk = $graph_var; $title = $disk . ' Operations'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['vertical-label'] = 'ops'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'reads'='{$rrd_dir}/diskstat_{$disk}_reads.rrd':'sum':AVERAGE " . "DEF:'reads_merged'='{$rrd_dir}/diskstat_{$disk}_reads_merged.rrd':'sum':AVERAGE " . "DEF:'writes'='{$rrd_dir}/diskstat_{$disk}_writes.rrd':'sum':AVERAGE " . "DEF:'writes_merged'='{$rrd_dir}/diskstat_{$disk}_writes_merged.rrd':'sum':AVERAGE " . "CDEF:'_writes'=writes,-1,* " . "CDEF:'_writes_merged'=writes_merged,-1,* " . "AREA:'reads'#FA6900:'Reads' " . "STACK:'reads_merged'#F38630:'Reads Merged' " . "AREA:'_writes'#69D2E7:'Writes' " . "STACK:'_writes_merged'#A7DBD8:'Writes Merged' " . "LINE1:'0'#00000066:'' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_nginx_scoreboard_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Nginx Scoreboard'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'requests/sec'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'active'='{$rrd_dir}/nginx_active_connections.rrd':'sum':AVERAGE " . "DEF:'reading'='{$rrd_dir}/nginx_reading.rrd':'sum':AVERAGE " . "DEF:'writing'='{$rrd_dir}/nginx_writing.rrd':'sum':AVERAGE " . "DEF:'waiting'='{$rrd_dir}/nginx_waiting.rrd':'sum':AVERAGE " . "AREA:'reading'#D1642E:'Reading' " . "STACK:'writing'#850707:'Writing' " . "STACK:'waiting'#487860:'Waiting' " . "LINE1:'active'#000000:'Active' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_diskstat_disktime_report(&$rrdtool_graph) { global $context, $hostname, $graph_var, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $disk = $graph_var; $title = $disk . ' Time on Disk'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['vertical-label'] = 'ms'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'read'='{$rrd_dir}/diskstat_{$disk}_read_time.rrd':'sum':AVERAGE " . "DEF:'write'='{$rrd_dir}/diskstat_{$disk}_write_time.rrd':'sum':AVERAGE " . "CDEF:'_write'=write,-1,* " . "AREA:'read'#8F005C:'Reading' " . "AREA:'_write'#002A97:'Writing' " . "LINE1:'0'#00000066:'' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_jmx_threads_report(&$rrdtool_graph) { global $context, $hostname, $graph_var, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $jmx = $graph_var; $title = $jmx . ' JMX Threads'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'threads'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'live'='{$rrd_dir}/jmx_{$jmx}_thread_count.rrd':'sum':AVERAGE " . "DEF:'daemon'='{$rrd_dir}/jmx_{$jmx}_daemon_threads.rrd':'sum':AVERAGE " . "LINE1:'live'#F19A2A:'Live' " . "LINE1:'daemon'#20ABD9:'Daemon' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_jmx_ehcache_hitrate_report(&$rrdtool_graph) { global $context, $hostname, $graph_var, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $jmx = $graph_var; $title = $jmx . ' JMX Ehcache Hitrate'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $rrdtool_graph['vertical-label'] = 'percent'; $series = "DEF:'hit'='{$rrd_dir}/jmx_game-ehcache_{$jmx}_hit_count.rrd':'sum':AVERAGE " . "DEF:'miss'='{$rrd_dir}/jmx_game-ehcache_{$jmx}_miss_count.rrd':'sum':AVERAGE " . "CDEF:hitrate=hit,miss,+,0,LE,0,hit,hit,miss,+,/,100,*,IF " . "AREA:'hitrate'#CCFFBB:'' " . "LINE2:'hitrate'#005A04:'{$jmx} hitrate' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_jmx_sessions_report(&$rrdtool_graph) { global $context, $hostname, $graph_var, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $jmx = $graph_var; $title = $jmx . ' JMX Jetty Sessions'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $rrdtool_graph['vertical-label'] = 'sessions'; $series = "DEF:'sessions'='{$rrd_dir}/jmx_{$jmx}_sessions.rrd':'sum':AVERAGE " . "AREA:'sessions'#ADCFF5:'' " . "LINE2:'sessions'#000098:'{$jmx}' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_qcache_mem_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql Query Cache Memory'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'Bytes'; $rrdtool_graph['extras'] = '--rigid --base 1024'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'cache_size'='{$rrd_dir}/mysql_query_cache_size.rrd':'sum':AVERAGE " . "DEF:'free_mem'='{$rrd_dir}/mysql_qcache_free_memory.rrd':'sum':AVERAGE " . "CDEF:'_mem_used'=cache_size,free_mem,- " . "AREA:'cache_size'#C0C0C0:'Cache Size' " . "LINE:'cache_size'#00000033:'' " . "AREA:'_mem_used'#FFD660:'Cache Used' " . "LINE:'_mem_used'#00000033:'' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_apache_workers_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Apache Workers'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['vertical-label'] = 'workers'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'busyWorkers'='{$rrd_dir}/httpd_busy_workers.rrd':'sum':AVERAGE " . "DEF:'idleWorkers'='{$rrd_dir}/httpd_idle_workers.rrd':'sum':AVERAGE " . "DEF:'maxClients'='{$rrd_dir}/httpd_max_clients.rrd':'sum':AVERAGE " . "DEF:'minSpareServers'='{$rrd_dir}/httpd_min_spare_servers.rrd':'sum':AVERAGE " . "DEF:'maxSpareServers'='{$rrd_dir}/httpd_max_spare_servers.rrd':'sum':AVERAGE " . "AREA:'busyWorkers'#47748B:'Busy Workers' " . "STACK:'idleWorkers'#EEB78E:'Idle Workers' " . "LINE:'0'#00000033:'':STACK " . "LINE2:'maxClients'#FF0000:'Max Clients' " . "LINE1:'minSpareServers'#FF0000aa:'Min Spare Servers' " . "LINE1:'maxSpareServers'#FF0000aa:'Max Spare Servers' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }
function graph_mysql_qcache_hitrate_report(&$rrdtool_graph) { global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname; if ($strip_domainname) { $hostname = strip_domainname($hostname); } $title = 'Mysql Query Cache Hitrate'; if ($context != 'host') { $rrdtool_graph['title'] = $title; } else { $rrdtool_graph['title'] = "{$hostname} {$title} last {$range}"; } $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; $rrdtool_graph['vertical-label'] = 'percent'; $rrdtool_graph['height'] += $size == 'medium' ? 28 : 0; $series = "DEF:'hits'='{$rrd_dir}/mysql_qcache_hits.rrd':'sum':AVERAGE " . "DEF:'select'='{$rrd_dir}/mysql_com_select.rrd':'sum':AVERAGE " . "CDEF:'hitrate'=hits,hits,select,+,/,100,* " . "AREA:'hitrate'#000098:'Hitrate' " . "LINE:'hitrate'#7CB3F199:'' "; $rrdtool_graph['series'] = $series; return $rrdtool_graph; }