Setting up Smokeping: Difference between revisions

From Alpine Linux
m (cleanup after another proofreading)
(more complete working guide)
 
(14 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== Setting up Smokeping to Monitor Network Latency==
{{Warning|This material have several security craps and breaks, and are here only due historical purposes, will be reorganized, please dont deploy production servers with this guide }}


<b> Smokeping and Smoketrace setup </b>
Smokeping is a network latency monitor webapp. <br /><br />
 
Install smokeping and lighttpd from main repository.
Add edge/testing repository to install smokeping
{{Cmd|apk add smokeping lighttpd}}
 
In lighttpd.conf uncomment line: include "mod_cgi.conf", save and exit <br /><br />
Install lighttpd, then in lighttpd.conf uncomment line: include "mod_cgi.conf", save and exit <br /><br />
Assign cgi to run with /usr/bin/perl in /etc/lighttpd/mod_cgi.conf (by default it's only in cgi-bin virtual host): <br />
Assign cgi to run with /usr/bin/perl in /etc/lighttpd/mod_cgi.conf (by default it's only in cgi-bin virtual host): <br />
  cgi.assign = (
  cgi.assign = (
  ".cgi" => "/usr/bin/perl"
  ".cgi" => "/usr/bin/perl"
  )
  )
And uncomment the use of mod.cgi in  /etc/lighttpd/lighttpd.conf.
=== FastCGI Support ===
Smokeping is slow, and fastcgi can help , especially on constrained devices.
''install''
{{Cmd|apk add perl-fcgi}}
''lighttpd.conf:''
  include "mod_fastcgi.conf"
''mod_fastcgi.conf:''
  server.modules += ("mod_fastcgi")
  fastcgi.server = (
          ".fcgi" =>
          ((
                  "bin-path" => "/usr/share/webapps/smokeping/smokeping.fcgi",
                  "host" => "localhost",
                  "port" => 8001,
          )),
  )
== Setup URLs for Smokeping ==


Softlink /usr/share/webapps/smokeping -> /var/www/localhost/htdocs/smokeping<br />
Softlink /usr/share/webapps/smokeping -> /var/www/localhost/htdocs/smokeping<br />
ln -s /usr/share/webapps/smokeping /var/www/localhost/htdocs/smokeping
{{Cmd|ln -s /usr/share/webapps/smokeping /var/www/localhost/htdocs/smokeping}}
Softlink /var/lib/smokeping/.simg -> /var/www/localhost/htdocs/img<br />
Softlink /var/lib/smokeping/.simg -> /var/www/localhost/htdocs/img<br />
ln -s /var/lib/smokeping/.simg /var/www/localhost/htdocs/img
{{Cmd|ln -s /var/lib/smokeping/.simg /var/www/localhost/htdocs/img}}
 
Make /smokeping/ work
''lighttpd.conf'':
  index-file.names    = ("smokeping.fcgi", "smokeping.cgi", "index.php", "index.html", "index.htm", "default.htm")


Edit /usr/share/perl5/vendor_perl/Qooxdoo/Services/Tr.pm and on line 34: add "sudo", to beginning so that line looks like:<br />
== Setup Probes & Permissions ==
If using a version of Alpine older than 2.1_rc2, edit /usr/share/perl5/vendor_perl/Qooxdoo/Services/Tr.pm and on line 34: add "sudo", to beginning so that line looks like:<br />
  system "sudo","traceroute","-I","-q","1",$host;
  system "sudo","traceroute","-I","-q","1",$host;
This is because in Alpine, regular user can't run a traceroute
This is because in Alpine, regular user can't run a traceroute
Line 24: Line 52:


Change permissions on /var/lib/smokeping/.simg to 777. <br />
Change permissions on /var/lib/smokeping/.simg to 777. <br />
chmod 777 /var/lib/smokeping/.simg
{{Cmd|chmod 777 /var/lib/smokeping/.simg}}
Set fping to using setuid:<br />  
Set fping to using setuid:<br />  
chmod u+s /usr/sbin/fping
{{Cmd|chmod u+s /usr/sbin/fping}}
 
== Configure Targets ==
Add hosts to be monitored in /etc/smokeping/config and remove example hosts<br />
Add hosts to be monitored in /etc/smokeping/config and remove example hosts<br />
The cache configured must be linked to /var/www/localhost/htdocs/smokeping/cache<br />
== Activate Smokeping Service at Boot ==
Set lighttpd to autostart and start the daemon.<br />
{{Cmd|rc-update add lighttpd && rc-service lighttpd start}}
Set smokeping to autostart and start the daemon.<br />
{{Cmd|rc-update add smokeping && rc-service smokeping start}}
<br />
<br />
For further information on configuration, see the smokeping homepage http://oss.oetiker.ch/smokeping/doc/index.en.html.
For further information on configuration, see the smokeping homepage https://oss.oetiker.ch/smokeping/doc/index.en.html.
 
[[Category:Monitoring]]

Latest revision as of 03:41, 11 November 2024

Warning: This material have several security craps and breaks, and are here only due historical purposes, will be reorganized, please dont deploy production servers with this guide


Smokeping is a network latency monitor webapp.

Install smokeping and lighttpd from main repository.

apk add smokeping lighttpd

In lighttpd.conf uncomment line: include "mod_cgi.conf", save and exit

Assign cgi to run with /usr/bin/perl in /etc/lighttpd/mod_cgi.conf (by default it's only in cgi-bin virtual host):

cgi.assign = (
".cgi" => "/usr/bin/perl"
)

And uncomment the use of mod.cgi in /etc/lighttpd/lighttpd.conf.

FastCGI Support

Smokeping is slow, and fastcgi can help , especially on constrained devices.

install

apk add perl-fcgi

lighttpd.conf:

 include "mod_fastcgi.conf"

mod_fastcgi.conf:

 server.modules += ("mod_fastcgi")
 fastcgi.server = (
         ".fcgi" =>
         ((
                 "bin-path" => "/usr/share/webapps/smokeping/smokeping.fcgi",
                 "host" => "localhost",
                 "port" => 8001,
         )),
 )

Setup URLs for Smokeping

Softlink /usr/share/webapps/smokeping -> /var/www/localhost/htdocs/smokeping

ln -s /usr/share/webapps/smokeping /var/www/localhost/htdocs/smokeping

Softlink /var/lib/smokeping/.simg -> /var/www/localhost/htdocs/img

ln -s /var/lib/smokeping/.simg /var/www/localhost/htdocs/img

Make /smokeping/ work lighttpd.conf:

 index-file.names     = ("smokeping.fcgi", "smokeping.cgi", "index.php", "index.html", "index.htm", "default.htm")

Setup Probes & Permissions

If using a version of Alpine older than 2.1_rc2, edit /usr/share/perl5/vendor_perl/Qooxdoo/Services/Tr.pm and on line 34: add "sudo", to beginning so that line looks like:

system "sudo","traceroute","-I","-q","1",$host;

This is because in Alpine, regular user can't run a traceroute

Add sudo package, then add the following to /etc/sudoers using visudo command:

lighttpd ALL=(ALL) NOPASSWD: /usr/bin/traceroute

Change permissions on /var/lib/smokeping/.simg to 777.

chmod 777 /var/lib/smokeping/.simg

Set fping to using setuid:

chmod u+s /usr/sbin/fping

Configure Targets

Add hosts to be monitored in /etc/smokeping/config and remove example hosts
The cache configured must be linked to /var/www/localhost/htdocs/smokeping/cache

Activate Smokeping Service at Boot

Set lighttpd to autostart and start the daemon.

rc-update add lighttpd && rc-service lighttpd start

Set smokeping to autostart and start the daemon.

rc-update add smokeping && rc-service smokeping start


For further information on configuration, see the smokeping homepage https://oss.oetiker.ch/smokeping/doc/index.en.html.