SmokePing installation worksheet

AfNOG 2011 sse


Install SmokePing from ports:

cd /usr/ports/net-mgmt/smokeping


make


add curl probes


hit ok


SmokePing will download (slowly) and build (quickly) since it's perl


make install


will install and will also pull in cgi-speedy


The installation provides additional information about what is required for installation, we will use this information along with knowledge of our local situation to proceed with installation.


SmokePing has now been installed in /usr/local/smokeping/.


NOTE: A set of sample configuration files have been installed:


/usr/local/etc/smokeping/config

/usr/local/etc/smokeping/smokemail

/usr/local/etc/smokeping/basepage.html

/usr/local/etc/smokeping/tmail


You *MUST* edit these to suit your requirements. Please read the

manpages 'smokeping_install' and 'smokeping_config' for further

details on installation and configuration.


If you are upgrading from a previous version of Smokeping, the

manpage 'smokeping_upgrade' may be of help.


Once configured, you can start SmokePing by adding:


smokeping_enable="YES"


to /etc/rc.conf, and then running, as root:


/usr/local/etc/rc.d/smokeping start


To enable Apache web access, add something like the following to

your /usr/local/etc/apache/httpd.conf:


DocumentRoot /usr/local/smokeping/htdocs

ScriptAlias /smokeping.cgi /usr/local/smokeping/htdocs/smokeping.cgi

ScriptAlias /tr.cgi /usr/local/smokeping/htdocs/tr.cgi


Enjoy!


Our Next step is create the insertion point where the application becomes available to our webserver.


cd /usr/local/www/apache22/data/

ln -s /usr/local/smokeping/htdocs/ smokeping


Then we need to adjust the configuration to suit our local evironment and disable the example probes


cd /usr/local/etc/smokeping


use an editor to change the config file.


change:


owner = Peter Random

contact = some@address.nowhere

mailhost = my.mail.host


as appropriate.


Set


sendmail = /usr/lib/sendmail


to


sendmail = /usr/sbin/sendmail


Change alerts to something appropriate


to = alertee@address.somewhere

from = smokealert@company.xy


Around line 111, comment out the example slaves


#*** Slaves ***

#secrets=/home/oetiker/checkouts/smokeping/trunk/software/etc/smokeping_secrets.dist

#+boomer

#display_name=boomer

#color=0000ff


#+slave2

#display_name=another

#color=00ff00


Comment out the two example hosts starting at line 133


#++ James

#

#menu = James

#title =James

#alerts = someloss

#slaves = boomer slave2

#host = james.address

#

#++ MultiHost

#

#menu = Multihost

#title = James and James as seen from Boomer

#host = /Test/James /Test/James~boomer


create a new probe:


++ myserver

menu = myserver

title = myserver

alerts = someloss

host = 196.200.219.xx 


where xx is myservers ip address


save the file.


We need to enabled the smokeping daemon and start it.


Edit the rc.conf


vi /etc/rc.conf


append: 


smokeping_enable="YES"


then start the application


usr/local/etc/rc.d/smokeping start


We should now be able to connect to our webserver at:


http://hostname/smokeping/smokeping.cgi


where hostname is our servers hostname and see our smokeping with our first probe in it... The probes run every 5 minutes by default.


Lets add an http probe that uses curl


edit


/usr/local/etc/smokeping/config


again


In the probes section add a new probe:


+ Curl

# probe-specific variables

binary = /usr/local/bin/curl

step = 60


In the targets section add a new target


++ myserver-http

menu = myserver-http

alerts = someloss

probe =     Curl

host = 196.200.219.xxx

urlformat = http://%host%/


save the file


reload the smokeping daemon


visit the smokeping webpage to see the results of the new probe.