Step missing from documentation

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Step missing from documentation

Postby Pitone_Maledetto » Mon Nov 13, 2017 9:23 am

Hi all,
this documentation https://support.nagios.com/kb/article.php?id=96#Debian is missing an important step.
chown -R nagios:www-data /usr/local/nagios/var/rw/

without this every time you are requesting a check via the web console (rescheduling) you get the following error:
Could not open command file ‘/usr/local/nagios/var/rw/nagios.cmd’ for update!


Not sure where else to put this post so I am posting it here.
Regards

p.s. does the group nagcmd is not needed anymore?
"It is impossible to work in information technology without also engaging in social engineering"
Jaron Lanier
User avatar
Pitone_Maledetto
 
Posts: 47
Joined: Fri Jul 01, 2016 4:11 am
Location: Liverpool, United Kingdom

Re: Step missing from documentation

Postby npolovenko » Tue Nov 14, 2017 12:24 pm

Welcome back, @Pitone_Maledetto.
Not sure where else to put this post so I am posting it here.

Yep, that's the right place to post bug findings.

I just used this manual to do a clean install on Debian 9, but I couldn't replicate the problem.

What version of Debian do you have? Were you doing a clean install or an upgrade? What were the permissions of /usr/local/nagios/var/rw/ before you changed them?

nagcmd is still used on the older systems I believe. But on the installation that I just did the group is just nagios.
User avatar
npolovenko
 
Posts: 367
Joined: Mon May 15, 2017 5:00 pm

Re: Step missing from documentation

Postby Pitone_Maledetto » Wed Nov 15, 2017 4:05 am

Hi npolovenko,
I am on Debian 9.2, clean install serving Nagios with Nginx.
The permissions where nagios:nagios.
Thanks
"It is impossible to work in information technology without also engaging in social engineering"
Jaron Lanier
User avatar
Pitone_Maledetto
 
Posts: 47
Joined: Fri Jul 01, 2016 4:11 am
Location: Liverpool, United Kingdom

Re: Step missing from documentation

Postby Box293 » Wed Nov 15, 2017 4:45 pm

Hi Pitone_Maledetto,
I've the maintainer of that documentation and I have just double checked it on my test Debian system here and it's not an issue.

The permission change you are requesting should not be required because the www-data user is added to the nagios group with:

Code: Select all
usermod -a -G nagios www-data


You did mention that you are using Ngnix. I've not used this myself as the guide uses Apache.

Is it possible that Ngnix has a different user account that needs to be added to the nagios group?

Otherwise this sounds like an Ngnix permissions issue. The reason I say this is because of the following Apache commands in the documentation:

Code: Select all
make install-webconf
a2enmod rewrite
a2enmod cgi


I beleive it's the cgi module that needs to be enabled in Apache before the command pipe can be used. Perhaps there is something like this in Ngnix?
User avatar
Box293
Too Basu
 
Posts: 4738
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia

Re: Step missing from documentation

Postby Pitone_Maledetto » Thu Nov 16, 2017 4:11 am

Hi Box293,
the user is the same www-data.
No sure about the re-write.
This is my nginx configuration file for nagios.
Not sure if you are interested in testing it and have a documentation for nagios/nginx as well as the nagios/apache2 one.

Code: Select all
server {
    server_name nagios;
    access_log /var/log/nginx/nagios.access.log;
    error_log /var/log/nginx/nagios.error.log;
    auth_basic "Private";
    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 /nagios;
    }
    location /nagios {
        alias /usr/local/nagios/share;
    }
    location ~ ^/nagios/(.*\.php)$ {
        alias /usr/local/nagios/share/$1;
        include /etc/nginx/fastcgi_params;
        fastcgi_pass unix:/run/php/php7.0-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_params;
            fastcgi_pass unix:/run/fcgiwrap.socket;
      }
    location ~ \.php$ {
            include /etc/nginx/fastcgi_params;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      }
}


This is what you need for the setup:

Code: Select all
apt install -y php7.0 php7.0-cgi php7.0-fpm fcgiwrap php-apcu apache2-utils nginx-full


Thank you for your time.
Regards
"It is impossible to work in information technology without also engaging in social engineering"
Jaron Lanier
User avatar
Pitone_Maledetto
 
Posts: 47
Joined: Fri Jul 01, 2016 4:11 am
Location: Liverpool, United Kingdom

Re: Step missing from documentation

Postby Box293 » Thu Nov 16, 2017 5:54 pm

Thanks for the info.

At this point I won't be including these steps in our documentation as all of our documentation focusses on Apache.

However it is recorded here and it will help others trying to use Nginx in the future.
User avatar
Box293
Too Basu
 
Posts: 4738
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 27 guests