Ad Widget

Collapse

Zabbix 1.5 - Undefined offset - profiles.inc.php

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

    #1

    Zabbix 1.5 - Undefined offset - profiles.inc.php

    This error pops up frequently. Especially if you have multiple browsers opened up to Zabbix for the same user account. Error is seen when viewing the dashboard and graphs.

    Undefined offset: 1[/var/www/html/zabbix/include/profiles.inc.php:123]
  • Aly
    ZABBIX developer
    • May 2007
    • 1126

    #2
    Does a pages load slowly?
    Zabbix | ex GUI developer

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #3
      Yes it actually happening now and the page is taking minutes or not loading at all.

      Comment

      • Palmertree
        Senior Member
        • Sep 2005
        • 746

        #4
        Is anyone else seeing the same issue?

        Comment

        • toteleiche
          Junior Member
          • Mar 2008
          • 9

          #5
          Yes, I have the same issue, but I noticed it only once.
          But pages are loading fast...

          Working on Zabbix 1.5 (Downloaded: 18.03.08)

          Comment

          • Aly
            ZABBIX developer
            • May 2007
            • 1126

            #6
            There is possibility of such behavior when multiple browsers are opened under the same zabbix user.

            Soon will be fixed.
            Zabbix | ex GUI developer

            Comment

            • Palmertree
              Senior Member
              • Sep 2005
              • 746

              #7
              Thanks Aly and thanks toteleiche for confirming this too.

              Comment

              • Palmertree
                Senior Member
                • Sep 2005
                • 746

                #8
                I modified the profiles.inc.php around line number 123 to look like this and it has fixed the issue. It looks like the array for rows[1] was null or empty.

                Code:
                        for($i = 0; $i < ZBX_HISTORY_COUNT; $i++){
                                if($rows = get_profile('web.history.'.$i,false)){
                                        if($i>0){
                                                array_push($history,$delimiter);
                                        }
                                        if(isset($rows[1]))
                                                $url = new CLink($rows[0],$rows[1],'history');
                                        else
                                                $url = new CLink($rows[0],'history');
                
                                                array_push($history,array(SPACE,$url,SPACE));
                                }
                        }

                Comment

                • Aly
                  ZABBIX developer
                  • May 2007
                  • 1126

                  #9
                  May be it does but the problem stays in this case.The problem was in how the data saved in DB while several browsers working with the frontend. It's not about history it self, it's about how profile saves the arrays.

                  It's should be fixed in rev. 5505, but more testing would be appreciated.
                  Zabbix | ex GUI developer

                  Comment

                  • Palmertree
                    Senior Member
                    • Sep 2005
                    • 746

                    #10
                    Aly, thanks for the quick fix. I've just tested Trunk version 5505. The error went away but now the link is showing in the History bar and not the description name for GRAPHS and MAPS. When the history link is clicked it tries to use an URL that is the description name itself and not the url. Looks like the logic is just reversed. :-)
                    Last edited by Palmertree; 20-03-2008, 14:53.

                    Comment

                    • Aly
                      ZABBIX developer
                      • May 2007
                      • 1126

                      #11
                      I think this is a result of previously corrupted data, may I ask you to create new user and navigate through the frontend by this new account.
                      Zabbix | ex GUI developer

                      Comment

                      • Palmertree
                        Senior Member
                        • Sep 2005
                        • 746

                        #12
                        Created a new user and I am getting the same results for the history bar. Here is an example of what it looks like:

                        charts.php » charts.php » charts.php?hostid=100100000000032 » charts.php?hostid=100100000000032&graphid=10010000 0000060

                        Comment

                        • Aly
                          ZABBIX developer
                          • May 2007
                          • 1126

                          #13
                          I'm a little bit confused because I do not see such behavior Are U using pure frontend from svn or it's merged with some changes?
                          Zabbix | ex GUI developer

                          Comment

                          • Palmertree
                            Senior Member
                            • Sep 2005
                            • 746

                            #14
                            Frontend is merged with changes. I will try the version off SVN without any changes and I will report back my finding. :-)

                            Comment

                            • Palmertree
                              Senior Member
                              • Sep 2005
                              • 746

                              #15
                              I noticed that there are 2 entries in the profiles table for each history item (web.history.0) one for the title and one for the url.

                              How does zabbix know which one is what?

                              This is just a thought. Maybe we need something like web.history.0.title and web.history.0.url.
                              Last edited by Palmertree; 20-03-2008, 17:36.

                              Comment

                              Working...