[smokeping-users] Successful install, but no graphs. -- update

Mark Haney mhaney at practichem.com
Wed Jan 15 15:15:08 CET 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 1/14/2014 4:03 PM, Gregory Sloop wrote:
> [Top posting]
> 
> Here's the FAQ:
> 
> https://github.com/oetiker/SmokePing/issues/11

> 
> 1) Data not reaching the RRD [round robin databases] Run smokeping
> in debug mode and watch what it says - you'll probably find some
> good reasons stuff isn't working and be able to fix it yourself. 
> Like this: smokeping --debug
> 
> 2) Data is hitting the RRD's as confirmed by --debug. However, you
> still get an empty graph from the browser.
> 
> You see: the user smokeping is running as, is writing the data -
> that's often root or smokeping. However, the thing that's creating
> the graphs has to read the data - and that's whatever process your
> web-server is running as. That's often apache or www, httpd or
> www-data.
> 
> [It depends on the apache [or how your distro sets it]
> configuration - or whatever other web-server you're using.]
> 
> So, make sure that both the user smokeping is running as, as well
> as the user the web-server is running as, both have rights to the
> RRD's. [If you aren't sure what apache is running at, have a look
> at the apache config files. For example Ubuntu 12.04 has the user
> in /etc/apache2/envvars - and the user is www-data.]
> 
> So, to spoon-feed you - you'll need to chown the files to something
> like: chown smokeping:www-data some-rrd-files*.rrd
> 
> -Greg

First off, it's not just the images of the graphs I'm not getting, I'm
also not getting the counter image, nor the RRDtool image. I get the
same broken image in their place.  So it's not a read/write issue with
only the graphs.

Let me show you what I have setup: (smokeping is run as root and
apache is the httpd user (I'm on CentOS 6.5).


[root at mon smokeping]# ls -l
total 36
drwxr-xr-x. 2 root   root 4096 Jan 14 09:58 bin
lrwxrwxrwx. 1 apache root   20 Jan 14 10:07 cache -> /var/www/html/cache/
drwxrwxrw-. 5 apache root 4096 Jan 14 10:27 data
drwxr-xr-x. 3 root   root 4096 Jan 14 13:02 etc
drwxr-xr-x. 3 root   root 4096 Jan 14 09:58 htdocs
drwxr-xr-x. 3 root   root 4096 Jan 14 09:58 lib
drwxr-xr-x. 3 root   root 4096 Jan 14 09:58 share
- -rw-r--r--. 1 root   root  302 Jan 14 13:06 smoke.log
drwxr-xr-x. 6 root   root 4096 Jan 14 09:57 thirdparty
drwxr-xr-x. 2 root   root 4096 Jan 14 10:07 var

When I run smokeping with --debug I get this:

[root at mon smokeping]# ./bin/smokeping --debug
### Compiling alert detector pattern 'someloss'
### >0%,*12*,>0%,*12*,>0%
sub {
    my $d = shift;
    my $y = $d->{loss};
    for(1){
        my $imax2 = min(@$y - 3, 12);
        my $imax1 = min(@$y - 3, 12);
        my $minlength = 3;
        my $maxlength = 27;
        next if scalar @$y < $minlength ;
        my $i1;
        for($i1=0; $i1 < min($maxlength,$imax1); $i1++){
            my $i2;
            for($i2=0; $i2 < min($maxlength-$i1,$imax2); $i2++){
                next unless defined $y->[-3-$i1-$i2]
                                and $y->[-3-$i1-$i2] =~ /^\d/
                                and $y->[-3-$i1-$i2] > 0
                                     ;                last;
            }
            return 0 if $i2 >= min($maxlength-$i1-$i2,$imax2);
            next unless defined $y->[-2-$i1]
                            and $y->[-2-$i1] =~ /^\d/
                            and $y->[-2-$i1] > 0
                                 ;            last;
        }
        return 0 if $i1 >= min($maxlength-$i1,$imax1);
        next unless defined $y->[-1]
                        and $y->[-1] =~ /^\d/
                        and $y->[-1] > 0
                             ;        return 1;
    }
    return 0;
}



Smokeping version 2.006009 successfully launched.
Not entering multiprocess mode with '--debug'. Use '--debug-daemon'
for that.
FPing: probing 1 targets with step 300 s and offset 241 s.
FPing: Executing /usr/sbin/fping -C 20 -q -B1 -r1 -i10 66.188.99.174
FPing: Got fping output: '66.188.99.174 : 269.98 183.10 81.46 118.87
82.20 79.97 85.42 81.77 82.68 82.11 82.29 87.19 80.58 82.50 82.84
82.56 80.92 80.20 81.37 104.47'
Calling RRDs::update(/opt/smokeping/data/MTC/ASUSWifi.rrd --template
uptime:loss:median:ping1:ping2:ping3:ping4:ping5:ping6:ping7:ping8:ping9:ping10:ping11:ping12:ping13:ping14:ping15:ping16:ping17:ping18:ping19:ping20
1389793594:U:0:8.2500000000e-02:7.9970000000e-02:8.0200000000e-02:8.0580000000e-02:8.0920000000e-02:8.1370000000e-02:8.1460000000e-02:8.1770000000e-02:8.2110000000e-02:8.2200000000e-02:8.2290000000e-02:8.2500000000e-02:8.2560000000e-02:8.2680000000e-02:8.2840000000e-02:8.5420000000e-02:8.7190000000e-02:1.0447000000e-01:1.1887000000e-01:1.8310000000e-01:2.6998000000e-01)

So it certainly looks like the RRDs are being written:

[root at mon smokeping]# ls -l cache/MTC/
total 132
- -rw-r--r--. 1 apache apache 29323 Jan 15 08:43 ASUSWifi_last_108000.png
- -rw-r--r--. 1 apache apache 26737 Jan 15 08:43 ASUSWifi_last_10800.png
- -rw-r--r--. 1 apache apache 26326 Jan 15 08:43 ASUSWifi_last_34560000.png
- -rw-r--r--. 1 apache apache 26224 Jan 15 08:43 ASUSWifi_last_864000.png
- -rw-r--r--. 1 apache apache    44 Jan 15 08:43 ASUSWifi.maxheight
- -rw-r--r--. 1 apache apache 11742 Jan 15 08:59 ASUSWifi_mini.png

8:43 being the time I ran that command this morning.

Here's the listing in /var/www/:

[root at mon var]# ls www/html/cache/ -l
total 28
drwxr-xr-x. 2 apache root 4096 Jan 14 13:08 __chartscache
drwxr-xr-x. 2 apache root 4096 Jan 14 10:27 MTC
drwxr-xr-x. 2 apache root 4096 Jan 15 09:07 __navcache
- -rw-r--r--. 1 apache root 3908 Jan 14 10:15 rrdtool.png
- -rw-r--r--. 1 apache root 4382 Jan 14 10:15 smokeping.png
drwxr-xr-x. 2 apache root 4096 Jan 14 10:15 Test
[root at mon var]# ls www/html/cache/MTC/
ASUSWifi_last_108000.png  ASUSWifi_last_10800.png
ASUSWifi_last_34560000.png  ASUSWifi_last_864000.png
ASUSWifi.maxheight  ASUSWifi_mini.png
[root at mon var]# ls www/html/cache/MTC/ -l
total 132
- -rw-r--r--. 1 apache root 29191 Jan 15 09:07 ASUSWifi_last_108000.png
- -rw-r--r--. 1 apache root 28220 Jan 15 09:07 ASUSWifi_last_10800.png
- -rw-r--r--. 1 apache root 25284 Jan 15 09:07 ASUSWifi_last_34560000.png
- -rw-r--r--. 1 apache root 26784 Jan 15 09:07 ASUSWifi_last_864000.png
- -rw-r--r--. 1 apache root    42 Jan 15 09:07 ASUSWifi.maxheight
- -rw-r--r--. 1 apache root 11542 Jan 15 09:07 ASUSWifi_mini.png

Now, by all rights, the apache user /should/ be able to read and
display the PNG file for the RRDtool and the SmokePing counter.  But
they are not showing up. I'm at a loss and getting in credibly
frustrated by this.  It should not be that hard to make this work.
I've used and configured apache dozens of times and this makes no
sense at all.




- -- 
Mark Haney
Network Administrator/IT Support
Practichem
W:919-714-8428
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS1pfsAAoJEDgEuzPE0JQvQMcH+gOWr6ZXL1GxtBvR37ecQHdq
V7QyrwBKc9vd5ebRx6b9Z3wpmuJIs/Ts77m8djZCiw1ILw+xOCj2SeShU60DjsZ5
D5vHhnwhTrrleqmoRF0p4hQ40WoEj+aKLm5y/qssB08Q73sgDDH6okKuRlaI3NKv
VJIQJWJBMmNHSs/G2sd8jB7rzSiRm8RtGygN3TFTLhjAdCs8IAPhbKRK9nYwxS5f
nDqwZZEUc2ii2CAPT0oVrfI1edYAxfQZEZ82ehOxLwML5EwskTBynsib05V4zweg
KHfvET98wYmisQCGkW8pAIkxPR8NNluPOwGu9bYpK7cRwYXcEdBvf0ZXDNWFjt8=
=McCX
-----END PGP SIGNATURE-----



More information about the smokeping-users mailing list