[smokeping-users] speedycgi replacement

Ken Dreyer ktdreyer at ktdreyer.com
Tue Jul 19 17:00:30 CEST 2011


On Sat, Jul 2, 2011 at 12:48 PM, Ken Dreyer <ktdreyer at ktdreyer.com> wrote:
> Any thoughts about replacing the SpeedyCGI dependency (eg. with
> FastCGI?) How much work would be involved?

I have a bit more info on this, if anyone else is interested.

I wanted to avoid SpeedyCGI because it is not maintained upstream
(almost 9 years since a release), and FastCGI is a good replacement. I
was able to replace Speedy with mod_fcgid. The code changes were
pretty simple.

In smokeping.cgi, I had to wrap the Smokeping::cgi function in a
CGI::Fast loop. For example:

use Smokeping 2.004002;

use CGI::Fast;
while (my $q = new CGI::Fast) {
       Smokeping::cgi("/usr/local/smokeping/etc/config", $q);
}

You can see that I'm passing $q now to cgi(). I had to modify
Smokeping.pm's cgi() to take $q as a second argument rather than
creating a new CGI object upon each invocation. Otherwise, the URLs
were not getting properly passed back to the application, and the
wrong page would show up for the wrong URL.

I did not look into modifying tr.cgi, but I imagine that the
modifications would be similar.

- Ken



More information about the smokeping-users mailing list