在使用 zabbix 3.0.4
界面上 last 20 issuus 没掉了,查了很久,没有发现具体在哪里配置,最后想到直接查zabbix源码,把东西调出来
找到
先找到哪里控制显示的:app/views/monitoring.dashboard.view.php
foreach ($widgets as $widgetid => $widget) {
$profile = 'web.dashboard.widget.'.$widgetid;
$rate = CProfile::get($profile.'.rf_rate', 60);
$expanded = (bool) CProfile::get($profile.'.state', true);
$col = CProfile::get($profile.'.col', $widget['defaults']['col']);
$row = CProfile::get($profile.'.row', $widget['defaults']['row']);
这里说,在CProfile里面拿到一个开关,长宽;感觉这个就是在数据库里面拿的,顺着查下去
找到include/classes/user/CProfile.php;CProfile这个类就是在MySQL里面profiles表拉配置数据
找了其他的用户看,发现自己的账号缺少了这么一行,profileid是zabbix程序里面控制自增的,userid 表示自己的用户id
select * from profiles where userid=1 and idx like 'web.dashboard.widget.lastiss%%' ;
+-----------+--------+------------------------------------+----------+----------+-----------+----------------+--------+------+
| profileid | userid | idx | idx2 | value_id | value_int | value_str | source | type |
+-----------+--------+------------------------------------+----------+----------+-----------+----------------+--------+------+
| 101809 | 1 | web.dashboard.widget.lastiss.state | 0 | 0 | 1 | | | 2 |
+-----------+--------+------------------------------------+----------+----------+-----------+----------------+--------+------+
看着这个就是开关,直接人工insert一句
insert into profiles ( profileid,userid,idx,value_int,type) values (101809, 1, 'web.dashboard.widget.lastiss.state', 1,2)
刷新还是不行
又想了下,这个col,row, 就是在这个widget所在行列都是数据库里面控制的,如果widget的行列冲突了会发生什么?会不会显示不出来?
随意移动了一下页面上的widget,确定没有冲突
刷新一下,问题解决。。