Ad Widget

Collapse

Version Pre 1.7.0 Build 6714 - Trigger Status - All

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Palmertree
    Senior Member
    • Sep 2005
    • 746

    #1

    Version Pre 1.7.0 Build 6714 - Trigger Status - All

    This is not a bug but I just wanted to share my code that I came up with in case anyone was interested in it. I would have place this topic in patches but since 1.7.0 is not an official release yet, I thought it should go here. If you like the new Zabbix feature ZBX_DROPDOWN_FIRST_ENTRY, like I do, that makes Zabbix menus fast when you have a lot of host and items but if you want to see all your trigger statuses when in monitoring mode, I came up with the following code sniplet to do it.

    Code:
    diff -ruN zabbix-original/frontends/php/include/defines.inc.php zabbix/frontends/php/include/defines.inc.php
    --- zabbix-original/frontends/php/include/defines.inc.php       2009-02-12 21:35:38.000000000 -0500
    +++ zabbix/frontends/php/include/defines.inc.php        2009-02-13 00:22:21.000000000 -0500
    @@ -44,9 +44,11 @@
            define('ZBX_MAX_PERIOD', 12*31*24*3600);                // ~1 year
            define('ZBX_PERIOD_DEFAULT', ZBX_MIN_PERIOD);
    
    -       define('ZBX_DROPDOWN_FIRST_ENTRY',              1);             // 0 - NONE, 1 - ALL
    +       define('ZBX_DROPDOWN_FIRST_ENTRY',              0);             // 0 - NONE, 1 - ALL
            define('ZBX_DROPDOWN_FIRST_REMEMBER',   1);             // 0 - do NOT remember, 1 - do remember
    
    +       define('ZBX_DROPDOWN_FIRST_ENTRY_TR_STATUS',    1);     // 0 - NONE, 1 - ALL
    +
            define('ZBX_DISABLE_MENU_CACHE',                0);             // set 1 to disable
    
     /* END OF USERS DEFINES */
    
    
    diff -ruN zabbix-original/frontends/php/include/hosts.inc.php zabbix/frontends/php/include/hosts.inc.php
    --- zabbix-original/frontends/php/include/hosts.inc.php 2009-02-12 21:35:38.000000000 -0500
    +++ zabbix/frontends/php/include/hosts.inc.php  2009-02-13 00:22:21.000000000 -0500
    @@ -815,6 +815,7 @@
            $dd_first_entry = ZBX_DROPDOWN_FIRST_ENTRY;
     //     if($page['menu'] == 'config') $dd_first_entry = ZBX_DROPDOWN_FIRST_NONE;
            if($def_options['allow_all']) $dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;
    +       if(($page['file'] == 'tr_status.php') && (ZBX_DROPDOWN_FIRST_ENTRY_TR_STATUS  == ZBX_DROPDOWN_FIRST_ALL)) $dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;
    
            $result = array('selected'=>0, 'groups'=> array(), 'groupids'=> array());
            $groups = &$result['groups'];
    @@ -1020,6 +1021,7 @@
            if($page['menu'] == 'config') $dd_first_entry = ZBX_DROPDOWN_FIRST_NONE;
            if($def_options['allow_all']) $dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;
            if(($groupid == 0) && (ZBX_DROPDOWN_FIRST_ENTRY == ZBX_DROPDOWN_FIRST_ALL)) $dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;
    +       if(($page['file'] == 'tr_status.php') && (ZBX_DROPDOWN_FIRST_ENTRY_TR_STATUS  == ZBX_DROPDOWN_FIRST_ALL)) $dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;
    
            $result = array('selected'=>0, 'hosts'=> array(), 'hostids'=> array());
            $hosts = &$result['hosts'];
    @@ -1181,6 +1183,7 @@
                    $dd_first_entry = ZBX_DROPDOWN_FIRST_ENTRY;
                    if($page['menu'] == 'config') $dd_first_entry = ZBX_DROPDOWN_FIRST_NONE;
                    if(($PAGE_GROUPS['selected'] == 0) && (ZBX_DROPDOWN_FIRST_ENTRY == ZBX_DROPDOWN_FIRST_ALL)) $dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;
    +               if(($page['file'] == 'tr_status.php') && (ZBX_DROPDOWN_FIRST_ENTRY_TR_STATUS  == ZBX_DROPDOWN_FIRST_ALL)) $dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;
    
     //             if($page['menu'] == 'config') $dd_first_entry = ZBX_DROPDOWN_FIRST_NONE;
  • Aly
    ZABBIX developer
    • May 2007
    • 1126

    #2
    There is array variable "options".
    PHP Code:
    $options = array('allow_all_hosts','monitored_hosts','with_monitored_items'); 
    Just add option "allow_all", like that
    PHP Code:
    $options = array('allow_all_hosts','monitored_hosts','with_monitored_items','allow_all'); 
    Zabbix | ex GUI developer

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #3
      Thanks. I will try this instead. Looks simpler to implement.

      Comment

      Working...