zabbix-module-latest-data icon indicating copy to clipboard operation
zabbix-module-latest-data copied to clipboard

Display correct hosts latest data - Zabbix 6.0/6.2

Open linkintegrated opened this issue 2 years ago • 28 comments

Hi, Since upgrading Zabbix from 5.4 to 6.0 and even 6.2 the module is not working correctly. We have also created a new blank install of Zabbix 6.2 and 6.0 same issue. Under Monitoring in Hosts when you click on Latest Data or left click on the host its not display that hosts latest data. Could you please help?

linkintegrated avatar Sep 01 '22 08:09 linkintegrated

Hi, make sure you use correct tag when you download code from this repository. v1.0.2 is for Zabbix 5.4 v2.0.0 is for Zabbix 6.0/6.2

BGmot avatar Sep 01 '22 12:09 BGmot

Hi, Thanks for your response see below image. We are using v2.0.0 for both installs Grouping

linkintegrated avatar Sep 01 '22 12:09 linkintegrated

I cannot reproduce. Can you take a look at your php/apache(or nginx) logs and tell me what error you see there?

BGmot avatar Sep 01 '22 12:09 BGmot

This is a repeated error found in the error.log of apache relating to the module. Centos 8 Stream install and running PHP 7.4.30.

[Wed Aug 31 17:01:53.900008 2022] [proxy_fcgi:error] [pid 13447:tid 139859595339520] [client] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Class 'Modules\BGmotLD\Actions\CControllerResponseFatal' not found in /usr/share/zabbix/modules/zabbix-module-latest-data-main/actions/CControllerBGLatestViewRefresh.php:68\nStack trace:\n#0 /usr/share/zabbix/include/classes/mvc/CController.php(462): Modules\BGmotLD\Actions\CControllerBGLatestViewRefresh->checkInput()\n#1 /usr/share/zabbix/include/classes/core/ZBase.php(599): CController->run()\n#2 /usr/share/zabbix/include/classes/core/ZBase.php(216): ZBase->processRequest()\n#3 /usr/share/zabbix/include/config.inc.php(25): ZBase->run()\n#4 /usr/share/zabbix/zabbix.php(22): require_once('/usr/share/zabb...')\n#5 {main}\n thrown in /usr/share/zabbix/modules/zabbix-module-latest-data-main/actions/CControllerBGLatestViewRefresh.php on line 68'

linkintegrated avatar Sep 01 '22 16:09 linkintegrated

Can you copy paste URL from your browser after you go to Monitoring->Latest data please?

BGmot avatar Sep 01 '22 17:09 BGmot

Please remove and install this module again off main branch https://github.com/BGmot/zabbix-module-latest-data/archive/refs/heads/main.zip. I've found and fixed the PHP error you are seeing in logs. Now you should be able to see in your browser what is not liked by Zabbix. Please tell me what you see.

BGmot avatar Sep 02 '22 02:09 BGmot

Thanks error has been cleared; however still performing the same behaviour. Under Monitoring > Latest data the URL of the host latest data is

Zabbix 6.2 http://IP_ADDRESS/zabbix.php?action=latest.view&hostids%5B0%5D=10530&filter_name=

Which is the correct ID. however its still display Latest data from the last host not the actual one

However we have another instance of Zabbix 5.4. If I perform the below it works in 5.4. If I copy the above URL amend in Zabbix 6.2 it works

Zabbix 5.4 http://IP_ADDRESS/zabbix.php?action=latest.view&filter_set=1&filter_hostids%5B0%5D=10530

It appears the URL has changed between Zabbix 5.4 and 6.2 which is causing issue with the module within the latest data url

linkintegrated avatar Sep 02 '22 09:09 linkintegrated

Try to start with http://IP_ADDRESS/zabbix.php?action=latest.view

BGmot avatar Sep 03 '22 00:09 BGmot

It displays the last host to obtain the latest data. URL is the same as above

linkintegrated avatar Sep 05 '22 07:09 linkintegrated

Can you please post bunch of screenshots... with URL and what's shown below. I cannot reproduce the problem.

BGmot avatar Sep 06 '22 00:09 BGmot

zabbix2 zabbix1

linkintegrated avatar Sep 08 '22 08:09 linkintegrated

See attached

linkintegrated avatar Sep 08 '22 08:09 linkintegrated

You are showing Hosts menu item not Latest data.

BGmot avatar Sep 09 '22 00:09 BGmot

image

linkintegrated avatar Sep 09 '22 09:09 linkintegrated

Thanks but I don't see anything wrong here, all metrics properly grouped and this is what the plugin does.

BGmot avatar Sep 09 '22 11:09 BGmot

When I click on the hosts, then host and latest data for that host. Its display the correct record of that host. Its displays another host data

linkintegrated avatar Sep 12 '22 15:09 linkintegrated

I am afraid I don't understand.

BGmot avatar Sep 12 '22 15:09 BGmot

Do you have an email so I can sent you a video

linkintegrated avatar Sep 12 '22 15:09 linkintegrated

ey at bgmot.com

BGmot avatar Sep 12 '22 15:09 BGmot

Thanks Email sent

linkintegrated avatar Sep 12 '22 17:09 linkintegrated

Thanks for reporting this bug! Please test new version of this plugin https://github.com/BGmot/zabbix-module-latest-data/tree/v2.0.1

BGmot avatar Sep 13 '22 02:09 BGmot

Hi

Since upgrading to 6.2 to 6.4 Zabbix. The issues experiencing the same issues which we experienced with 6.2

We we search within the host > press latest data. It not showing information for that host

linkintegrated avatar Apr 21 '23 09:04 linkintegrated

I cannot reproduce.

  1. Open Latest data
  2. in Filter select one host and click 'Apply' I see Latest data only for this host.

Please give steps to reproduce.

BGmot avatar May 07 '23 21:05 BGmot

Basically I search a host. Select Latest data under monitoring. It only displays previous host latest data or zabbix server. Also Under Monitoring > Hosts > Select Latest data. Same again

URL is http://localhost/zabbix/zabbix.php?action=latest.view&hostids[]=14374&filter_set=1

However on our Zabbix 6.2 instance using the same module the URL. Where the module works. The URL is during the same test

http://localhost/zabbix/zabbix.php?action=latest.view&hostids[]=14374&filter_name=

If I copy the URL from the zabbix 6.2 to the 6.4 instance as both systems are the same. it works

Could we please change the code from &filter_set=1 to &filter_name=

linkintegrated avatar May 11 '23 08:05 linkintegrated

Yes I have tested this '&filter_set=1 to &filter_name=1' link change and it works in terms of the specific host being selected in Zabbix 6.0.17 (module 2.0.1).

However it wont let you filter on item names, tags or anything else as it gets cleared etc

jamescook000 avatar May 30 '23 23:05 jamescook000

I can't change to filter_name= as it is coming from page not controlled by this module, moreover you can remove filter_name= from URL and it will still work. Nevertheless I tried to fix this issue in https://github.com/BGmot/zabbix-module-latest-data/tree/v3.0.1 please test.

BGmot avatar Jun 12 '23 12:06 BGmot

Hi,

I tried using branch v3.0.1 for Zabbix 6.0.X and it reports 'Unable to load module'.

However I have manually put your code changes in yesterdays commits in place and can confirm they work and the latest data will now open with only the specific hosts latest data rather than all, so thanks.

I guess the code for 6.0.X needs to have its own branch based off tag v2.0.1 with yesterdays changes as there is some form of incompatibility.

Regards James

jamescook000 avatar Jun 13 '23 00:06 jamescook000

v2.0.2 works for issue (https://github.com/BGmot/zabbix-module-latest-data/issues/3) and now just the file 'actions/CControllerBGLatestView.php' need to be updated with:

Line 222: // CBGProfile::updateArray('web.latest.filter.hostids', $this->getInput('filter_hostids', []), PROFILE_TYPE_ID); if (!$this->hasInput('hostids')) { CBGProfile::updateArray('web.latest.filter.hostids', $this->getInput('filter_hostids', []), PROFILE_TYPE_ID); }

jamescook000 avatar Jun 27 '23 22:06 jamescook000