Ad Widget

Collapse

Dashboard host group sorting gone in 2.0.2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • heaje
    Senior Member
    Zabbix Certified Specialist
    • Sep 2009
    • 325

    #1

    Dashboard host group sorting gone in 2.0.2

    I upgraded Zabbix to 2.0.2 today (from 2.0.0) and noticed an annoying (bug?) thing on the dashboard. The "System status", "Web monitoring" and "Host status" widgets are no longer sorted by Host Group name. Instead, it appears to be some kind of random sorting. This makes it aggravating to find things.

    I'm not sure if this is a bug or what, but I spent a few minutes figuring out how to get the old sorting method back. Here's what I did:

    in "include/blocks.inc.php":

    Change the following code in the "make_system_status", "make_hoststat_summary", and "make_webmon_overview" functions from
    Code:
    foreach($groups as &$group) {
                    $group['nodename'] = get_node_name_by_elid($group['groupid']);
            }
            unset($group);
    
            // we need natural sort
            $sortFields = array(
                    array('field' => 'nodename', 'order' => ZBX_SORT_UP),
                    array('field' => 'name', 'order' => ZBX_SORT_UP)
            );
    CArrayHelper::sort($groups, $sortFields);
    To this
    Code:
    /*foreach($groups as &$group) {
                    $group['nodename'] = get_node_name_by_elid($group['groupid']);
            }
            unset($group);
    
            // we need natural sort
            $sortFields = array(
                    array('field' => 'nodename', 'order' => ZBX_SORT_UP),
                    array('field' => 'name', 'order' => ZBX_SORT_UP)
            );
    CArrayHelper::sort($groups, $sortFields);*/
    order_result($groups, 'name');
    If this is not a bug, could we at least get some way to choose how the dashboard widgets are sorted so that hacking the code like this isn't required?
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    thanks for reporting - filed as https://support.zabbix.com/browse/ZBX-5396
    Zabbix 3.0 Network Monitoring book

    Comment

    • arbies
      Junior Member
      • Mar 2011
      • 3

      #3
      Thanks for posting the fix, this was the first thing I noticed after upgrading from 1.8.10 to 2.0.2.

      Comment

      • cloudmafia
        Junior Member
        • Nov 2012
        • 23

        #4
        Thanks for the quick fix

        Comment

        Working...