Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
linkintegrated opened this issue Sep 1, 2022 · 28 comments
Open

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

linkintegrated opened this issue Sep 1, 2022 · 28 comments

Comments

@linkintegrated
Copy link

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
Copy link
Owner

BGmot commented Sep 1, 2022

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
Copy link
Author

linkintegrated commented Sep 1, 2022

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

@BGmot
Copy link
Owner

BGmot commented Sep 1, 2022

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

@linkintegrated
Copy link
Author

linkintegrated commented Sep 1, 2022

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
Copy link
Owner

BGmot commented Sep 1, 2022

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

@BGmot
Copy link
Owner

BGmot commented Sep 2, 2022

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
Copy link
Author

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
Copy link
Owner

BGmot commented Sep 3, 2022

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

@linkintegrated
Copy link
Author

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

@BGmot
Copy link
Owner

BGmot commented Sep 6, 2022

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

@linkintegrated
Copy link
Author

zabbix2
zabbix1

@linkintegrated
Copy link
Author

See attached

@BGmot
Copy link
Owner

BGmot commented Sep 9, 2022

You are showing Hosts menu item not Latest data.

@linkintegrated
Copy link
Author

image

@BGmot
Copy link
Owner

BGmot commented Sep 9, 2022

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

@linkintegrated
Copy link
Author

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
Copy link
Owner

BGmot commented Sep 12, 2022

I am afraid I don't understand.

@linkintegrated
Copy link
Author

linkintegrated commented Sep 12, 2022 via email

@BGmot
Copy link
Owner

BGmot commented Sep 12, 2022

ey at bgmot.com

@linkintegrated
Copy link
Author

linkintegrated commented Sep 12, 2022

Thanks Email sent

BGmot added a commit that referenced this issue Sep 13, 2022
@BGmot
Copy link
Owner

BGmot commented Sep 13, 2022

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
Copy link
Author

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
Copy link
Owner

BGmot commented May 7, 2023

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
Copy link
Author

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
Copy link

jamescook000 commented May 30, 2023

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
Copy link
Owner

BGmot commented Jun 12, 2023

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
Copy link

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
Copy link

jamescook000 commented Jun 27, 2023

v2.0.2 works for issue (#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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants