Monitoring Network Latency With Smokeping (Ubuntu 9.04) - Page 2

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Tue, 2009-07-14 17:18. ::

3.2 Advanced Example

Until now, we are only pinging servers, but it would be good if we could do some other tests as well (e.g. measure how fast a DNS server resolves a domain or measure HTTP latency). Therefore we open /etc/smokeping/config.d/Probes and add the following section.

vi /etc/smokeping/config.d/Probes

[...]
+ DNS
binary = /usr/bin/dig
lookup = domain-to-lookup.com
pings = 5
step = 180

+ Curl
# probe-specific variables
binary = /usr/bin/curl
step = 60

# a default for this target-specific variable
urlformat = http://%host%/

As you see, we've now added tests for DNS (the lookup line should contain a domain/hostname that you'd like the name servers (that we still have to configure in Smokeping) to look up) and HTTP / FTP (using Curl).

Now at the end of /etc/smokeping/config.d/Targets, we can add the name servers / HTTP servers / FTP servers we'd like to monitor (you can enable/disable tests by uncommenting them/commenting them out):

vi /etc/smokeping/config.d/Targets

[...]
+ services
menu = Service Latency
title = Service Latency (DNS, HTTP)

++ DNS
probe = DNS
menu = DNS Latency
title = DNS Latency

+++ dns1
host = ns1.example.com

+++ dns2
host = ns2.example.com

++ HTTP
probe = Curl
menu = HTTP Latency
title = HTTP Latency

+++ server1
menu = server1
title = HTTP Latency for server1
host = server1.example.com

+++ server2
menu = server2
title = HTTP Latency for server2
host = server2.example.com

#+++ server3
#menu = server3
#title = HTTP Latency for server3 (port 8080!)
#host = server3.example
#urlformat = http://%host%:8080/

#++ FTP
#probe = Curl
#menu = FTP Latency
#title = FTP Latency
#urlformat = ftp://%host%/

#+++ server1
#menu = server1
#title = FTP Latency for server1
#host = server1.example.com

#+++ server2
#menu = server2
#title = FTP Latency for server2
#host = server2.example.com

As you see, we are monitoring the name servers ns1.example.com and ns2.example.com using the DNS probe we've configured in /etc/smokeping/config.d/Probes. We are also measuring the HTTP latency of server1.example.com and server2.example.com by using the Curl probe. If you like, you can also measure FTP latency using the Curl probe, but make sure that you specify a new urlformat for the FTP section (the default, urlformat = http://%host%/, is configured in /etc/smokeping/config.d/Probes; for FTP it should be urlformat = ftp://%host%/).

Restart Smokeping after your changes:

/etc/init.d/smokeping restart

After a few minutes, you should see some data for your new tests in the Smokeping web interface (http://www.example.com/cgi-bin/smokeping.cgi):

You can read up on the Smokeping configuration and further configuration examples here: http://oss.oetiker.ch/smokeping/doc/smokeping_examples.en.html

 

4 Debugging

If you think that Smokeping isn't working as expected, you can try to find the problem by running Smokeping in debug mode:

/etc/init.d/smokeping stop
smokeping --debug

 

5 Links


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Sat, 2012-04-21 00:14.

How do you configure smokeping to just send 1 email for the packet loss? Maybe it's not possible. We're trying to dial up the samples so that we can trap tiny increments of loss on our WAN. I've dialed the database down to a check every 15 seconds, but if loss occurs it looks like I will get an email every 15 seconds until I get to fixing it or stopping the daemon.

 Any suggestions?

Submitted by Kris (not registered) on Thu, 2009-10-01 23:32.

Dear,

 Step 2 in your howto (aptitude install smokeping curl libauthen-radius-perl libnet-ldap-perl libnet-dns-perl libio-socket-ssl-perl libnet-telnet-perl libsocket6-perl libio-socket-inet6-perl apache2) doesn't work with me :

 root@ubuntu:~# aptitude install smokeping curl libauthen-radius-perl libnet-ldap-perl libnet-dns-perl libio-socket-ssl-perl libnet-telnet-perl libsocket6-perl libio-socket-inet6-perl apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Couldn't find any package whose name or description matched "smokeping"
Couldn't find any package whose name or description matched "libauthen-radius-perl"
No candidate version found for libio-socket-ssl-perl
Couldn't find any package whose name or description matched "smokeping"
Couldn't find any package whose name or description matched "libauthen-radius-perl"
No candidate version found for libio-socket-ssl-perl
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done

 

What do i have to edit?

Submitted by Josh Richards (not registered) on Sat, 2009-10-24 04:55.
Kris - Uncomment the universe line(s) in /etc/apt/sources.list then "aptitude update" then attempt to install again.
Submitted by Peter Hickman (not registered) on Thu, 2009-07-16 13:34.

Nice try but the full site names are available in the browser window => ns10.projektfarm.com

Not that it is a problem, how long do you thing a few Xs over the text would have added to finding that information out?

 Just black it out next time