Smokeping on Nginx

Steps I took to configure smokeping on nginx (debian whezy):

1. install fcgiwrap

apt-get install fcgiwrap
cp /usr/share/doc/fcgiwrap/examples/nginx.conf /etc/nginx/fcgiwrap.conf

2. modify the host you want (or the default host) to suport cgi scripts

#fast cgi support
include /etc/nginx/fcgiwrap.conf;
location ~ \.cgi$
{
fastcgi_intercept_errors on;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}

3.  create links from smokeping to your www folder:

ln -s /usr/share/smokeping/www  /var/www/smokeping
ln -s /usr/lib/cgi-bin/smokeping.cgi /usr/share/smokeping/www/smokeping.cgi

4. add the alias for smokeping:

location /smokeping/ {
index smokeping.cgi;
gzip off;
}

 

 

 

 

 

One thought on “Smokeping on Nginx

  1. Got it working, following your instructions, and the following conf.
    Not sure the /cgi-bin/ location is required though:

    server
    {
    listen 80;
    server_name {{ ansible_fqdn }};

    location /cgi-bin/
    {
    gzip off;
    root /usr/lib;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME /usr/lib$fastcgi_script_name;
    fastcgi_pass unix:/var/run/fcgiwrap.socket;
    }

    location ~ \.cgi$
    {
    fastcgi_intercept_errors on;
    root /var/www;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/$fastcgi_script_name;
    fastcgi_pass unix:/var/run/fcgiwrap.socket;
    }

    location /smokeping/
    {
    root /var/www;
    index smokeping.cgi;
    gzip off;
    }

    location /
    {
    rewrite ^(.*)$ https://{{ ansible_fqdn }}/smokeping$1;
    }
    }

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>