Ad Widget

Collapse

Zabbix 1.5.1 (5638)- Dashboard and Application Groups Personal Profile

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

    #1

    Zabbix 1.5.1 (5638)- Dashboard and Application Groups Personal Profile

    Zabbix Team,
    Not sure if it is my setup up but tried this with different user accounts. When you go into the Dashboard and do "Show/Hide" on a Dashboard block the setting will not be remembered if you come back to the dashboard again. Also, if you uncollapse a application group and then come back to the items the application group is collapsed again. Sorry for being so picky. These use to work in the pervious 1.5.x builds.
  • Aly
    ZABBIX developer
    • May 2007
    • 1126

    #2
    Have you updated table 'profiles'? Schema is changed
    Zabbix | ex GUI developer

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #3
      Yes add about 2 or 3 new columns. I had to truncate the profile table too because I was getting some errors. So first I created the new columns. Tried Zabbix but was getting some warnings about invalid references. Next, truncated the profiles table and the errors went away. I can see information being populated to the new columns but it seems like the user preferences in the dashboard and items are not working correctly. I will dig around to see if I can find anything.

      Comment

      • Palmertree
        Senior Member
        • Sep 2005
        • 746

        #4
        Another side note to my previous message, the favorites are being saved on the dashboard it's just the show/hide is not remembered and the last view in items. Thanks again for the help.

        Comment

        • Aly
          ZABBIX developer
          • May 2007
          • 1126

          #5
          Mmm about application group, as I understood this is 'latest data' screen, right? Well try to update to latest release because it seems everything is working, including show/hide
          Zabbix | ex GUI developer

          Comment

          • Palmertree
            Senior Member
            • Sep 2005
            • 746

            #6
            Will do. I will install the latest release today and let you know. :-) Thanks Aly again for the help.

            Comment

            • Palmertree
              Senior Member
              • Sep 2005
              • 746

              #7
              Maybe this is by design but the problem still occurs.

              Here are the steps I am taking:
              1.) Go and do a show/hide for the blocks (web, status, etc.) in the dashboard and minimize all the blocs on the right side of the screen.
              2.) Click on "latestdata"
              3.) Go back to the "Dashboard" and the blocks are still minimized or hidden on the right side of the dashboard. This so far looks right. :-)
              4.) Logout of Zabbix.
              5.) Log back into Zabbix and go to the dashboard and everything on the right is not hidden or minimized anymore. Not sure if this is by design or not.

              Comment

              • Aly
                ZABBIX developer
                • May 2007
                • 1126

                #8
                I don't now what to say, but I cannot reproduce this problem (IE,FF), all working just fine..

                Maybe this related to some custom indexes in your profiles table? Or may be you need to clean out profiles table..
                Zabbix | ex GUI developer

                Comment

                • Palmertree
                  Senior Member
                  • Sep 2005
                  • 746

                  #9
                  Thanks for checking. I will look around on my side to see if I can figure out what's going on with my end.

                  Comment

                  • Palmertree
                    Senior Member
                    • Sep 2005
                    • 746

                    #10
                    When a user's profile is saved for the "Dashboard" show/hide status, what "idx" value or name should be inserted/updated in the "profile" table? Thanks in advance for the help.

                    Comment

                    • Aly
                      ZABBIX developer
                      • May 2007
                      • 1126

                      #11
                      web.dashboard.hats.xxxxxxxx.state = 1- shown/0-hidden

                      xxxxxx - id of the hat;
                      Zabbix | ex GUI developer

                      Comment

                      • Palmertree
                        Senior Member
                        • Sep 2005
                        • 746

                        #12
                        Thanks Aly for the info.

                        Comment

                        • Palmertree
                          Senior Member
                          • Sep 2005
                          • 746

                          #13
                          I found the problem and a fix. This fix actually fixes some other problems I was having with personal settings not saving on the web frontend on different web pages like latestdata, last graph viewed,ect. To create the scenarios of the dashboard not saving a user's last state do the following:

                          1. Make sure there are no keys of type web.dashboard.hats in the profiles table for the user's id you want to test.
                          2. Now go into web frontend to the dashboard, and then look at the profile table in the database for the user id. You will notice that the keys are not initially created if they do not exist already with value of 1.
                          3. Now minimize or hide one of the blocks on the dashboard. Now look at the profile table for the user. You will sill notice that the idx values for the web blocks are still not created. They should have entries in the profile tables with values of 0 but they do not exist.
                          4. Now maximize or show the block that was minimized. Now view the profile table and you will see that one entry pop up in the profile table. After this happens the show/hide works perfectly for this one block only.

                          It looks like the initial creation of the default values for the idx values are not being created if they do not exist already. To fix this, and some other issues that I was having, I made the following change to the profiles.inc.php so that the default values are created in the profiles table if they do not exist already.

                          profiles.inc.php [Changes are in red]

                          Before:
                          Code:
                          25 function get_profile($idx,$default_value=null,$type=PROFILE_TYPE_UNKNOWN,$resource=null){
                           26         global $USER_DETAILS;
                           27
                           28         $result = $default_value;
                           29
                           30         if($USER_DETAILS["alias"]!=ZBX_GUEST_USER){
                           31                 $sql = 'SELECT value, valuetype '.
                           32                                 ' FROM profiles '.
                           33                                 ' WHERE userid='.$USER_DETAILS["userid"].
                           34                                         ' AND idx='.zbx_dbstr($idx).
                           35                                         (is_null($resource)?'':' AND resource='.zbx_dbstr($resource)).
                           36                                 ' ORDER BY profileid ASC';
                           37                 $db_profiles = DBselect($sql);
                           38
                           39                 if($profile=DBfetch($db_profiles)){
                           40
                           41                         if(PROFILE_TYPE_UNKNOWN == $type) $type = $profile["valuetype"];
                           42
                           43                         if(PROFILE_TYPE_ARRAY == $type){
                           44                                 $result[] = $profile['value'];
                           45                                 while($profile=DBfetch($db_profiles)){
                           46                                         $result[] = $profile['value'];
                           47                                 }
                           48                         }
                           49                         else{
                           50                                 $result = strval($profile["value"]);
                           51                         }
                           52                 }
                           53         }
                           54
                           55 return $result;
                           56 }
                          After:
                          Code:
                           25 function get_profile($idx,$default_value=null,$type=PROFILE_TYPE_UNKNOWN,$resource=null){
                           26         global $USER_DETAILS;
                           27
                           28         $result = $default_value;
                           29
                           30         if($USER_DETAILS["alias"]!=ZBX_GUEST_USER){
                           31                 $sql = 'SELECT value, valuetype '.
                           32                                 ' FROM profiles '.
                           33                                 ' WHERE userid='.$USER_DETAILS["userid"].
                           34                                         ' AND idx='.zbx_dbstr($idx).
                           35                                         (is_null($resource)?'':' AND resource='.zbx_dbstr($resource)).
                           36                                 ' ORDER BY profileid ASC';
                           37                 $db_profiles = DBselect($sql);
                           38
                           39                 if($profile=DBfetch($db_profiles)){
                           40
                           41                         if(PROFILE_TYPE_UNKNOWN == $type) $type = $profile["valuetype"];
                           42
                           43                         if(PROFILE_TYPE_ARRAY == $type){
                           44                                 $result[] = $profile['value'];
                           45                                 while($profile=DBfetch($db_profiles)){
                           46                                         $result[] = $profile['value'];
                           47                                 }
                           48                         }
                           49                         else{
                           50                                 $result = strval($profile["value"]);
                           51                         }
                           52                 }
                          [COLOR="Red"] 53                 else{
                           54                         update_profile($idx,$default_value,$type,$resource);
                           55                 }[/COLOR]
                           56         }
                           57
                           58 return $result;
                           59 }
                          Last edited by Palmertree; 10-05-2008, 16:06.

                          Comment

                          • Aly
                            ZABBIX developer
                            • May 2007
                            • 1126

                            #14
                            Great work Palmertree I can confirm this problem.
                            But fix isn't correct..

                            In profile.inc.php, function "insert_profile", change:
                            Code:
                            	if(empty($val1)) return false;
                            To:
                            Code:
                            	if(is_null($val1)) return false;
                            That should do the trick.

                            Thank you.
                            Zabbix | ex GUI developer

                            Comment

                            • Palmertree
                              Senior Member
                              • Sep 2005
                              • 746

                              #15
                              Thanks Aly. I will wait until the SVN is posted and I will test. Thanks again.

                              Comment

                              Working...