[smokeping-users] master/slave questions

Pierfrancesco Caci pf at tippete.net
Tue May 6 10:23:00 CEST 2014


>>>>> "Pierfrancesco" == Pierfrancesco Caci <pf at tippete.net> writes:

    Pierfrancesco> 2) in the individual graphs, I see the slave as
    Pierfrancesco> e.g. "Last 3 hours from 
    Pierfrancesco> Hong Kong", but the master only has "Last 3
    Pierfrancesco> hours". Is there a way to 
    Pierfrancesco> specify the display_name for the master in the
    Pierfrancesco> individual graphs? oddly, 
    Pierfrancesco> this works for the overview graphs, but not for the
    Pierfrancesco> individual ones (the 
    Pierfrancesco> colour legend properly puts the master's display name
    Pierfrancesco> inside the graph) 

This patch "works for me":

--- Smokeping.pm.orig   2014-05-06 08:08:46.518927679 +0000
+++ Smokeping.pm        2014-05-06 08:19:16.075227947 +0000
@@ -1137,7 +1137,7 @@
     } 
     elsif ($mode eq 'n' or $mode eq 'a') {
         my $slave = (split(/~/, $open->[-1]))[1];
-        my $name = $slave ? " as seen from ". $cfg->{Slaves}{$slave}{display_name} : "";
+        my $name = " as seen from ". ($slave ? $cfg->{Slaves}{$slave}{display_name} : $cfg->{General}{display_name} || hostname);
         mkdir $cfg->{General}{imgcache}."/__navcache",0755  unless -d  $cfg->{General}{imgcache}."/__navcache";
         # remove old images after one hour
         my $pattern = $cfg->{General}{imgcache}."/__navcache/*.png";
@@ -1364,7 +1364,7 @@
             my @lazy =();
             @lazy = ('--lazy') if $mode eq 's' and $lastheight{$s} and $lastheight{$s}{$start} and $lastheight{$s}{$start} == $max->{$s}{$start};
             my $timer_start = time();
-            my $from = $s ? " from $cfg->{Slaves}{$slave}{display_name}": "";
+            my $from = " from ". ($slave ? $cfg->{Slaves}{$slave}{display_name} : $cfg->{General}{display_name} || hostname);
             my @task =
                ("${imgbase}${s}_${end}_${start}.png",
                @lazy,


Enjoy,

Pf


-- 
Pierfrancesco Caci, ik5pvx



More information about the smokeping-users mailing list