LEMP + Nagios = File not found

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Tyrdl
Posts: 2
Joined: Sun Dec 27, 2015 6:29 am

LEMP + Nagios = File not found

Post by Tyrdl »

Hi it's my first post on this forum. My english isn't well but i try to communicate with you.

I have problem with installation Nagios on LEMP (Linux nginx mysql php) in my Monitoring VPS. My OS is Debian 8. I following guides :

Code: Select all

http://www.tokiwinter.com/installing-nagios-under-nginx-on-ubuntu-14-04-lts/
http://idevit.nl/node/93
http://unix.rocks/2014/nginx-and-nagios-a-howto/
https://www.digitalocean.com/community/tutorials/how-to-install-nagios-4-and-monitor-your-servers-on-ubuntu-14-04
https://atlgeek.wordpress.com/2014/05/12/nagios-4-nginx-ubuntu-14-04-lts/
After each installation i have "file not found" in 2 column looks like Nagios web interface. Error log

Code: Select all

==> nagios-error.log <==
2015/12/21 20:22:33 [error] 29212#0: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.10.12.151, server: _, request: "GET /nagios/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "xxx"
and my nginx nagios.conf

Code: Select all

server {
server_name _;
access_log /var/log/nginx/nagios-access.log;
error_log /var/log/nginx/nagios-error.log;

auth_basic "Restricted Nagios Area!";
auth_basic_user_file /usr/local/nagios/etc/htpasswd.users;

root /usr/local/nagios/share;
index index.php index.html;

location / {
try_files $uri $uri/ index.php;
}

location /nagios {
alias /usr/local/nagios/share/;
}
location ~ \.php$ {
root html;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/local/nagios/share$fastcgi_script_name;
fastcgi_split_path_info ^(.+.php)(.*)$;
}
location ~ ^/nagios/(.*\.php)$ {
alias /usr/nagios/share/$1;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}

location ~ \.cgi$ {
root /usr/local/nagios/sbin/;
rewrite ^/nagios/cgi-bin/(.*)\.cgi /$1.cgi break;
fastcgi_param AUTH_USER $remote_user;
fastcgi_param REMOTE_USER $remote_user;
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}

location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
Thank you very much for your interest in my problem.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: LEMP + Nagios = File not found

Post by rkennedy »

Without knowing exactly which guide you followed, I can't recreate the issue. Which one the 5 did you attempt to follow?

Most people use a standard apache install with Nagios, are you using nginx for a specific reason?
Former Nagios Employee
Tyrdl
Posts: 2
Joined: Sun Dec 27, 2015 6:29 am

Re: LEMP + Nagios = File not found

Post by Tyrdl »

Hey,

Recently followed the http://www.tokiwinter.com/installing-na ... 14-04-lts/ with small corrections.

I would like to use nginx because it is more resource-efficient.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: LEMP + Nagios = File not found

Post by rkennedy »

Can you please run the following command and post the output -

Code: Select all

service fcgiwrap status
Former Nagios Employee
Locked