PDA

View Full Version : Zabbix 1.5.5 Trunk: 5958 - Events


Palmertree
02-09-2008, 16:06
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
02-09-2008, 17:20
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.

Palmertree
03-09-2008, 13:46
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. :D

SergK
05-09-2008, 22:17
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:

$_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.

SergK
07-09-2008, 20:39
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:

$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?

Aly
08-09-2008, 11:25
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!

pierre-hoffmann
13-11-2008, 11:10
Hi,
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,

Aly
14-11-2008, 12:01
Only by manual url editing or frontend sources :). I think it should be an option to not remember "all" selection.

pierre-hoffmann
14-11-2008, 12:17
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

Aly
14-11-2008, 12:36
include/hosts.inc.php ~930line: 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);


change to this: update_profile($host_var,$_REQUEST['hostid'], PROFILE_TYPE_ID);
update_profile($group_var,$_REQUEST['groupid'], PROFILE_TYPE_ID);


I haven't tested it... :rolleyes:

pierre-hoffmann
14-11-2008, 13:14
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
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" ??

Aly
14-11-2008, 13:58
Imagine that you have 10000 hosts.. with 20 triggers per host ;) And someone selected all & all

pierre-hoffmann
14-11-2008, 14:39
Imagine that you have 10000 hosts.. with 20 triggers per host ;) And someone selected all & all

Yes you're right .... :eek: i've "only" 600 hosts ...

Regards,
Pierre.

pierre-hoffmann
17-11-2008, 15:48
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.