We have users that need the ability to schedule downtime, acknowledge alerts and force an immediate check, however, we do not want the users to be able to disable notifications and checks.
I found https://support.nagios.com/forum/viewto ... 16&t=42136 that allows me to remove the enable/disable notifications from the quick links, but I don't see a way to do the same for the Hostgroup Commands. Specifically, I would like the user to only see the options to schedule downtime in the Hostgroup commands. Is that possible?
Hiding host commands from users
Hiding host commands from users
You do not have the required permissions to view the files attached to this post.
Re: Hiding host commands from users
Also, once I made the change (and reverted to backup), we are seeing that the servicegroup and hostgroup summary, overview and grid views are now showing as if they were Core instead of XI. At this time, I have moved the backup file back to the original name, but I am still seeing the issue.
Code: Select all
[//usr/local/nagiosxi/html/includes/components/xicore]
$ ll
total 880K
drwxr-x---. 3 nagios nagios 4.0K Oct 30 11:51 .
drwxr-x---. 61 nagios nagios 4.0K Jul 23 09:26 ..
-rwxr-x---. 1 nagios nagios 4.1K Sep 27 14:02 ajaxhelpers-comments.inc.php
-rwxr-x--- 1 nagios nagios 44K Oct 30 11:21 ajaxhelpers-hoststatus.inc.php
-rwxr-x--- 1 root root 44K Oct 30 11:11 ajaxhelpers-hoststatus.inc.php.BAK
-rwxr-x---. 1 nagios nagios 855 Sep 27 14:02 ajaxhelpers.inc.php
-rwxr-x---. 1 nagios nagios 25K Sep 27 14:02 ajaxhelpers-misc.inc.php
-rwxr-x---. 1 nagios nagios 27K Sep 27 14:02 ajaxhelpers-monitoringengine.inc.php
-rwxr-x---. 1 nagios nagios 1.6K Sep 27 14:02 ajaxhelpers-perfdata.inc.php
-rwxr-x--- 1 nagios nagios 53K Oct 30 11:18 ajaxhelpers-servicestatus.inc.php
-rwxr-x--- 1 root root 53K Oct 30 11:10 ajaxhelpers-servicestatus.inc.php.BAK
-rwxr-x---. 1 nagios nagios 70K Sep 27 14:02 ajaxhelpers-status.inc.php
-rwxr-x---. 1 nagios nagios 19K Sep 27 14:02 ajaxhelpers-sysstat.inc.php
-rwxr-x---. 1 nagios nagios 34K Sep 27 14:02 ajaxhelpers-tac.inc.php
-rwxr-x---. 1 nagios nagios 7.2K Sep 27 14:02 ajaxhelpers-tasks.inc.php
-rwxr-x---. 1 nagios nagios 2.4K Sep 27 14:02 dashlets-comments.inc.php
-rwxr-x---. 1 nagios nagios 19K Sep 27 14:02 dashlets.inc.php
-rwxr-x---. 1 nagios nagios 3.6K Sep 27 14:02 dashlets-misc.inc.php
-rwxr-x---. 1 nagios nagios 8.6K Sep 27 14:02 dashlets-monitoringengine.inc.php
-rwxr-x---. 1 nagios nagios 13K Sep 27 14:02 dashlets-perfdata.inc.php
-rwxr-x---. 1 nagios nagios 20K Sep 27 14:02 dashlets-status.inc.php
-rwxr-x---. 1 nagios nagios 6.6K Sep 27 14:02 dashlets-sysstat.inc.php
-rwxr-x---. 1 nagios nagios 11K Sep 27 14:02 dashlets-tac.inc.php
-rwxr-x---. 1 nagios nagios 4.7K Sep 27 14:02 dashlets-tasks.inc.php
-rwxr-x---. 1 nagios nagios 66K Sep 27 14:02 downtime.php
-rw-r-----. 1 nagios nagios 1.7K Sep 27 14:02 export-rrd.php
drwxr-x---. 5 nagios nagios 4.0K Jun 1 11:12 images
-rw-r----- 1 nagios nagios 7.1K Sep 27 14:02 recurringdowntime.inc.php
-rwxr-x---. 1 nagios nagios 52K Sep 27 14:02 recurringdowntime.php
-rw-r-----. 1 nagios nagios 3.4K Jun 1 11:12 sanity.sh
-rwxr-x---. 1 nagios nagios 132K Sep 27 14:02 status-object-detail.inc.php
-rwxr-x---. 1 nagios nagios 19K Sep 27 14:02 status.php
-rwxr-x---. 1 nagios nagios 39K Sep 27 14:02 status-utils.inc.php
-rwxr-x---. 1 nagios nagios 6.0K Sep 27 14:02 tac.php
-rwxr-x---. 1 nagios nagios 18K Sep 27 14:02 xicore.inc.php
You do not have the required permissions to view the files attached to this post.
Re: Hiding host commands from users
I would highly recommend the Javascript based solution I proposed in that thread instead of modifying the PHP files. I'd be happy to update the jQuery selectors to match your desired commands if a tech doesn't beat me to it (or come up with a more elegant solution).
Hard refresh, clear browser cache, see if that fixes it.hbouma wrote:At this time, I have moved the backup file back to the original name, but I am still seeing the issue.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Hiding host commands from users
Thank you for the reply. I tried a hard refresh of the browser (chrome) as well as an attempt in FireFox and IE. I even rebooted the PC and still have the issue.
I wanted to use the Javascript option first. Maybe it is my ignorance, but I copied the code to a notification.js file and then attempted to upload it. Nagios XI provided an error stating "Could not upload file notifications.js. This file does not match one of the valid file types above."
I wanted to use the Javascript option first. Maybe it is my ignorance, but I copied the code to a notification.js file and then attempted to upload it. Nagios XI provided an error stating "Could not upload file notifications.js. This file does not match one of the valid file types above."
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Hiding host commands from users
@hbouma, This particular hostgroup menu on your screenshot is using a precompiled CGI file. There is no quick way to remove a menu item like in XI PHP based menu. Writing a custom jQuery script is not something we do as a part of the regular support. I can submit a feature request on your behalf if you'd like?
As far as the second problem you described, please go to the Admin menu, click on the Performace Settings in the left column and uncheck "Use Unified Tactical Overview", "Use Unified Hostgroup Screens" and "Use Unified Servicegroup Screens" under the Page Settings.
As far as the second problem you described, please go to the Admin menu, click on the Performace Settings in the left column and uncheck "Use Unified Tactical Overview", "Use Unified Hostgroup Screens" and "Use Unified Servicegroup Screens" under the Page Settings.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Hiding host commands from users
That did fix my second issue. Do you have any idea why Nagios XI would tell me that my javascript file was not valid and refuse to upload it? Is Nagios actually looking at the files and reading their content to validate their setup, or is it just looking at the extension?
@mcapra
If you happen to have an updated copy of that script, we would love to use it if that is ok. We have users that have been disabling the notifications without knowing what it does and we want to keep them from hurting themselves.
@mcapra
If you happen to have an updated copy of that script, we would love to use it if that is ok. We have users that have been disabling the notifications without knowing what it does and we want to keep them from hurting themselves.
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Hiding host commands from users
@hbouma, You're talking about the custom includes component, right? I tried uploading a JS script as well and it errored out. I'm going to report this to our QA department.
I was able to get rid of the menus by hiding elements in the css file:
I was able to get rid of the menus by hiding elements in the css file:
Add the following statements somewhere in the beginning of the css file:nano /usr/local/nagiosxi/html/includes/components/nagioscore/ui/css/extinfo.css
Code: Select all
body > div > table > tbody > tr:nth-child(1) > td:nth-child(2) > table > tbody > tr > td > table > tbody > tr:nth-child(3) {
display: none !important;
}
body > div > table > tbody > tr:nth-child(1) > td:nth-child(2) > table > tbody > tr > td > table > tbody > tr:nth-child(4) {
display: none !important;
}
body > div > table > tbody > tr:nth-child(1) > td:nth-child(2) > table > tbody > tr > td > table > tbody > tr:nth-child(5) {
display: none !important;
}
body > div > table > tbody > tr:nth-child(1) > td:nth-child(2) > table > tbody > tr > td > table > tbody > tr:nth-child(6) {
display: none !important;
}As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.