Nagiosadmin dosent have rights to disable notifications

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.
mfrycke
Posts: 29
Joined: Wed Mar 22, 2017 9:40 am

Nagiosadmin dosent have rights to disable notifications

Post by mfrycke »

Hi.

I have a problem with that user nagiosadmin dosent have rights to disable notification on nagios core web gui.
Where can i set the rights so that nagioaadmin can do that?

Server Ubuntu 14
Nagios 4.3.1
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Nagiosadmin dosent have rights to disable notifications

Post by rhassing »

In the file cgi.cfg (either in /usr/local/nagios/etc/ or /etc/nagios/):
authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin
Rob Hassing
Image
mfrycke
Posts: 29
Joined: Wed Mar 22, 2017 9:40 am

Re: Nagiosadmin dosent have rights to disable notifications

Post by mfrycke »

ok.. i check that file and nagiosadmin is authorized for
authorized_for_system_information
authorized_for_configuration_information
authorized_for_system_commands
authorized_for_all_services
authorized_for_all_hosts
authorized_for_all_service_commands
authorized_for_all_host_commands
mfrycke
Posts: 29
Joined: Wed Mar 22, 2017 9:40 am

Re: Nagiosadmin dosent have rights to disable notifications

Post by mfrycke »

the error messeges is
Error: Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!
The permissions on the external command file and/or directory may be incorrect. Read the FAQs on how to setup proper permissions.
An error occurred while attempting to commit your command for processing.
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Nagiosadmin dosent have rights to disable notifications

Post by rhassing »

Does the file '/usr/local/nagios/var/rw/nagios.cmd exist on your system?
ls -l /usr/local/nagios/var/rw/nagios.cmd
Please check where the command file is located:
grep command_file /usr/local/nagios/etc/nagios.cfg
Rob Hassing
Image
mfrycke
Posts: 29
Joined: Wed Mar 22, 2017 9:40 am

Re: Nagiosadmin dosent have rights to disable notifications

Post by mfrycke »

yes. rw file is there.

vi shows this

" ============================================================================
" Netrw Directory Listing (netrw v149)
" /usr/local/nagios/var/rw
" Sorted by name
" Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$
" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec
" ============================================================================
../
./
nagios.cmd|
nagios.qh|


in nagios.cfg
# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/objects/commands.cfg


# EXTERNAL COMMAND FILE
# This is the file that Nagios checks for external command requests.
# It is also where the command CGI will write commands that are submitted
# by users, so it must be writeable by the user that the web server
# is running as (usually 'nobody'). Permissions should be set at the
# directory level instead of on the file, as the file is deleted every
# time its contents are processed.

command_file=/usr/local/nagios/var/rw/nagios.cmd
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Nagiosadmin dosent have rights to disable notifications

Post by rhassing »

What are the permissions on /usr/local/nagios/var/rw/nagios.cmd ?
Rob Hassing
Image
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagiosadmin dosent have rights to disable notifications

Post by tgriep »

To view the permissions of that file as well as the nagios group settings, can you login to the server as root, run the following and post the output?

Code: Select all

ls -l /usr/local/nagios/var/rw/nagios.cmd
grep nag /etc/group
Be sure to check out our Knowledgebase for helpful articles and solutions!
mfrycke
Posts: 29
Joined: Wed Mar 22, 2017 9:40 am

Re: Nagiosadmin dosent have rights to disable notifications

Post by mfrycke »

xxx@ubusrv02:/usr/local/nagios/etc⟫ ls -l /usr/local/nagios/var/rw/nagios.cmd
prw-rw---- 1 nagios nagios 0 Apr 3 13:31 /usr/local/nagios/var/rw/nagios.cmd

xxx@ubusrv02:/usr/local/nagios/etc⟫ grep nag /etc/group
nagios:x:1001:
nagcmd:x:1002:nagios,www-data
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagiosadmin dosent have rights to disable notifications

Post by tgriep »

It looks like the nagios user and the Apache used it missing from the nagios group and that is probably the issue.
Edit the /etc/group file and change the nagios group settings from

Code: Select all

nagios:x:1001:
to

Code: Select all

nagios:x:1001:nagios,www-data
Save the file and see if the nagiosadmin can disable the notifications now.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked