Can't find thruk fastcgi socket

(Izghitu) #1

Hi,

I have CentOS 6 and am trying to setup Thruk with Nginx. I found the only official mentioning about nginx+thruk being setup on Ubuntu using uwsgi. I tried to do the same on my CentOS 6 server but it seems that uwsgi is missing the perl(psgi) plugin because that apparently is not supported on CentOS 6 due to some missing perl dependencies. Because of this I am left with the only option to use the fastcgi option.

Now I have the /etc/init.d/thruk script that when I start I have this process:
nagios 19790 1.7 0.3 99056 31048 ? S 12:29 0:00 /usr/bin/perl /usr/share/thruk/script/thruk_fastcgi.pl

As far as I know it should have created a socket for me to use with nginx but I can’t find it.

I tried to run it manually as described in the docs
%>./script/thruk_fastcgi.pl -n 5
-l /tmp/thruk_fastcgi.socket
-p /tmp/thruk_fastcgi.pid

But I get this:
cgi.cfg not readable: No such file or directory
*****
failed to load cgi config: cgi.cfg
*****

So my guess is that it can’t find some env variables. Looking at the /etc/init.d/thruk script I can see it searches for variables in /etc/sysconfig/thruk or /etc/default/thruk but those files not exist. I supposed that I need to specify the path to the socket to be created and other variables inside one of those files but I can’t find any mention in the official docs about how to properly do this.

Can someone help me make /etc/init.d/thruk create the socket that I would use with nginx?

Thanks in advance.

(Sven Nierlein) #2

have a look at support/fcgid_env.sh. You need to set the THRUK_CONFIG path to your configuration. Usually THRUK_CONFIG=/etc/thruk or something like that.

(Izghitu) #3

I have set it like below and nothing changed:
[root@monitor thruk]# cat “/etc/sysconfig/thruk”
THRUK_CONFIG="/etc/thruk"
THRUK_FCGI_BIN="/usr/share/thruk/script/thruk_fastcgi.pl"

(Sven Nierlein) #4

thats not how it works, those files and environment variables are used within the fcgid_env.sh script, but if you start thruk_fastcgi.pl directly, no files are read and you have to make sure the environment is set already.

(Izghitu) #5

The workaround I used was to move apache to port 81 localhost and use nginx as reverse proxy.

Thanks for the advises though.