I want to know ... UserTracking query
-
Hi @Tom-Elliott,
Yes, I think the same but is very strange, because is very frequent. For example, today 20 times??
-
Maybe another user has the page open to this report?
I could see if maybe the host page were being accessed the same “mostly” query would be used except adding a WHERE clause to limit the results to that of that particular host.(
WHERE hosts.hostID='<SOMEHOSTIDHERE>'
)I don’t know who’s doing the query. Maybe look at the access log and search for the particular report?
Sorry I’m not more helpful.
-
@Tom-Elliott I try the select with the WHERE hosts.hostID=‘<SOMEHOSTIDHERE>’ clausure and goes better XD from 50 seconds downs to 0.044 seconds. If is possible, please, implement this little improvement.
-
Anyway, I think there must be someone else doing the query.
-
Hi @Tom-Elliott again,
We found who does the query XD accidentaly. If you access to the host edit page, the query is made. For example:
/fog/management/index.php?node=host&sub=edit&id=614
Then, every time a technician accesses the page of a host, my server is freezed XD. The problem is the hostLoginHistory() function which is called by edit() function in line 3257 from hostmanagementpage.class.php.
-
Hi @Sebastian-Roth and @Tom-Elliott ,
I have fixed this bug in my server making a little change in hostlogins function.
File: hostmanagementpage.class.php
Line: 3767Route::listem('UserTracking');
To:
Route::listem('UserTracking', array( 'hostID' => $this->obj->get('id'), 'action' => array('', 0, 1) ) );
I can push the changes but, maybe is better that Sebastian or Tom do them.
-
@Fernando-Gietz Thanks a lot for figuring this out! Looks good from my point of view. I will push the fix to the dev-branch in the next hours.
-
@Fernando-Gietz Just pushed to
dev-branch
. Thanks again! Should we mark this solved? -
@Fernando-Gietz Seems like we have introduced some PHP warning when adding that fix to
dev-branch
. See thePHP Warning: Illegal offset type in /var/www/html/fog/lib/fog/fogmanagercontroller.class.php on line 296
messages here: https://forums.fogproject.org/topic/13602/errors-in-apache-log-and-www-error-logI won’t revert your fix as I think you are totally right. It shouldn’t query the full userTracking table if it only wants the information for one particular host! But the problem seems to be the action array send with the query. I’ll have a closer look at this now.
Edit: Nevermind, just pushed out a fix to
dev-branch
. -
I returned XD thanks for all @Sebastian-Roth