From 853a4e939c99fb683983d947f4267bf249f7c05e Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Thu, 31 Dec 2009 11:42:14 +0100 Subject: always show 'on $host' in the rrd title 'on $host' doesn't have to be added manually to rrd_title anymore. --- plugin/cpu.php | 2 +- plugin/df.php | 2 +- plugin/disk.php | 8 ++++---- plugin/entropy.php | 2 +- plugin/interface.php | 6 +++--- plugin/irq.php | 2 +- plugin/load.php | 2 +- plugin/memory.php | 2 +- plugin/processes.php | 2 +- plugin/sensors.php | 6 +++--- plugin/swap.php | 2 +- plugin/users.php | 2 +- type/Default.class.php | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/plugin/cpu.php b/plugin/cpu.php index 5f688f4..4cc74f6 100644 --- a/plugin/cpu.php +++ b/plugin/cpu.php @@ -55,7 +55,7 @@ $obj->width = $width; $obj->heigth = $heigth; $obj->seconds = $seconds; -$obj->rrd_title = "CPU-$pinstance usage on $host"; +$obj->rrd_title = sprintf('CPU-%s usage', $pinstance); $obj->rrd_vertical = 'Jiffies'; $obj->rrd_format = '%5.2lf'; diff --git a/plugin/df.php b/plugin/df.php index 6d7414b..bf9b850 100644 --- a/plugin/df.php +++ b/plugin/df.php @@ -33,7 +33,7 @@ $obj->width = $width; $obj->heigth = $heigth; $obj->seconds = $seconds; -$obj->rrd_title = "Free space ($tinstance) on $host"; +$obj->rrd_title = sprintf('Free space (%s)', $tinstance); $obj->rrd_vertical = 'Bytes'; $obj->rrd_format = '%5.1lf%sB'; diff --git a/plugin/disk.php b/plugin/disk.php index 45b5fde..620b188 100644 --- a/plugin/disk.php +++ b/plugin/disk.php @@ -36,22 +36,22 @@ $obj->heigth = $heigth; $obj->seconds = $seconds; switch($type) { case 'disk_merged': - $obj->rrd_title = "Disk Merged Operations ($pinstance) on $host"; + $obj->rrd_title = sprintf('Disk Merged Operations (%s)', $pinstance); $obj->rrd_vertical = 'Merged operations/s'; $obj->rrd_format = '%5.1lf'; break; case 'disk_octets': - $obj->rrd_title = "Disk Traffic ($pinstance) on $host"; + $obj->rrd_title = sprintf('Disk Traffic (%s)', $pinstance); $obj->rrd_vertical = 'Bytes per second'; $obj->rrd_format = '%5.1lf%s'; break; case 'disk_ops': - $obj->rrd_title = "Disk Operations ($pinstance) on $host"; + $obj->rrd_title = sprintf('Disk Operations (%s)', $pinstance); $obj->rrd_vertical = 'Ops per second'; $obj->rrd_format = '%5.1lf'; break; case 'disk_time': - $obj->rrd_title = "Disk time per operation ($pinstance) on $host"; + $obj->rrd_title = sprintf('Disk time per operation (%s)', $pinstance); $obj->rrd_vertical = 'Avg. Time/Op'; $obj->rrd_format = '%5.1lf%ss'; $obj->scale = '0.001'; diff --git a/plugin/entropy.php b/plugin/entropy.php index a4379ab..6ee96aa 100644 --- a/plugin/entropy.php +++ b/plugin/entropy.php @@ -28,7 +28,7 @@ $obj->colors = array( $obj->width = $width; $obj->heigth = $heigth; $obj->seconds = $seconds; -$obj->rrd_title = "Available entropy on $host"; +$obj->rrd_title = 'Available entropy'; $obj->rrd_vertical = 'Bits'; $obj->rrd_format = '%4.0lf'; diff --git a/plugin/interface.php b/plugin/interface.php index 45e3cf1..7d8d929 100644 --- a/plugin/interface.php +++ b/plugin/interface.php @@ -36,15 +36,15 @@ $obj->seconds = $seconds; $obj->rrd_format = '%5.1lf%s'; switch($type) { case 'if_errors': - $obj->rrd_title = "Interface Errors ($tinstance) on $host"; + $obj->rrd_title = sprintf('Interface Errors (%s)', $tinstance); $obj->rrd_vertical = 'Errors per second'; break; case 'if_octets': - $obj->rrd_title = "Interface Traffic ($tinstance) on $host"; + $obj->rrd_title = sprintf('Interface Traffic (%s)', $tinstance); $obj->rrd_vertical = 'Bits per second'; break; case 'if_packets': - $obj->rrd_title = "Interface Packets ($tinstance) on $host"; + $obj->rrd_title = sprintf('Interface Packets (%s)', $tinstance); $obj->rrd_vertical = 'Packets per second'; break; } diff --git a/plugin/irq.php b/plugin/irq.php index 95bddcf..d6b1e72 100644 --- a/plugin/irq.php +++ b/plugin/irq.php @@ -30,7 +30,7 @@ $obj->width = $width; $obj->heigth = $heigth; $obj->seconds = $seconds; -$obj->rrd_title = "Interrupts on $host"; +$obj->rrd_title = 'Interrupts'; $obj->rrd_vertical = 'IRQs/s'; $obj->rrd_format = '%6.1lf'; diff --git a/plugin/load.php b/plugin/load.php index 83fcf19..523f14c 100644 --- a/plugin/load.php +++ b/plugin/load.php @@ -32,7 +32,7 @@ $obj->colors = array( $obj->width = $width; $obj->heigth = $heigth; $obj->seconds = $seconds; -$obj->rrd_title = "System load on $host"; +$obj->rrd_title = 'System load'; $obj->rrd_vertical = 'System load'; $obj->rrd_format = '%.2lf'; diff --git a/plugin/memory.php b/plugin/memory.php index 7b0e47b..b0f6b73 100644 --- a/plugin/memory.php +++ b/plugin/memory.php @@ -43,7 +43,7 @@ $obj->width = $width; $obj->heigth = $heigth; $obj->seconds = $seconds; -$obj->rrd_title = "Physical memory utilization on $host"; +$obj->rrd_title = 'Physical memory utilization'; $obj->rrd_vertical = 'Bytes'; $obj->rrd_format = '%5.1lf%s'; diff --git a/plugin/processes.php b/plugin/processes.php index 5fc0463..65e1ddd 100644 --- a/plugin/processes.php +++ b/plugin/processes.php @@ -48,7 +48,7 @@ $obj->width = $width; $obj->heigth = $heigth; $obj->seconds = $seconds; -$obj->rrd_title = "Processes on $host"; +$obj->rrd_title = 'Processes'; $obj->rrd_vertical = 'Processes'; $obj->rrd_format = '%5.1lf%s'; diff --git a/plugin/sensors.php b/plugin/sensors.php index ddcf521..048f9f1 100644 --- a/plugin/sensors.php +++ b/plugin/sensors.php @@ -34,19 +34,19 @@ $obj->seconds = $seconds; switch($type) { case 'fanspeed': $obj->colors = '00ff00'; - $obj->rrd_title = "Fanspeed ($pinstance) on $host"; + $obj->rrd_title = sprintf('Fanspeed (%s)', $pinstance); $obj->rrd_vertical = 'RPM'; $obj->rrd_format = '%5.1lf'; break; case 'temperature': $obj->colors = '0000ff'; - $obj->rrd_title = "Temperature ($pinstance) on $host"; + $obj->rrd_title = sprintf('Temperature (%s)', $pinstance); $obj->rrd_vertical = 'Celius'; $obj->rrd_format = '%5.1lf%s'; break; case 'voltage': $obj->colors = 'ff0000'; - $obj->rrd_title = "Voltage ($pinstance) on $host"; + $obj->rrd_title = sprintf('Voltage (%s)', $pinstance); $obj->rrd_vertical = 'Volt'; $obj->rrd_format = '%5.1lf'; break; diff --git a/plugin/swap.php b/plugin/swap.php index 8173890..638ddc3 100644 --- a/plugin/swap.php +++ b/plugin/swap.php @@ -45,7 +45,7 @@ $obj->width = $width; $obj->heigth = $heigth; $obj->seconds = $seconds; -$obj->rrd_title = "Swap utilization on $host"; +$obj->rrd_title = 'Swap utilization'; $obj->rrd_vertical = 'Bytes'; $obj->rrd_format = '%5.1lf%s'; diff --git a/plugin/users.php b/plugin/users.php index 1555927..5ebee43 100644 --- a/plugin/users.php +++ b/plugin/users.php @@ -28,7 +28,7 @@ $obj->colors = array( $obj->width = $width; $obj->heigth = $heigth; $obj->seconds = $seconds; -$obj->rrd_title = "Users on $host"; +$obj->rrd_title = 'Users'; $obj->rrd_vertical = 'Users'; $obj->rrd_format = '%.1lf'; diff --git a/type/Default.class.php b/type/Default.class.php index 817521a..6b1ab5c 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -89,7 +89,7 @@ class Type_Default { $rrdgraph[] = sprintf('-w %d', is_numeric($this->width) ? $this->width : 400); $rrdgraph[] = sprintf('-h %d', is_numeric($this->heigth) ? $this->heigth : 175); $rrdgraph[] = '-l 0'; - $rrdgraph[] = sprintf('-t "%s"', $this->rrd_title); + $rrdgraph[] = sprintf('-t "%s on %s"', $this->rrd_title, $this->args['host']); $rrdgraph[] = sprintf('-v "%s"', $this->rrd_vertical); $rrdgraph[] = sprintf('-s -%d', is_numeric($this->seconds) ? $this->seconds : 86400); -- cgit v1.1