Remove 'disable notifications' quick action
Posted: Thu Jan 26, 2017 5:07 am
I'm a bit tired of people using the 'disable notification' quick action. is there some way to remove this "Disable notifications" quick action?
Support for Nagios products and services
https://support.nagios.com/forum/
Code: Select all
/usr/local/nagiosxi/html/includes/components/xicore/ajaxhelpers-servicestatus.inc.php
/usr/local/nagiosxi/html/includes/components/xicore/ajaxhelpers-hoststatus.inc.php
Code: Select all
#ajaxhelpers-hoststatus.inc.php line 609
// NOTIFICATIONS
if (intval($xml->hoststatus->notifications_enabled) == 1) {
$cmd["command_args"]["cmd"] = NAGIOSCORE_CMD_DISABLE_HOST_NOTIFICATIONS;
$output .= '<li>' . get_host_detail_command_link($cmd, "nonotifications.png", _("Disable notifications")) . '</li>';
} else {
$cmd["command_args"]["cmd"] = NAGIOSCORE_CMD_ENABLE_HOST_NOTIFICATIONS;
$output .= '<li>' . get_host_detail_command_link($cmd, "enablenotifications.png", _("Enable notifications")) . '</li>';
}
#ajaxhelpers-servicestatus.inc.php line 766
// NOTIFICATIONS
if (intval($xml->servicestatus->notifications_enabled) == 1) {
$cmd["command_args"]["cmd"] = NAGIOSCORE_CMD_DISABLE_SVC_NOTIFICATIONS;
$output .= '<li>' . get_service_detail_command_link($cmd, "nonotifications.png", _("Disable notifications")) . '</li>';
} else {
$cmd["command_args"]["cmd"] = NAGIOSCORE_CMD_ENABLE_SVC_NOTIFICATIONS;
$output .= '<li>' . get_service_detail_command_link($cmd, "enablenotifications.png", _("Enable notifications")) . '</li>';
}
Code: Select all
$(document).ajaxComplete(function () {
$("div.service_state_quick_actions").children("li").each(function () {
if ($(this).find("a").attr("onclick")) {
if ($(this).find("a").attr("onclick").match(/("cmd":23)/)) {
$(this).hide();
}
}
});
$("div.host_state_quick_actions").children("li").each(function () {
if ($(this).find("a").attr("onclick")) {
if ($(this).find("a").attr("onclick").match(/("cmd":25)/)) {
$(this).hide();
}
}
});
});
Code: Select all
Object Type: Host
Host: /.*/
Service: [blank]
Hostgroup: [blank]
Servicegroup: [blank]
Action Type: URL
URL / Command: http://[Nagios Host]/nagiosxi/includes/components/nagioscore/ui/cmd.php?cmd_typ=28&host=%host%
Target: _blank
Action Text: Enable Notifications for all Services on the host
On the far right - choose Custom - and you control who can see and use the command
Code: Select all
Object Type: Host
Host: /.*/
Service: [blank]
Hostgroup: [blank]
Servicegroup: [blank]
Action Type: URL
URL / Command: http://[Nagios Host]/nagiosxi/includes/components/nagioscore/ui/cmd.php?cmd_typ=29&host=%host%
Target: _blank
Action Text: Disable Notifications for all Services on the host
On the far right - choose Custom - and you control who can see and use the command
Code: Select all
turn off Service Notify
http://[Nagios Host]/nagiosxi/includes/components/nagioscore/ui/cmd.php?cmd_typ=23&host=%host%&service=%servicedisplayname%
turn on Service Notify
http://[Nagios Host]/nagiosxi/includes/components/nagioscore/ui/cmd.php?cmd_typ=22&host=%host%&service=%servicedisplayname%
turn off host notify
http://[Nagios Host]/nagiosxi/includes/components/nagioscore/ui/cmd.php?cmd_typ=25&host=%host%
turn on host notify
http://[Nagios Host]/nagiosxi/includes/components/nagioscore/ui/cmd.php?cmd_typ=24&host=%host%