Friday, January 20, 2017

Linux | Network Latency Grapher (Smokeping)

I have been configuring Smokeping, It's actually network latency Grapher. If you want to monitor website or host you can use It. Let's stat and you should follow below steps:

Platform: Ubuntu Server 14.04
Installation:-


Step 01: First of all log in to your server as root and make sure that all packages are up to date.

      apt-get update
      apt-get upgrade


Step 02: Install smokeping package.
 

     apt-get install smokeping

Step 03: Link in the smokeping apache config (apache2 was installed above as a req for smokeping)

      cd /etc/apache2/conf-available
      ln -s ../../smokeping/apache2.conf smokeping.conf

Step 04: Enable the config and mod_cgi

       a2enconf smokeping
       a2enmod cgid
 

     service apache2 restart

Configuration:-

Step 05: Edit the General Config file
 

     vim /etc/smokeping/config.d/General 

===========================================================================================================
 *** General ***

owner    = ABC ICT
contact  = abc@abcict.com

mailhost = my.mail.host
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed ... this is not
# good for images.
cgiurl   = http://192.168.0.5/cgi-bin/smokeping.cgi
# specify this to get syslog logging
syslogfacility = local0
# each probe is now run in its own process
# disable this to revert to the old behaviour
# concurrentprobes = no

@include /etc/smokeping/config.d/pathnames

===========================================================================================================
Step 06: Edit the pathnames file. You must put in a value for sendmail (If you don't have it) so that smoke ping will run.

    vim /etc/smokeping/config.d/pathnames

===========================================================================================================
sendmail = /bin/false
imgcache = /var/cache/smokeping/images
imgurl   = ../smokeping/images
datadir  = /var/lib/smokeping
piddir  = /var/run/smokeping
smokemail = /etc/smokeping/smokemail
tmail = /etc/smokeping/tmail

===========================================================================================================
Step 07: Edit the Alerts:

    vim /etc/smokeping/config.d/Alerts

===========================================================================================================
 *** Alerts ***
to = abc@abcict.com
from = smokeping@abcict.com

+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times  in a row

===========================================================================================================
Step 09: Edit the Targets
Add your own targets that you will measure by appending them to the bottom of the targets file.These will show up in a menu on the left of the generated web page. You add an entry starting with a + to create a top level entry, and subsequent lines with ++ that will show up as sub entries like so:

Actual config requires a few extra lines, as below:

     vim /etc/smokeping/config.d/Targets 
===========================================================================================================
*** Targets ***

probe = FPing

menu = Top
title = Network Latency Grapher
remark = Maintain by Saikat Majumder

+ Website
menu = All website
title = All website

++ Google
menu = Google
title = Google
host = www.google.com

++ Gmail
menu = Gmail
title = Gmail
host = www.gmail.com

++ Yahoo
menu = Yahoo
title = Yahoo
host = www.yahoo.com

++ Yahoo_Mail
menu = Yahoo_Mail
title = Yahoo_Mail
host = www.yahoomail.com

+ Local
menu = IP Address
title = IP Address

++ Saikat_PC
menu = Saikat_PC
title = Saikat_PC
host = 192.168.0.3

===========================================================================================================
Step 10: Restart smokeping and apache:

    service smokeping restart
    service apache2 reload 


Step 11: Access smokeping:

    http://192.168.0.5/cgi-bin/smokeping.cgi





Congratulation’s! You have successfully 

END