Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-8109

Message Banner please? (and maintenance fix)

    XMLWordPrintable

Details

    • Change Request
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 3.0.32rc1, 4.0.43, 4.0.44, 5.0.28, 5.0.29, 6.0.9, 6.0.10, 6.2.3, 6.2.4, 6.4.0beta2, 6.4.0beta3
    • None
    • Frontend (F)
    • None

    Description

      Basically I am adding another request on top of previous ones trying to push forward this feature which in the end is quite important.

      We should be able to create messages for users with different aspects, that should not disable the frontend, and it should be a permanent view across all pages and all clicks from the users.

      So the first thing to comment here is the fact that, on the `maintenance.inc.php` if you try to set a "non-blocking" message, it is not possible, because the code only checks the presence of the variable but ignores if you want it to be true or false.

       

       

             /**
      
               * Check if maintenance mode is enabled.
      
               *
      
               * @throws Exception
      
               */
      
              protected function setMaintenanceMode() {
      
                      require_once 'conf/maintenance.inc.php';
      
      
      
                      if (defined('ZBX_DENY_GUI_ACCESS')) {
      
                              if (!isset($ZBX_GUI_ACCESS_IP_RANGE) || !in_array(CWebUser::getIp(), $ZBX_GUI_ACCESS_IP_RANGE)) {
      
                                      throw new Exception($_REQUEST['warning_msg']);
      
                              }
      
                      }
      
              }
       

      So why do you ask: "ZBX_DENY_GUI_ACCESS" if you just ignore the boolean that follows? That should allow someone to set the maintenance in a non-blocking way.

      Secondly, to create I permanent banner I have edited the file: include/classes/html/widget/CWidget.php

      and on the line before the return from the the function: createTopHeader() one can add:

      $msg = [
        'type' => 'error',
        'message' => _('You should only use this server for consultation purposes, the new production server is at https://example.com'),
        'source' => ''
      ];
      
      echo makeMessageBox(ZBX_STYLE_MSG_BAD, [$msg], "This server has been migrated!!", false, true, false)->addClass(ZBX_STYLE_MSG_BAD);
      // class options are ZBX_STYLE_MSG_BAD, ZBX_STYLE_MSG_GOOD, ZBX_STYLE_MSG_WARNING
      // respectively are message red, green, yellow 

      The result will be a message with the respective class on the top of the main content frame:

       

      Now , this should be seriously considered as a feature... like creating a file with a more human method and allowing such function to easy to apply.

       

      Before I wrote this I found these similar requests, and none have been fulfilled as it seems:

      https://support.zabbix.com/browse/ZBXNEXT-2455

      https://support.zabbix.com/browse/ZBXNEXT-4506

      https://support.zabbix.com/browse/ZBXNEXT-7646

      Please, vote!

       

      Attachments

        Activity

          People

            vmurzins Valdis Murzins
            spectroman jchegedus
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: