Ad Widget

Collapse

Zabbix 1.5.5 Trunk: 5958 - Events

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

    #1

    Zabbix 1.5.5 Trunk: 5958 - Events

    Zabbix 1.5.5 Trunk: 5958 - Events

    If a user goes from Monitoring - Latest data to Events, Group: All and Host: All is shown but no events are listed below. A user has to select a host and then go back to All for the events to show up.
  • Aly
    ZABBIX developer
    • May 2007
    • 1126

    #2
    We decided to not "remember" selection "all". So it must be some side effect of previous remembering. Maybe some browser caching? When events page is loaded try refresh it through(ctrl+f5), which group and host is selected now?
    I can't reproduce such problem, but if problem will persist, I'll take a closer look.
    Zabbix | ex GUI developer

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #3
      Aly you were right. I delete the contents of my profile in the profiles table and the problem went away. Looks like it was an old value in the table. Thanks for the help and quick response. I'll do more troubleshooting next time before I post.

      Comment

      • SergK
        Junior Member
        • Jun 2008
        • 13

        #4
        I know how to reproduce this bug.
        It is happened in situation when table "profiles" is empty. In the beginning when script /events.php is called variable $_REQUEST['hostid'] (that point events related to corresponding host would be showed ) is unset.
        It is set by lately by function validate_group_with_host in this statement:
        Code:
        $_REQUEST['hostid']     = get_request('hostid', get_profile($host_var, -1));
        if there is right record in table profiles when everything goes right, but if profiles is empty then $_REQUEST['hostid'] set to -1 and $_REQUEST['groupid'] set to -1 too. In next stament $_REQUEST['groupid'] changed to 0 and after that function get_correct_group_and_host is called with parameters hostid=-1 and groupid=0. And get_correct_group_and_host set hostid to id of first host.
        So now $_REQUEST['hostid'] = 'id of first host' and events show only for this host, but in comboxes there is only one option 'All', this hostid saved to profiles and after that I don't see method to reset value of hostid to 0 from webinterface.
        So I think wrong code something validate_group_with_host or get_correct_group_and_host because then when there are no values for hostid and groupid in profiles this variables would be set to 0 and nothing else.

        Comment

        • SergK
          Junior Member
          • Jun 2008
          • 13

          #5
          Also I have figured out why I had in comboboxes Group and Host only one option 'all'. This was because in my configuration all hosts do not belong to any host group. And in this SQL statement:
          Code:
                          $sql='SELECT DISTINCT h.hostid,h.host '.
                                  ' FROM hosts h,items i,hosts_groups hg '.
                                  ' WHERE h.status='.HOST_STATUS_MONITORED.
                                          ' AND h.hostid=i.hostid '.
                                          ($_REQUEST['groupid']?' AND hg.groupid='.$_REQUEST['groupid']:'').
                                          ' AND hg.hostid=h.hostid '.
                                          ' AND '.DBcondition('h.hostid',$available_hosts).
                                  ' ORDER BY h.host';
          which selects hosts for combobox clause ' AND hg.hostid=h.hostid ' cut off all hosts that not belong to any host group.
          As I look clause ' AND hg.hostid=h.hostid ' widely used in code of frontend, so this is a bug or it is normal and each host must belong to some host group?

          Comment

          • Aly
            ZABBIX developer
            • May 2007
            • 1126

            #6
            It's not deprecated to have hosts without links to host groups and they should be visible to super admins when selected groups 'all'. But there is possibility that in future it'll be deprecated. Also be advised that such hosts are not visible to other user types(users and admins) due to you can't specify rights to such hosts!
            Zabbix | ex GUI developer

            Comment

            • pierre-hoffmann
              Senior Member
              • Jan 2008
              • 133

              #7
              Hi,
              Originally posted by Aly
              We decided to not "remember" selection "all". So it must be some side effect of previous remembering. Maybe some browser caching? When events page is loaded try refresh it through(ctrl+f5), which group and host is selected now?
              I can't reproduce such problem, but if problem will persist, I'll take a closer look.
              Same thing for trigger screen ?? Any workarround ??

              Regards,
              P.Hoffmann
              System & Network Admin.
              __________________________
              Zabbix version 1.8.1
              Hosts monitored 1300
              OS Novell SLES 10 SP2
              __________________________

              Comment

              • Aly
                ZABBIX developer
                • May 2007
                • 1126

                #8
                Only by manual url editing or frontend sources . I think it should be an option to not remember "all" selection.
                Zabbix | ex GUI developer

                Comment

                • pierre-hoffmann
                  Senior Member
                  • Jan 2008
                  • 133

                  #9
                  Originally posted by Aly
                  Only by manual url editing or frontend sources . I think it should be an option to not remember "all" selection.
                  But were i can look for ??

                  Where i'm selecting "ALL" "ALL" at refresh (30s) it lost parameter ...
                  it's big problem for the supervision ...

                  Regards
                  P.Hoffmann
                  System & Network Admin.
                  __________________________
                  Zabbix version 1.8.1
                  Hosts monitored 1300
                  OS Novell SLES 10 SP2
                  __________________________

                  Comment

                  • Aly
                    ZABBIX developer
                    • May 2007
                    • 1126

                    #10
                    include/hosts.inc.php ~930line:
                    PHP Code:
                            if($_REQUEST['hostid'] > 0update_profile($host_var,$_REQUEST['hostid'], PROFILE_TYPE_ID);
                            if(
                    $_REQUEST['groupid'] > 0update_profile($group_var,$_REQUEST['groupid'], PROFILE_TYPE_ID); 
                    change to this:
                    PHP Code:
                            update_profile($host_var,$_REQUEST['hostid'], PROFILE_TYPE_ID);
                            
                    update_profile($group_var,$_REQUEST['groupid'], PROFILE_TYPE_ID); 
                    I haven't tested it...
                    Zabbix | ex GUI developer

                    Comment

                    • pierre-hoffmann
                      Senior Member
                      • Jan 2008
                      • 133

                      #11
                      Hi,

                      I've tested and ... it works !!!! very very thanks !!!

                      To reativate Selection "all" in trigger screen of 1.6;
                      in zabbix frontends edit file "include/hosts.inc.php"
                      and in line 931 & 932 remove the "if" test
                      Code:
                      931,932c931,932
                      <               if($_REQUEST['hostid'] > 0) update_profile($host_var,$_REQUEST['hostid'], PROFILE_TYPE_ID);
                      <               if($_REQUEST['groupid'] > 0) update_profile($group_var,$_REQUEST['groupid'], PROFILE_TYPE_ID);
                      ---
                      >               update_profile($host_var,$_REQUEST['hostid'], PROFILE_TYPE_ID);
                      >               update_profile($group_var,$_REQUEST['groupid'], PROFILE_TYPE_ID);
                      (problem description here : http://www.zabbix.com/forum/showthread.php?t=11091)


                      Any question: why disable selection of "all" ??
                      Last edited by pierre-hoffmann; 17-11-2008, 16:50.
                      P.Hoffmann
                      System & Network Admin.
                      __________________________
                      Zabbix version 1.8.1
                      Hosts monitored 1300
                      OS Novell SLES 10 SP2
                      __________________________

                      Comment

                      • Aly
                        ZABBIX developer
                        • May 2007
                        • 1126

                        #12
                        Imagine that you have 10000 hosts.. with 20 triggers per host And someone selected all & all
                        Zabbix | ex GUI developer

                        Comment

                        • pierre-hoffmann
                          Senior Member
                          • Jan 2008
                          • 133

                          #13
                          Originally posted by Aly
                          Imagine that you have 10000 hosts.. with 20 triggers per host And someone selected all & all
                          Yes you're right .... i've "only" 600 hosts ...

                          Regards,
                          Pierre.
                          Last edited by pierre-hoffmann; 14-11-2008, 15:48.
                          P.Hoffmann
                          System & Network Admin.
                          __________________________
                          Zabbix version 1.8.1
                          Hosts monitored 1300
                          OS Novell SLES 10 SP2
                          __________________________

                          Comment

                          • pierre-hoffmann
                            Senior Member
                            • Jan 2008
                            • 133

                            #14
                            Hi,

                            Perhaps it could be a parameter in configuration tab ?

                            for hudge configuration enable this paramter and for medium
                            and small disable this ??

                            Regards,
                            Pierre.
                            P.Hoffmann
                            System & Network Admin.
                            __________________________
                            Zabbix version 1.8.1
                            Hosts monitored 1300
                            OS Novell SLES 10 SP2
                            __________________________

                            Comment

                            Working...