User can_submit_commands 0, can submit commands on hostgroup

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
driebit
Posts: 2
Joined: Wed Jan 29, 2014 4:29 am

User can_submit_commands 0, can submit commands on hostgroup

Post by driebit »

Running Nagios 3.2.0, I want to add a user that is able to monitor system status/performance of a specific hostgroup, but not perform any actions.

To this end, I've added a contact in contacts.cfg:

Code: Select all

define contact{
        contact_name                    viewer
        alias                           Viewer
        host_notifications_enabled      0
        service_notifications_enabled   0
        service_notification_period     none
        host_notification_period        none
        service_notification_options    n
        host_notification_options       n
        service_notification_commands   notify-by-email
        host_notification_commands      host-notify-by-email
        can_submit_commands             0
}
... and also a contactgroup:

Code: Select all

define contactgroup{
        contactgroup_name       viewergroup
        alias                   Viewergroup
        members                 viewer
}
... then I added this contactgroup to the host configurations of the hosts in the hostgroup:

Code: Select all

define host{
        use                     driebit
        host_name               host01.driebit.net
        address                 11.22.33.44
        contact_groups          admingroup,viewergroup
        }
This seems to be working for the most part. The user can log in, view status, graphs, etc, and when selecting a host and attempting to, for instance, "disable notifications for this host", the user can commit this command but subsequently gets an error saying "Sorry, but you are not authorized to commit the specified command."

However. When this user selects the hostgroup, and selects for instance "Disable notifications of all services in this hostgroup", the command is processed!

I haven't been able to find anything on this. Is it a bug, or a configuration error?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: User can_submit_commands 0, can submit commands on hostg

Post by lmiltchev »

You can set this user as "read only" in the "cgi.cfg" file:

Code: Select all

authorized_for_read_only=viewer
and restart nagios:

Code: Select all

service nagios restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
driebit
Posts: 2
Joined: Wed Jan 29, 2014 4:29 am

Re: User can_submit_commands 0, can submit commands on hostg

Post by driebit »

Thanks! That worked.
Locked