Smokeping

Barry O'Donovan edited this page May 23, 2017 · 14 revisions

DEPRECATED IN V4: please use the new framework for this - see here

Smokeping is a great tool for monitoring network latency.

While it should never be used as a tool for monitoring IXP latency (as routers de-prioritise ICMP requests and handle them in their management plane, it acts more of a indication of the router load than the latency of the exchange fabric), it can be a useful tool for identifying and diagnosing other customer / member issues.

IXP Manager can configure Smokeping to monitor member routers and display those graphs in member statistic pages. Presuming it is installed.

IXP Manager Configuration

Add the following to your application.ini and alter as appropriate:

;; destination file for the configuration. If not set, the generator sends it to stdout
;smokeping.conf.dstfile = '/etc/smokeping/config'

;; Complete URL path of the SmokePing.cgi (mandatory)
smokeping.conf.cgiurl = "https://www.example.com/smokeping/smokeping.cgi"

;; A directory which is visible on your webserver where SmokePing can cache graphs. (mandatory)
smokeping.conf.imgcache = "/usr/local/smokeping/htdocs/img"

;; Either an absolute URL to the imgcache directory or one relative to the directory where you keep the SmokePing cgi. (mandatory)
smokeping.conf.imgurl = "/smokeping/img"

;; The directory where SmokePing can keep its rrd files. (mandatory)
smokeping.conf.datadir = "/usr/local/var/smokeping"

;; The directory where SmokePing keeps its pid when daemonised. (mandatory)
smokeping.conf.piddir = "/usr/local/var/smokeping"

;; Path to the mail template for DYNAMIC hosts. This mail template must contain keywords of the
;; form <##keyword##>. There is a sample template included with SmokePing. (mandatory)
smokeping.conf.smokemail = "/usr/local/etc/smokeping/smokemail"

;; Smokeping typically includes a file with paths to various executables
;; Set the full path and filename for that include here if you wish
smokeping.conf.pathnames = "/etc/smokeping/config.d/pathnames"

;; The above cover all the mandatory settings. You can add other options as follows and
;; they will be included in the general section of the Smokeping config.

smokeping.oconf.tmail = "/usr/local/etc/smokeping/tmail"
smokeping.oconf.syslogfacility = "local0"

Then, edit your IXP(s) (either from the IXPs menu item for multi-IXP mode or via the Infrastructures menu item for single IXP mode); and set the Smokeping URL to the htdocs directory of your Smokeping installaltion - e.g. http://127.0.0.1/smokeping. This should be accessible without username / password to the server running IXP Manager.

Smokeping Configuration

See the template files here which use some of the variables you set in application.ini above. If you want to change these, please do so via the skinning mechanism.

You can then generate the configuration via:

APPLICATION_PATH/bin/ixptool.php -a smokeping-cli.gen-conf >/path/to/smokeping/config

If you set smokeping.conf.dstfile above, then you can just do:

APPLICATION_PATH/bin/ixptool.php -a smokeping-cli.gen-conf

and allow cron to email any potential error output. After this, just (re)start Smokeping.

A number of parameters can be specified on the command line via comma separated pairs such as -p param1=value1,param2=vlaue2. These parameters are:

  • ixp - the id of the IXP to generate the configuration for - mandatory in multi-IXP environments.
  • cgiurl, imgcache, imgurl, datadir, piddir and smokemail these can be specific on the command line rather than the application.ini file which is useful for multi-IXP environments.

Needless to say, Smokeping needs to run on a host that has access to your peering VLAN(s) and it will only monitor interfaces with an IPv4/6 address that has the appropriate Can Ping flag set in the VLAN interface.

Apache Configuration

You need to be able to pass IXP Manager a Smokeping URL such as http://127.0.0.1/smokeping. IXP Manager will add the trailing slash as assume the directory index is configured for the CGI script. Thus you need an Apache configuration such as:

ScriptAlias /smokeping/smokeping.cgi /usr/lib/cgi-bin/smokeping.cgi
Alias /smokeping /usr/share/smokeping/www

<Directory "/usr/share/smokeping/www">
    Options FollowSymLinks
    DirectoryIndex smokeping.cgi
</Directory>

Viewing Smokeping in IXP Manager

There will be a Smokeping button available in the member drilldown graphs (per port graphs) in both the member and admin sections.

Future Expansion?

Allow customers to specify ping beacon(s) in their network (such as DNS servers) that we would monitor on their behalf to help provide a truer indication of latency.

Troubleshooting

See issue #122 for a discussion on Ubuntu installation and diagnosing issues in general.

When you look at the source HTML of the Smokeping page that IXP Manager generates, you'll see generated Smokeping image URLs like the following:

https://www.example.com/ixp/smokeping/retrieve-image/ixp/1/scale/3hours/infra/2/vlan/3/vlanint/94/proto/ipv4

IXP Manager will call something like

file_get_contents( 'https://www.example.com/smokeping/?.....' )

You should see these requests to Smokeping in your Smokeping web server log files. Find these and compare them to the URLs that Smokeping itself generates for its own display of the images to ensure you have everything - and especially the Smokeping URL in IXP configuration set up correctly.

Also, try testing these URLs directly on the IXP Manager server via:

php -r 'echo file_get_contents( "https://..." );' 

Lastly, you can also see the URLs IXP Manager generates if logging is set to debug level in your var/log/YYYY/MM/YYYYMMDD.log files. Debug level is 7 and is set in application.ini. For example:

ondemand_resources.logger.enabled = 1
ondemand_resources.logger.writers.stream.level = 7
ondemand_resources.logger.writers.stream.path  = APPLICATION_PATH "/../var/log"
ondemand_resources.logger.writers.stream.owner = www-data
ondemand_resources.logger.writers.stream.group = www-data
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.