| 
									
										
										
										
											2012-04-09 12:53:44 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | include("includes/graphs/common.inc.php"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-25 12:24:34 +00:00
										 |  |  | // FIXME - THIS IS BROKEN
 | 
					
						
							| 
									
										
										
										
											2012-05-11 13:26:14 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | $sla = dbFetchRow("SELECT * FROM `slas` WHERE `sla_id` = ?", array($vars['id'])); | 
					
						
							| 
									
										
										
										
											2012-04-09 12:53:44 +00:00
										 |  |  | $device = device_by_id_cache($sla['device_id']); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if ($_GET['width'] >= "450") { $descr_len = "48"; } else { $descr_len = "21"; }
 | 
					
						
							|  |  |  | $descr_len = intval($_GET['width'] / 8) * 0.8; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $unit_long = 'milliseconds'; | 
					
						
							|  |  |  | $unit = 'ms'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $rrd_options .= " -l 0 -E "; | 
					
						
							|  |  |  | $rrd_options .= " COMMENT:'".str_pad($unit_long,$descr_len)."   Cur      Min     Max\\n'"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $name = ""; | 
					
						
							|  |  |  | if ($sla['tag']) | 
					
						
							|  |  |  |   $name .= $sla['tag']; | 
					
						
							|  |  |  | if ($sla['owner']) | 
					
						
							|  |  |  |   $name .= " (Owner: ". $sla['owner'] .")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $rrd_file  = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("sla-" . $sla['sla_nr'] . ".rrd"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $rrd_options .= " DEF:rtt=$rrd_file:rtt:AVERAGE "; | 
					
						
							|  |  |  | $rrd_options .= " VDEF:avg=rtt,AVERAGE "; | 
					
						
							| 
									
										
										
										
											2012-05-23 10:37:23 +00:00
										 |  |  | $rrd_options .= " LINE1:avg#CCCCFF:'".str_pad('Average',$descr_len-3)."':dashes"; | 
					
						
							| 
									
										
										
										
											2012-04-09 12:53:44 +00:00
										 |  |  | $rrd_options .= " GPRINT:rtt:AVERAGE:%4.1lf".$unit."\\\l "; | 
					
						
							| 
									
										
										
										
											2014-02-22 15:47:57 +00:00
										 |  |  | $rrd_options .= " LINE1:rtt#CC0000:'" . rrdtool_escape($descr,$descr_len-3) . "'"; | 
					
						
							| 
									
										
										
										
											2012-04-09 12:53:44 +00:00
										 |  |  | $rrd_options .= " GPRINT:rtt:LAST:%4.1lf".$unit." "; | 
					
						
							|  |  |  | $rrd_options .= " GPRINT:rtt:MIN:%4.1lf".$unit." "; | 
					
						
							|  |  |  | $rrd_options .= " GPRINT:rtt:MAX:%4.1lf".$unit."\\\l "; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ?>
 |