<p dir="ltr">Make sure that your Apache and SmokePing users can read/write the directory where the data is stored. There was just some discussion about a day ago on this list about that very issue. Look back and I'm sure you can find it ;)</p>
<div class="gmail_quote">On Jan 15, 2014 9:15 AM, "Mark Haney" <<a href="mailto:mhaney@practichem.com">mhaney@practichem.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
On 1/14/2014 4:03 PM, Gregory Sloop wrote:<br>
> [Top posting]<br>
><br>
> Here's the FAQ:<br>
><br>
> <a href="https://github.com/oetiker/SmokePing/issues/11" target="_blank">https://github.com/oetiker/SmokePing/issues/11</a><br>
<br>
><br>
> 1) Data not reaching the RRD [round robin databases] Run smokeping<br>
> in debug mode and watch what it says - you'll probably find some<br>
> good reasons stuff isn't working and be able to fix it yourself.<br>
> Like this: smokeping --debug<br>
><br>
> 2) Data is hitting the RRD's as confirmed by --debug. However, you<br>
> still get an empty graph from the browser.<br>
><br>
> You see: the user smokeping is running as, is writing the data -<br>
> that's often root or smokeping. However, the thing that's creating<br>
> the graphs has to read the data - and that's whatever process your<br>
> web-server is running as. That's often apache or www, httpd or<br>
> www-data.<br>
><br>
> [It depends on the apache [or how your distro sets it]<br>
> configuration - or whatever other web-server you're using.]<br>
><br>
> So, make sure that both the user smokeping is running as, as well<br>
> as the user the web-server is running as, both have rights to the<br>
> RRD's. [If you aren't sure what apache is running at, have a look<br>
> at the apache config files. For example Ubuntu 12.04 has the user<br>
> in /etc/apache2/envvars - and the user is www-data.]<br>
><br>
> So, to spoon-feed you - you'll need to chown the files to something<br>
> like: chown smokeping:www-data some-rrd-files*.rrd<br>
><br>
> -Greg<br>
<br>
First off, it's not just the images of the graphs I'm not getting, I'm<br>
also not getting the counter image, nor the RRDtool image. I get the<br>
same broken image in their place. So it's not a read/write issue with<br>
only the graphs.<br>
<br>
Let me show you what I have setup: (smokeping is run as root and<br>
apache is the httpd user (I'm on CentOS 6.5).<br>
<br>
<br>
[root@mon smokeping]# ls -l<br>
total 36<br>
drwxr-xr-x. 2 root root 4096 Jan 14 09:58 bin<br>
lrwxrwxrwx. 1 apache root 20 Jan 14 10:07 cache -> /var/www/html/cache/<br>
drwxrwxrw-. 5 apache root 4096 Jan 14 10:27 data<br>
drwxr-xr-x. 3 root root 4096 Jan 14 13:02 etc<br>
drwxr-xr-x. 3 root root 4096 Jan 14 09:58 htdocs<br>
drwxr-xr-x. 3 root root 4096 Jan 14 09:58 lib<br>
drwxr-xr-x. 3 root root 4096 Jan 14 09:58 share<br>
- -rw-r--r--. 1 root root 302 Jan 14 13:06 smoke.log<br>
drwxr-xr-x. 6 root root 4096 Jan 14 09:57 thirdparty<br>
drwxr-xr-x. 2 root root 4096 Jan 14 10:07 var<br>
<br>
When I run smokeping with --debug I get this:<br>
<br>
[root@mon smokeping]# ./bin/smokeping --debug<br>
### Compiling alert detector pattern 'someloss'<br>
### >0%,*12*,>0%,*12*,>0%<br>
sub {<br>
my $d = shift;<br>
my $y = $d->{loss};<br>
for(1){<br>
my $imax2 = min(@$y - 3, 12);<br>
my $imax1 = min(@$y - 3, 12);<br>
my $minlength = 3;<br>
my $maxlength = 27;<br>
next if scalar @$y < $minlength ;<br>
my $i1;<br>
for($i1=0; $i1 < min($maxlength,$imax1); $i1++){<br>
my $i2;<br>
for($i2=0; $i2 < min($maxlength-$i1,$imax2); $i2++){<br>
next unless defined $y->[-3-$i1-$i2]<br>
and $y->[-3-$i1-$i2] =~ /^\d/<br>
and $y->[-3-$i1-$i2] > 0<br>
; last;<br>
}<br>
return 0 if $i2 >= min($maxlength-$i1-$i2,$imax2);<br>
next unless defined $y->[-2-$i1]<br>
and $y->[-2-$i1] =~ /^\d/<br>
and $y->[-2-$i1] > 0<br>
; last;<br>
}<br>
return 0 if $i1 >= min($maxlength-$i1,$imax1);<br>
next unless defined $y->[-1]<br>
and $y->[-1] =~ /^\d/<br>
and $y->[-1] > 0<br>
; return 1;<br>
}<br>
return 0;<br>
}<br>
<br>
<br>
<br>
Smokeping version 2.006009 successfully launched.<br>
Not entering multiprocess mode with '--debug'. Use '--debug-daemon'<br>
for that.<br>
FPing: probing 1 targets with step 300 s and offset 241 s.<br>
FPing: Executing /usr/sbin/fping -C 20 -q -B1 -r1 -i10 66.188.99.174<br>
FPing: Got fping output: '66.188.99.174 : 269.98 183.10 81.46 118.87<br>
82.20 79.97 85.42 81.77 82.68 82.11 82.29 87.19 80.58 82.50 82.84<br>
82.56 80.92 80.20 81.37 104.47'<br>
Calling RRDs::update(/opt/smokeping/data/MTC/ASUSWifi.rrd --template<br>
uptime:loss:median:ping1:ping2:ping3:ping4:ping5:ping6:ping7:ping8:ping9:ping10:ping11:ping12:ping13:ping14:ping15:ping16:ping17:ping18:ping19:ping20<br>
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)<br>
<br>
So it certainly looks like the RRDs are being written:<br>
<br>
[root@mon smokeping]# ls -l cache/MTC/<br>
total 132<br>
- -rw-r--r--. 1 apache apache 29323 Jan 15 08:43 ASUSWifi_last_108000.png<br>
- -rw-r--r--. 1 apache apache 26737 Jan 15 08:43 ASUSWifi_last_10800.png<br>
- -rw-r--r--. 1 apache apache 26326 Jan 15 08:43 ASUSWifi_last_34560000.png<br>
- -rw-r--r--. 1 apache apache 26224 Jan 15 08:43 ASUSWifi_last_864000.png<br>
- -rw-r--r--. 1 apache apache 44 Jan 15 08:43 ASUSWifi.maxheight<br>
- -rw-r--r--. 1 apache apache 11742 Jan 15 08:59 ASUSWifi_mini.png<br>
<br>
8:43 being the time I ran that command this morning.<br>
<br>
Here's the listing in /var/www/:<br>
<br>
[root@mon var]# ls www/html/cache/ -l<br>
total 28<br>
drwxr-xr-x. 2 apache root 4096 Jan 14 13:08 __chartscache<br>
drwxr-xr-x. 2 apache root 4096 Jan 14 10:27 MTC<br>
drwxr-xr-x. 2 apache root 4096 Jan 15 09:07 __navcache<br>
- -rw-r--r--. 1 apache root 3908 Jan 14 10:15 rrdtool.png<br>
- -rw-r--r--. 1 apache root 4382 Jan 14 10:15 smokeping.png<br>
drwxr-xr-x. 2 apache root 4096 Jan 14 10:15 Test<br>
[root@mon var]# ls www/html/cache/MTC/<br>
ASUSWifi_last_108000.png ASUSWifi_last_10800.png<br>
ASUSWifi_last_34560000.png ASUSWifi_last_864000.png<br>
ASUSWifi.maxheight ASUSWifi_mini.png<br>
[root@mon var]# ls www/html/cache/MTC/ -l<br>
total 132<br>
- -rw-r--r--. 1 apache root 29191 Jan 15 09:07 ASUSWifi_last_108000.png<br>
- -rw-r--r--. 1 apache root 28220 Jan 15 09:07 ASUSWifi_last_10800.png<br>
- -rw-r--r--. 1 apache root 25284 Jan 15 09:07 ASUSWifi_last_34560000.png<br>
- -rw-r--r--. 1 apache root 26784 Jan 15 09:07 ASUSWifi_last_864000.png<br>
- -rw-r--r--. 1 apache root 42 Jan 15 09:07 ASUSWifi.maxheight<br>
- -rw-r--r--. 1 apache root 11542 Jan 15 09:07 ASUSWifi_mini.png<br>
<br>
Now, by all rights, the apache user /should/ be able to read and<br>
display the PNG file for the RRDtool and the SmokePing counter. But<br>
they are not showing up. I'm at a loss and getting in credibly<br>
frustrated by this. It should not be that hard to make this work.<br>
I've used and configured apache dozens of times and this makes no<br>
sense at all.<br>
<br>
<br>
<br>
<br>
- --<br>
Mark Haney<br>
Network Administrator/IT Support<br>
Practichem<br>
W:919-714-8428<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2.0.22 (MingW32)<br>
Comment: Using GnuPG with Thunderbird - <a href="http://www.enigmail.net/" target="_blank">http://www.enigmail.net/</a><br>
<br>
iQEcBAEBAgAGBQJS1pfsAAoJEDgEuzPE0JQvQMcH+gOWr6ZXL1GxtBvR37ecQHdq<br>
V7QyrwBKc9vd5ebRx6b9Z3wpmuJIs/Ts77m8djZCiw1ILw+xOCj2SeShU60DjsZ5<br>
D5vHhnwhTrrleqmoRF0p4hQ40WoEj+aKLm5y/qssB08Q73sgDDH6okKuRlaI3NKv<br>
VJIQJWJBMmNHSs/G2sd8jB7rzSiRm8RtGygN3TFTLhjAdCs8IAPhbKRK9nYwxS5f<br>
nDqwZZEUc2ii2CAPT0oVrfI1edYAxfQZEZ82ehOxLwML5EwskTBynsib05V4zweg<br>
KHfvET98wYmisQCGkW8pAIkxPR8NNluPOwGu9bYpK7cRwYXcEdBvf0ZXDNWFjt8=<br>
=McCX<br>
-----END PGP SIGNATURE-----<br>
<br>
_______________________________________________<br>
smokeping-users mailing list<br>
<a href="mailto:smokeping-users@lists.oetiker.ch">smokeping-users@lists.oetiker.ch</a><br>
<a href="https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users" target="_blank">https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users</a><br>
</blockquote></div>