Ad Widget

Collapse

Zabbix Announcement Banner?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vrtareg
    Senior Member
    • May 2006
    • 293

    #1

    Zabbix Announcement Banner?

    Hi

    I am looking to the possibility to put some kind Announcement Banner to the Zabbix frontend.

    I would like to put some links to the our own created documentation so people who are administrating Zabbix will be able to access to the useful tips instantly rather than searching for it or trying to find out who configured the system and who is the point of contact.

    There are plenty of space next to the Zabbix logo - top left corner.

    Regards,
    Areg
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    If you have enough qualification in PHP-programming, you can easily modify
    Code:
    /usr/share/zabbix/include/page_header.php
    But! Just remember, that it's only your responsibility to protect your modification from the update(s).
    Sincerely yours,
    Aleksey

    Comment

    • Spectroman
      Junior Member
      • Sep 2008
      • 17

      #3
      I just stumbled on the need to do this now, and I realise there is no predefined way to do so... As "aib" suggested, I have some PHP know-how and I was able to make a permanent banner correctly..

      For others looking for the same solution, in order to achieve this:
      Click image for larger version

Name:	image.png
Views:	596
Size:	35.7 KB
ID:	454519

      you should:

      edit the file: ​ `include/classes/html/widget/CWidget.php`

      and at the end of the file, before the line which returns the function "createTopHeader()" you should add the following:


      PHP Code:
      $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!!"falsetruefalse)->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 next line here should be the return.

      Notice the class options, which are the 3 colours possible.

      I just added a feature request: https://support.zabbix.com/browse/ZBXNEXT-8109
      Attached Files

      Comment

      • jjeff123
        Member
        • May 2022
        • 33

        #4
        Anyone know how to do this now? The file `include/classes/html/widget/CWidget.php' no longer exists at least as of 6.4.15

        Maybe this is now in /include/classes/html/CHtmlPage.php ?? I don't know the zabbix PHP well at all, only looked at it now for about 5 minutes.

        Comment

        Working...