Page 1 of 1

User can_submit_commands 0, can submit commands on hostgroup

Posted: Wed Jan 29, 2014 4:53 am
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?

Re: User can_submit_commands 0, can submit commands on hostg

Posted: Wed Jan 29, 2014 2:07 pm
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

Re: User can_submit_commands 0, can submit commands on hostg

Posted: Thu Jan 30, 2014 9:39 am
by driebit
Thanks! That worked.