[ZBXNEXT-5179] It is impossible to automate installation of loadable module Created: 2019 Mar 03  Updated: 2024 Apr 10  Resolved: 2019 Jun 12

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Agent (G), Proxy (P), Server (S)
Affects Version/s: None
Fix Version/s: 4.0.10rc1, 4.2.4rc1, 4.4.0alpha1, 4.4 (plan)

Type: New Feature Request Priority: Blocker
Reporter: Glebs Ivanovskis Assignee: Aleksejs Sestakovs
Resolution: Fixed Votes: 1
Labels: configuration, installation, loadablemodule
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team C
Sprint: Sprint 51 (Apr 2019), Sprint 52 (May 2019), Sprint 53 (Jun 2019)
Story Points: 0.125

 Description   

Steps to reproduce:

  1. Imagine you are an author of loadable module.
  2. Your users can build your module simply by running make.
  3. You want to make installation process as easy as make install.

Result:
This is impossible. According to documentation:

The modules must be located in directory specified by LoadModulePath.

It is not an option to install module to the default LoadModulePath because it will deny user ability to change it. Module can't also choose it's own LoadModulePath because it will lead to conflicts between different modules.

Expected:
Allow to specify absolute path to module in LoadModule, this way module's installer will be able to point Zabbix to the correct place without messing up the rest of configuration.



 Comments   
Comment by Arturs Lontons [ 2019 Mar 04 ]

Hi, Glebs.

From my point of view this looks more like a feature request. Do you agree with us changing the type of the issue to Feature request or do you insist that this is a bug in Zabbix?

Comment by Glebs Ivanovskis [ 2019 Mar 04 ]

I see it as a design flaw. Luckily, it can be fixed without adding extra configuration parameters in backward-compatible manner. Here is how I envision the solution:

  1. If LoadModule starts with "/" then assume it is an absolute path, so pass it straight to dlopen().
  2. If LoadModule does not start with "/" then assume it is relative to LoadModulePath, so pass LoadModulePath/LoadModule to dlopen().
Index: src/libs/zbxmodules/modules.c
===================================================================
--- src/libs/zbxmodules/modules.c	(revision 90575)
+++ src/libs/zbxmodules/modules.c	(working copy)
@@ -235,7 +235,10 @@
 	ZBX_HISTORY_WRITE_CBS	(*func_history_write_cbs)(void);
 	zbx_module_t		*module, module_tmp;
 
-	zbx_snprintf(full_name, sizeof(full_name), "%s/%s", path, name);
+	if ('/' != *name)
+		zbx_snprintf(full_name, sizeof(full_name), "%s/%s", path, name);
+	else
+		zbx_snprintf(full_name, sizeof(full_name), "%s", name);
 
 	zabbix_log(LOG_LEVEL_DEBUG, "loading module \"%s\"", full_name);
 

You can call it a Feature request and I will be OK with that provided that it will not prevent the issue to be fixed in 4.0.x (and hopefully 3.0.y too).

Comment by Alexander Vladishev [ 2019 Apr 16 ]

cyclone, this feature will be added from version 4.0.x. Unfortunately, support for 3.0 is now limited to blockers and vulnerabilities.

Comment by Glebs Ivanovskis [ 2019 Apr 16 ]

Thank you! I'm OK with that, since my own module relies on functionality of 3.2 and higher.

Comment by Aleksejs Sestakovs [ 2019 May 29 ]

Available in:

  • 4.0.10rc1 01ae3bff0b
  • 4.2.4rc1 0d9e1424c5
  • 4.4.0alpha1 (trunk) 1e06a496ca
Comment by Glebs Ivanovskis [ 2019 Jun 10 ]

Dear asestakovs, your comment above contradicts Fix Versions. Could you please elaborate what's going on here?

Comment by Aleksejs Sestakovs [ 2019 Jun 11 ]

Hi Glebs,

Thank you for your notice. I have fixed the version numbers in the comment.

Generated at Fri Apr 26 18:45:22 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.