Page 1 of 2

Nagiosadmin dosent have rights to disable notifications

Posted: Wed Apr 19, 2017 2:47 am
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

Re: Nagiosadmin dosent have rights to disable notifications

Posted: Wed Apr 19, 2017 4:18 am
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

Re: Nagiosadmin dosent have rights to disable notifications

Posted: Wed Apr 19, 2017 6:44 am
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

Re: Nagiosadmin dosent have rights to disable notifications

Posted: Wed Apr 19, 2017 6:46 am
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.

Re: Nagiosadmin dosent have rights to disable notifications

Posted: Wed Apr 19, 2017 7:04 am
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

Re: Nagiosadmin dosent have rights to disable notifications

Posted: Wed Apr 19, 2017 7:16 am
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

Re: Nagiosadmin dosent have rights to disable notifications

Posted: Wed Apr 19, 2017 8:47 am
by rhassing
What are the permissions on /usr/local/nagios/var/rw/nagios.cmd ?

Re: Nagiosadmin dosent have rights to disable notifications

Posted: Wed Apr 19, 2017 11:54 am
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

Re: Nagiosadmin dosent have rights to disable notifications

Posted: Thu May 11, 2017 6:34 am
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

Re: Nagiosadmin dosent have rights to disable notifications

Posted: Thu May 11, 2017 8:50 am
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.