Building Smokeping on CentOS and running without root permissions.

I needed smokeping to run some tests, but every guide online alluded to using root for the application user which is really not ideal. I’m still not happy about setuid for fping, but as long as you provide at least basic authentication on the web front end, it shouldn’t be too much of a problem when it comes to audit.

The sections mention swapping between smokeping and root users. This will typically involve a lot of ctrl + D and sudo su – commands. Use common sense in the procedure below for this and use the “id” command to check who you are effectively logged in as. I know you can chown -R but I chose to use the actual user and then lock it down once finished to avoid confusing permission oversights. :p

I have run through this procedure myself and it works on a CentOS minimal install. There was a frustrating issue I had with getting echoping built with ssl support. Running configure and running into library errors usually points to development versions not being installed, NOT the normal, user libraries. In this case, openssl-devel and popt-devel. Thanks to my good friend Cody for pointing this out before I went crazy! :D

smokeping install – CentOS 6
With credit to WeDebugYou.com for the base on which I built this procedure.

Note that if you want to use SSL (EchoPingHttps) probes, you MUST refer to the /usr/local/bin/echoping binary now instead
of the one that may already be installed.

This is a fantastic tool but it does have some peculiarities. I don’t agree with the default graph scaling, which you’ll soon see clips out the “smoke” peaks. Changing unison_tolerance for targets can work around this to an extent but you have to remember that graphs scale to the median. You will also probably want to review the RRDTool database aggregation if you want high resolution polling.

Here are my changes in the config file for 1 minute resolution… If I’ve done anything wrong, I’ll be happy to correct this post.

5 Responses to Building Smokeping on CentOS and running without root permissions.

I value our long-long-long (hmm, if long long is 64 bits, is long long long 128 bits ? Okay, nevermind the idiocy there) time friendship too! (Thanks btw – that meant a lot to me and the day you wrote it was actually not at all a good day so that was a highlight of the day). Still hard to believe how long its been. Anyway… as for configure: it’s because it’s looking for header files (function prototypes and declarations as opposed to implementation/definition) to (get this!) configure the build for the system in question. Unfortunately (as I’m sure you’re aware) there’s a real difficulty with establishing a single standard and even POSIX has done some idiotic things (Linus Torvalds mentions one in the man page for accept; it’s quite amusing and he put it quite well) so things differ from system to system (hence autoconf/automake). What you would find is that if you were to somehow have the header files but not the libraries (whether static or shared objects) instead of getting an error during configure you would get a linker error (it might go as far as compiling the source files up until the point it would link all the objects together and then give you an error like the below example I just created albeit by excluding the linker flag):

And if you want to go the other way around then remove the inclusion of math.h and try compiling: although you would luck out with it being built-in (though not a proper code) you would still – unless you pass -lm to the linker (through gcc) – get the same error from ld.

Right. I bloody well hate html in posts…I always forget the ampersand codes. The includes (if I can get it right at this hour) should rather be (and if not oh well – it is time to try to get some sleep!):
#include <stdio.h>
#include <math.h>

I follow the procedure here to setup the smokeping application. But when I start the service smokeping, the process is still running as root user. From the /etc/init.d/smokeping script, I don’t see su to smokeping when starting the process as the line shows below:
daemon $SMOKEPING