{"id":2442,"date":"2016-08-22T00:00:17","date_gmt":"2016-08-22T07:00:17","guid":{"rendered":"http:\/\/192.168.3.4\/?p=2442"},"modified":"2018-01-09T06:50:18","modified_gmt":"2018-01-09T14:50:18","slug":"installing-and-configuring-smokeping-on-a-raspberry-pi","status":"publish","type":"post","link":"https:\/\/www.cloudacm.com\/?p=2442","title":{"rendered":"Installing and configuring SmokePing on a Raspberry Pi"},"content":{"rendered":"<p>These instructions are based from the blogs at <a href=\"http:\/\/www.myhomebroadband.com\/the-home-blog\/use-a-raspberry-pi-to-monitor-your-virgin-media-superhub\">MyHomeBroadband.com<\/a> and <a href=\"http:\/\/blog.kugelfish.com\/2013\/05\/raspberry-pi-internet-access-monitor.html\">kugelfish.com<\/a>.<\/p>\n<p>Install Smokeping onto the Pi<\/p>\n<p>The nice thing about these steps is they aren\u2019t confined to the Raspberry Pi. You can apply this to any Linux distribution. Open a terminal session and run the following command.<\/p>\n<pre>sudo apt-get install smokeping<\/pre>\n<p>The downloader has Apache included, however this was setup earlier when Webmin was installed. This appears to be a factor with some settings not being changed.<\/p>\n<p>Once downloaded, and installed, you need to change the config files, such as Targets and Probes . We\u2019ll also need to make some changes to Apache so it loads correctly.<\/p>\n<p>First I changed the Probes config, it can be found in the \/etc\/smokeping\/config.d\/ folder. I edit it with the following command.<\/p>\n<pre>sudo nano \/etc\/smokeping\/config.d\/Probes<\/pre>\n<p>Once the editor opens, I replaced the contents with the following information.<\/p>\n<p><em>*** Probes ***<\/em><\/p>\n<p><em>+ FPing<\/em><br \/>\n<em> binary = \/usr\/bin\/fping<\/em><br \/>\n<em> step = 300<\/em><br \/>\n<em> pings = 10<\/em><\/p>\n<p><em>+EchoPingDNS<\/em><br \/>\n<em> binary = \/usr\/bin\/echoping<\/em><br \/>\n<em> step = 300<\/em><br \/>\n<em> pings = 5<\/em><\/p>\n<p><em>+EchoPingHttp<\/em><br \/>\n<em> binary = \/usr\/bin\/echoping<\/em><br \/>\n<em> step = 300<\/em><br \/>\n<em> pings = 3<\/em><\/p>\n<p>I also verified that the binary arguments above were indeed correct.<\/p>\n<p>Next up, I modified the Targets config by entering in the following command.<\/p>\n<pre>sudo nano \/etc\/smokeping\/config.d\/Targets<\/pre>\n<p>This brings up the nano editor, in which I replaced the contents with the following.<\/p>\n<p>*** Targets ***<\/p>\n<p><em>probe = FPing<\/em><\/p>\n<p><em>menu = Top<\/em><br \/>\n<em> title = Using a Raspberry Pi and SmokePing to Monitor Networks<\/em><br \/>\n<em> remark = Latency to a few select sites and services in the Internet.<\/em><\/p>\n<p><em>+ Internet<\/em><br \/>\n<em> menu = Internet<\/em><br \/>\n<em> title = Outbound from the Pi to the Internet (using Ping)<\/em><\/p>\n<p><em>++ Google<\/em><br \/>\n<em> title = Google<\/em><br \/>\n<em> menu = Google<\/em><br \/>\n<em> host = www.google.com<\/em><\/p>\n<p><em>+ DNS<\/em><br \/>\n<em> menu = Measuring DNS response times<\/em><br \/>\n<em> title = Name Servers<\/em><\/p>\n<p><em>++ gdns<\/em><br \/>\n<em> title = Google public DNS<\/em><br \/>\n<em> menu = Google public DNS<\/em><br \/>\n<em> probe = EchoPingDNS<\/em><br \/>\n<em> dns_request = www.google.com<\/em><br \/>\n<em> host = 8.8.8.8<\/em><\/p>\n<p><em>+ Cloud<\/em><br \/>\n<em> menu = Cloud<\/em><br \/>\n<em> title = Response of well known Cloud Services<\/em><\/p>\n<p><em>++ CloudACM<\/em><br \/>\n<em> title = CloudACM<\/em><br \/>\n<em> menu = CloudACM<\/em><br \/>\n<em> probe = EchoPingHttp<\/em><br \/>\n<em> host = website_address<\/em><br \/>\n<em> port = 80<\/em><br \/>\n<em> url = \/path\/sub-path\/somefile.txt<\/em><\/p>\n<p>There is a sendmail option in the pathnames file that will need to be commented out. This may not be the case for all installs, but it was on mine. I ran the editor using the following command.<\/p>\n<pre>sudo nano \/etc\/smokeping\/config.d\/pathnames<\/pre>\n<p>The following entries were change to these values.<\/p>\n<p><em># sendmail = \/usr\/sbin\/sendmail<\/em><br \/>\n<em> imgcache = \/var\/cache\/smokeping\/images<\/em><br \/>\n<em> imgurl = ..\/smokeping\/images<\/em><br \/>\n<em> datadir = \/var\/lib\/smokeping<\/em><br \/>\n<em> piddir = \/var\/run\/smokeping<\/em><br \/>\n<em> smokemail = \/etc\/smokeping\/smokemail<\/em><br \/>\n<em> tmail = \/etc\/smokeping\/tmail<\/em><\/p>\n<p>You should now have Smokeping installed and configured. Since Apache was installed prior to Smokeping, some settings will need to be changed.<\/p>\n<p>Open up Webmin and go to Servers\/Apach Webserver. First, we\u2019ll need to remove any virtual host added from the Smokeping install. This should be the only thing listed.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2452\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_01.png\" alt=\"smokeping_01\" width=\"645\" height=\"86\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_01.png 645w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_01-300x40.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_01-604x81.png 604w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/a><\/p>\n<p>Next, open up the Default Server and verify that the Smokeping directoy exists. If it doesn\u2019t, we\u2019ll need to create it at the bottom of the page.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2454\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_02.png\" alt=\"smokeping_02\" width=\"164\" height=\"77\" \/><\/a><\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2455\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_03.png\" alt=\"smokeping_03\" width=\"461\" height=\"148\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_03.png 461w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_03-300x96.png 300w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Next up are the Aliases, click the link in the Virtual Server Options page.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_04.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2458\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_04.png\" alt=\"smokeping_04\" width=\"135\" height=\"70\" \/><\/a><\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_05.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2459\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_05.png\" alt=\"smokeping_05\" width=\"533\" height=\"125\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_05.png 533w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_05-300x70.png 300w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>If the alias isn\u2019t listed, enter it in at the next available field.<\/p>\n<p>Next up is setting the cgid service to a running state. For some reason my instance did not have it running. To do this go back to the main Apache Webserver page and select the Global configuration tab.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_06.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2463\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_06.png\" alt=\"smokeping_06\" width=\"549\" height=\"269\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_06.png 549w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_06-300x147.png 300w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Choose the Configure Apache Modules icon<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2467\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_07.png\" alt=\"smokeping_07\" width=\"119\" height=\"94\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Scroll down to the cgid check box, select it and scroll to the bottom of the page to the Enable Selected Modules button. Press it to enable the cgid service.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_08.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2469\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_08.png\" alt=\"smokeping_08\" width=\"348\" height=\"30\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_08.png 348w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_08-300x26.png 300w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_09.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2470\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_09.png\" alt=\"smokeping_09\" width=\"175\" height=\"41\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>To activate all of these changes, it is much easier to reboot the system with Webmin. You can do this by going to System\/Bootup and Shutdown and scrolling to the bottom of the page and pressing the Reboot System button. You\u2019ll be prompted again to reboot.<\/p>\n<p>Once the system reboots, type in the following to your favourite web browser:<\/p>\n<p>http:\/\/\/cgi-bin\/smokeping.cgi?<\/p>\n<p>That should be it, you should get a web page up, and some links down the side-click on them. The page should update itself automatically every minute, so no need to refresh. Have a play, leave it for 30 mins or so, and you should see the graphs update themselves.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2472\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_10.png\" alt=\"smokeping_10\" width=\"697\" height=\"315\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_10.png 697w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_10-300x136.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_10-597x270.png 597w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/a><\/p>\n<p>Adding targets and modifying existing<\/p>\n<p>It\u2019s difficult to define all the targets at before and during the installation of SmokePing. More often than not, you will want change the hosts you are graphing. Adding new hosts isn\u2019t a difficult task, but there is a caveat when doing so.<\/p>\n<p>First off, the Targets file that defines the host to ping has a structure to it that Smokeping uses to do things in the background. These background processes create RRDs (Round Robin Databases), plot the data from the RRDs into an image file (.png), and represent the image data on a web front end. As you might have seen, the structure of the Targets information is seen on the web front end. Here\u2019s an example of one host defined in the Targets file.<\/p>\n<p><em>+ Lab<\/em><br \/>\n<em> menu = LabMenu<\/em><br \/>\n<em> title = These are hosts for testing Smokeping<\/em><\/p>\n<p><em>++ IdentifierIten<\/em><br \/>\n<em> title = TitleItem<\/em><br \/>\n<em> menu = MenuItem<\/em><br \/>\n<em> host = host_ip_address<\/em><\/p>\n<p>When looking at the web front end, some of the text entered above appears in the web pages, while other text appears inside the image itself.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2476\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_11.png\" alt=\"smokeping_11\" width=\"911\" height=\"302\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_11.png 911w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_11-300x99.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_11-768x255.png 768w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_11-604x200.png 604w\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" \/><\/a><\/p>\n<p>Clicking on the MenuItem drills down to series of historical graphs. The graph above is an overview of the host with minimal information. The graph below has more detail about the host results.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2478\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/08\/smokeping_12.png\" alt=\"smokeping_12\" width=\"911\" height=\"412\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_12.png 911w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_12-300x136.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_12-768x347.png 768w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/08\/smokeping_12-597x270.png 597w\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" \/><\/a><\/p>\n<p>Since there is a dependency on the target definitions that Smokeping uses to create and process, some guidelines should be followed when defining the hosts in the Targets file.<\/p>\n<p>No spaces in the Title<br \/>\nNo special characters, ie. $%&amp;\u2026<br \/>\nUse Camel Case or Underscores, ie. CamelCase, Camel_Case, etc\u2026<br \/>\nKeep them short<\/p>\n<p>If these guidelines are followed, many unusual graphing issues can be avoided.<\/p>\n<p>Credit<\/p>\n<p>In large part, this post owes much of the information to Calomel.org for providing information about this topic, <a href=\"https:\/\/calomel.org\/smokeping.html\">https:\/\/calomel.org\/smokeping.html<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These instructions are based from the blogs at MyHomeBroadband.com and kugelfish.com. Install Smokeping onto the Pi The nice thing about these steps is they aren\u2019t confined to the Raspberry Pi. You can apply this to any Linux distribution. Open a terminal session and run the following command. sudo apt-get install smokeping The downloader has Apache included, however this was setup earlier when Webmin was installed. This appears to be a factor with some settings not being changed. Once downloaded, and&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.cloudacm.com\/?p=2442\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2442","post","type-post","status-publish","format-standard","hentry","category-rd"],"_links":{"self":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2442"}],"version-history":[{"count":24,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2442\/revisions"}],"predecessor-version":[{"id":2503,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2442\/revisions\/2503"}],"wp:attachment":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}