BGmot / zabbix-module-latest-data

A Zabbix 5.4 module to group items under Monitoring -> Latest data per Tag as it used to be with Application grouping in previous versions of Zabbix
21 stars 5 forks source link

Display correct hosts latest data - Zabbix 6.0/6.2 #2

Open linkintegrated opened 2 years ago

linkintegrated commented 2 years ago

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?

BGmot commented 2 years ago

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

linkintegrated commented 2 years ago

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

BGmot commented 2 years ago

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

linkintegrated commented 2 years ago

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'

BGmot commented 2 years ago

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

BGmot commented 2 years ago

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.

linkintegrated commented 2 years ago

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

BGmot commented 2 years ago

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

linkintegrated commented 2 years ago

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

BGmot commented 2 years ago

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

linkintegrated commented 2 years ago

zabbix2 zabbix1

linkintegrated commented 2 years ago

See attached

BGmot commented 2 years ago

You are showing Hosts menu item not Latest data.

linkintegrated commented 2 years ago

image

BGmot commented 2 years ago

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

linkintegrated commented 2 years ago

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

BGmot commented 2 years ago

I am afraid I don't understand.

linkintegrated commented 2 years ago

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

BGmot commented 2 years ago

ey at bgmot.com

linkintegrated commented 2 years ago

Thanks Email sent

BGmot commented 2 years ago

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

linkintegrated commented 1 year ago

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

BGmot commented 1 year ago

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.

linkintegrated commented 1 year ago

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=

jamescook000 commented 1 year ago

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

BGmot commented 1 year ago

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.

jamescook000 commented 1 year ago

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 commented 1 year ago

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); }