Hide options from users

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Hide options from users

Post by hbouma »

We have several users that go in and disable all notifications on their servers. We are working to stop the users from doing this, but in the mean time, we are hoping to get rid of the options "Disable Notifications on all Services on this host" and "Enable Notifications for all Services on this host".

Is there a way to do that in the code?

Running Nagios XI 5.6.0 on 64bit Red Hat 7.6 VM's.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Hide options from users

Post by lmiltchev »

I don't believe hiding a couple of links inthe web UI is a good solution. It will not guarantee that users won't find a "workaround", e.g. using the REST API, disabling/enabling notifications one-by-one, using the "Quick Actions" links, etc. In addition to this, you can't remove these links for specific users only. No one is going to be able to see the links if removed... You will be better off making these users "read-only" if you don't trust them.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: Hide options from users

Post by hbouma »

Unfortunately, making the users read only is not an option.

Removing the links from everyone is an option. I was hoping there was something similar to https://support.nagios.com/forum/viewto ... 36#p210071, but I cannot seem to find the correct lines to comment out.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Hide options from users

Post by lmiltchev »

If I am not mistaken, these link are displayed under the Nagios Core interface. Correct me if I am wrong.

Home > Details > Host Status > <any host> > Advanced > View in Nagios Core > Disable/Enable notifications for all services on this host

If this is the case, removing these links would be impossible without recompiling your own version of Nagios Core (without the links). This is out of scope of Nagios support.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: Hide options from users

Post by hbouma »

Is there a way to alert when this command happens in the Audit Logs automatically?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Hide options from users

Post by lmiltchev »

There are some 3rd party plugins on the Nagios Exchange for monitoring files/logs that you could probably use. Here's an example of one plugin that can probably do the job for you:

https://github.com/pmcaulay/nagios-plug ... ck_log3.pl

1. Download the plugin and drop it into /usr/local/nagios/libexec directory.

2. Create a command, for example:

Code: Select all

define command {
    command_name    check_log3
    command_line     $USER1$/check_log3.pl $ARG1$ $ARG2$ $ARG3$
}
3. Create a service (I placed mine under localhost):

Code: Select all

define service {
    host_name                   localhost
    service_description         Audit Log - DISABLE_HOST_SVC_NOTIFICATIONS
    use                         xiwizard_generic_service    
    check_command               check_log3!-l /usr/local/nagiosxi/var/components/auditlog.log!-p DISABLE_HOST_SVC_NOTIFICATIONS!-c 1!!!!!
    max_check_attempts          1
    check_interval              5
    retry_interval              1
    check_period                24x7
    notification_interval       60
    first_notification_delay    0
    notification_period         24x7
    notification_options        w,c,u,r,f,
    notifications_enabled       1
    contacts                    nagiosadmin    
    register                    1
}
The plugin will give you a CRITICAL if the "DISABLE_HOST_SVC_NOTIFICATIONS" pattern is found in the auditlog.log. The "max_check_attempts" value should be set to 1 as the plugin will return OK after the second check, UNLESS a new string is found (new log entry).

Note: This check will notify you if any user has disabled notifications on all services of a host, provided the "Write Audit Log to file" check-box has been selected under the "System Settings" page.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: Hide options from users

Post by hbouma »

lmiltchev wrote:If I am not mistaken, these link are displayed under the Nagios Core interface. Correct me if I am wrong.

Home > Details > Host Status > <any host> > Advanced > View in Nagios Core > Disable/Enable notifications for all services on this host

If this is the case, removing these links would be impossible without recompiling your own version of Nagios Core (without the links). This is out of scope of Nagios support.
The ones I am concerned about are displayed in the Service Details page under Quick Links.
2019-04-24 08_16_14-Nagios XI.png
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Hide options from users

Post by lmiltchev »

Oh, I see. These links have been added (by the look of them) under the Actions component (Admin > System Extensions > Manage Components). You can configure the permissions under the Actions page by clicking on the "Permissions" drop-down menu, selecting "Custom", selecting your contacts, and clicking on "Apply Settings".
Be sure to check out our Knowledgebase for helpful articles and solutions!
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: Hide options from users

Post by hbouma »

That worked. When I deleted the custom actions, it got rid of the items.

Thank you
Henry
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Hide options from users

Post by lmiltchev »

I am glad I could help! :)

I am closing this topic now. If you have any further questions, please start a new thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked