Ad Widget

Collapse

Dashboard-Widget "Problems by severity": remove colors when no problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • c1support
    Member
    • Apr 2020
    • 47

    #1

    Dashboard-Widget "Problems by severity": remove colors when no problem

    Using Zabbix v4.47 (will be upgrading as soon as v5.0 is available), I would like to display the currently pending problems on a Dashboard with a widget.

    I currently use "Problems by severity" with the following parameters:
    - Show: Total
    - Layout: Vertical
    - Show perational data: none
    - Problem display: All

    This almost does what I have in mind, except that it is a bit too colorful:
    0 Disaster
    0 High
    0 Average
    1 Warning
    1 Information
    0 Not classified

    Better would be that the color for the severity is only displayed when there actually is at least one pending problem of said severity. All lines/severities with no pending problems should be in a discrete color (e.g. grey):
    0 Disaster
    0 High
    0 Average
    1 Warning
    1 Information
    0 Not classified

    => Is there an easy possibility (i.e. without source modification) to achieve this?
    => If not, would this be of more general interes to place a change request at https://support.zabbix.com/projects/ZBXNEXT?
    Last edited by c1support; 19-04-2020, 19:13.
  • c1support
    Member
    • Apr 2020
    • 47

    #2
    In case anybody else is interested in the future, I resolved this the following way:
    Use widget "Problems" and sort entries by "severity (descending". Not 100% what I had in mind, but good enough for the time being.

    Since there has been no response so far, I will not place a feature request.

    Comment

    • Hamardaban
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2019
      • 2713

      #3
      To implement the functionality you need change file include/blocks.inc.php

      in function getSeverityTableCell

      before
      Code:
       switch ($ext_ack) {
      add

      Code:
      575,578d578
      <       if ($stat['count_unack']== 0 ) {
      <               $severity = 0;
      <     }
      to get the following results

      Code:
          if ($stat['count_unack']== 0 ) {
              $severity = 0;
          }        
      
          switch ($ext_ack) {
              case EXTACK_OPTION_ALL:

      Comment

      • c1support
        Member
        • Apr 2020
        • 47

        #4
        Thanks Hamardaban, this helped some.

        In /usr/share/zabbix/include/blocks.inc.php, I added the three lines you mentioned above (in v4.4.8 it was at line 579).

        This changed the behavior so that all the severities with no pending problems will be displayed in the color and with the icon (?) of the "not classified".
        This is not 100% what I had in mind (even better would have been to be able to modify the color and remove the icon), but seems a huge improvement over my temporary solution.

        Comment

        • c1support
          Member
          • Apr 2020
          • 47

          #5
          After updating to Zabbix v6, I gladly confirm that this is still working (in v6.0.13 it was in /usr/share/zabbix/include/blocks.inc.php on line 489).
          We came to appreciate this solution, as it reduces color-noise on our main dashboard.

          Comment

          Working...