Thursday, April 24, 2008 at 3:56 pm by Brady Wilson
Smokeping on FreeBSD 7
This write-up assumes a working copy of FreeBSD 7.0. It was built using 7.0-RELEASE. It should work on FreeBSD 6.x-STABLE and future versions of FreeBSD 7. The package versions listed were current as of this writing but may have been updated by the time someone uses this howto.
This is a basic setup of Smokeping. There are many extra features that I do not touch on here such as multi-target graphs, alerting, slaves, agents and additional probe types. Check the online documentation for further info.
Please let me know if you run into typos or other technical issues when implementing this.
1.) First let’s update the ports collection.
Setup the update:
# cd /usr/ports/ports-mgmt/portupgrade
# make install clean
# cd /usr/ports/net/cvsup
# make install clean
# cp /usr/share/examples/cvsup/ports-supfile /root/ports-supfile
# pico /root/ports-supfile
Make it look something like this:
#######################################################
*default host=cvsup1.us.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
#comment the below line if you don't want to update the /src directory
#src-all
#update /usr/ports
ports-all tag=.
#######################################################
Run the update:
# cvsup -L 2 /root/ports-supfile
# portsdb -Uu
Update installed ports:
# portversion -l "<"
# portupgrade -arR
# pkgdb -F
2.) Install the necessary packages.
Descriptions of packages and uses here: http://oss.oetiker.ch/smokeping/doc/smokeping_install.en.html
Installed by default with FreeBSD install
# cd /usr/ports/databases/rrdtool
# make install clean
# cd /usr/ports/net/fping
# make install clean
# cd /usr/ports/net/echoping
# make install cleanInstalled by default with FreeBSD install
Socket6
# cpan
# install Socket6
Net:DNS
# install Net::DNS
# quit
# cd /usr/ports/www/apache22
# make install clean
# cd /usr/ports/www/p5-CGI-SpeedyCGI/
# make install clean
# cd /usr/ports/net-mgmt/smokeping
# make install clean
3.) Configure the packages.
# pico /usr/local/etc/apache22/httpd.conf
Add:
(within the <IfModule alias_module> section)
<Directory "/usr/local/smokeping/htdocs">Add:
(within the <IfModule dir_module> section)
Add smokeping.cgi after index.html on the DirectoryIndex line to allow smokeping.cgi to load as a default document.
It should look like:
DirectoryIndex index.html smokeping.cgiAllow the startup of Apache:
Add the following to /etc/rc.conf
apache22_enable="YES" # enable Apache 2.2Start Apache:
# /usr/local/etc/rc.d/apache22 startEdit the variables in the following files appropriately
# pico /usr/local/etc/smokeping/config
Variable example settings in the first section:
owner = Systems Administrator
contact = sysadmin@domain.com
mailhost = localhost
sendmail = /usr/sbin/sendmail
imgcache = /usr/local/smokeping/htdocs/img
imgurl = /smokeping/img
datadir = /usr/local/var/smokeping
piddir = /usr/local/var/smokeping
cgiurl = http://server.domain.com/smokeping/smokeping.cgi
smokemail = /usr/local/etc/smokeping/smokemail
tmail = /usr/local/etc/smokeping/tmail
*** Alerts ***
to = youraddress@yourdomain.com
from = smokealert@yourdomain.com
The “*** Targets ***” section is where you define your Smokeping targets and build the navigation menu. It is a little too in depth to cover here. Play around with it to figure out how it works.
In depth configuration info is here: http://oss.oetiker.ch/smokeping/doc/smokeping_config.en.html
There are some configuration samples here: http://oss.oetiker.ch/smokeping/doc/smokeping_examples.en.html
Verify the path to Speedy:
# pico /usr/local/smokeping/htdocs/smokeping.cgi
-first line pointing to full path of speedy
Customizations to the Smokeping web page templates can be made in the following config files:
/usr/local/etc/smokeping/smokemail
/usr/local/etc/smokeping/basepage.html
/usr/local/etc/smokeping/tmail
Set file system permissions to make the img folder and files writeable:
# find /usr/local/smokeping/htdocs/img -type d -exec chmod 777 {} \;
# find /usr/local/smokeping/htdocs/img -type f -exec chmod 666 {} \;
Allow the startup of Smokeping:
Add the following to /etc/rc.conf
Start Smokeping:
# /usr/local/etc/rc.d/smokeping start
Operational Notes:
index.html at /usr/local/www/apache22/data/
<meta http-equiv=”refresh” content=”0;url=http://www.someotherdomain.com”/>
This redirects traffic sent to the root of your server to a different domain since this traffic obviously doesn’t need to be hitting the Smokeping server.
#/usr/local/etc/rc.d/smokeping restart
Article Archives:
Installing MySQL4 and MySQL5 on a single FreeBSD 6.2 Server.
This write-up makes the following assumptions:
Working copy of FreeBSD 6.2.
Build: 6.2-RELEASE.
Which should work on 6.2-STABLE and 7.0 as well.
Please let me know if you run into typos or other technical issues when implementing this.
Download the latest binaries from mysql.com.
At write-up time this was:
mysql-5.0.45-freebsd6.0-i386.tar.gz
mysql-standard-4.1.22-unknown-freebsd6.0-i386.tar.gz
Install MySQL 4.
Uncompress the binary source.
# cd /usr/local
# gunzip < [...]
March 11th, 2008
opus:interactive garners new partnership with the MSP Alliance.
Who is the MSP Alliance?
The MSP Alliance’s accreditation program (MSAP) is the only best practices and standards-based program specifically created for the managed services industry.
The MSP Alliance is an organization who’s goal is to clarify the values and benefits of using Managed Service Providers, help companies improve the return on investment (ROI) in technology procurement [...]
February 26th, 2008
Put a Blade to these Servers and they bleed: for a cause.
February 5th, 2008
MCSE Boot Camp Studying Tricks & Tips
Looking for tips and tricks for passing your Microsoft Certified Systems Engineer exam? Take a moment and read this great entry that provides solid information that ensures that you will pass.
January 29th, 2008
Who’s keeping score?
I recently attended a Microsoft Certified Systems Engineer Boot Camp, put on by TECHPROS Group, in an attempt to obtain my MCSE. Yet, the certification wasn’t the only goal, I intended to meet all the criteria for the certification - in one week.
Back in August, I hopped on a plane from Portland, OR to [...]
December 9th, 2007
Article Comments: