Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 749351

Summary: net-analyzer/zabbix-5.0.3: add USE=agent2 to enable support for zabbix-agent2
Product: Gentoo Linux Reporter: Chris Paras <chris>
Component: Current packagesAssignee: Miroslav Šulc <fordfrog>
Status: RESOLVED FIXED    
Severity: normal CC: alicef, patrick, public, williamh
Priority: Normal Keywords: EBUILD, PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/19653
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: zabbix-5.0.3 ebuild with agent2 USE flag (INCOMPLETE)
zabbix-5.2.4 ebuild with agent2 useflag
systemd tmpfiles for zabbix-agent2
systemd service for zabbix-agent2
openrc file for zabbix-agent2

Description Chris Paras 2020-10-15 22:26:35 UTC
Ebuild for net-misc/zabbix-5.0.3 with new agent2 use flag to enable zabbix-agent2 (This also depends on dev-lang/go and dev-lang/go-bootstrap). Unfortunately, during the compile phase the make process wants to download several go packages which fail with "go: github.com/alimy/mc/v2@v2.0.3: Get "https://proxy.golang.org/github.com/alimy/mc/v2/@v/v2.0.3.mod":cannot connect to host." I'm not sure what to put into the ebuild file the download these files beforehand nor to make them available to the ebuild. Maybe someone else can finish this or give some help.


Reproducible: Always
Comment 1 Chris Paras 2020-10-15 22:27:51 UTC
Created attachment 665942 [details]
zabbix-5.0.3 ebuild with agent2 USE flag (INCOMPLETE)
Comment 2 Miroslav Šulc gentoo-dev 2020-10-17 08:06:48 UTC
William, could you please give us some guidance? i found we could use go-module.eclass but that works only in case go.mod and go.sum are at the top directory and the whole project is go based which this one isn't, it's just single executable using go and only built when use flag is on. i'm really not sure how to handle this. the only idea that came to my mind was to package it separately, but maybe there is a better way.
Comment 3 Vladimir Timofeenko 2021-02-20 06:24:52 UTC
Created attachment 687690 [details]
zabbix-5.2.4 ebuild with agent2 useflag

I am definitely not an expert on anything having to do with go, but the ebuild from attachment produces zabbix agent2 that appears to work. The key difference was adding inheritance from "go-module" and listing the lines from 'go.sum' inside zabbix sources in "EGO_SUM" variable.

I have also made a couple of minor edits with quotation marks, mostly so that shellcheck would be happy.

The service files for agent2 are in the next attachments. The openrc seems to work, but I currently cannot test the systemd ones.

If it would be more convenient, I'd gladly make a pull request through github.
Comment 4 Vladimir Timofeenko 2021-02-20 06:27:41 UTC
Created attachment 687693 [details]
systemd tmpfiles for zabbix-agent2
Comment 5 Vladimir Timofeenko 2021-02-20 06:27:53 UTC
Created attachment 687696 [details]
systemd service for zabbix-agent2
Comment 6 Vladimir Timofeenko 2021-02-20 06:28:08 UTC
Created attachment 687699 [details]
openrc file for zabbix-agent2
Comment 7 Miroslav Šulc gentoo-dev 2021-02-23 09:29:04 UTC
(In reply to Vladimir Timofeenko from comment #3)
> Created attachment 687690 [details]
> zabbix-5.2.4 ebuild with agent2 useflag
> 
> I am definitely not an expert on anything having to do with go, but the
> ebuild from attachment produces zabbix agent2 that appears to work. The key
> difference was adding inheritance from "go-module" and listing the lines
> from 'go.sum' inside zabbix sources in "EGO_SUM" variable.
> 
> I have also made a couple of minor edits with quotation marks, mostly so
> that shellcheck would be happy.
> 
> The service files for agent2 are in the next attachments. The openrc seems
> to work, but I currently cannot test the systemd ones.
> 
> If it would be more convenient, I'd gladly make a pull request through
> github.

thank you Vladimir. could you please create the pull request? also, i'm just going to bump zabbix to the latest versions so it would be better doing it after the bump. thanks!
Comment 8 Vladimir Timofeenko 2021-02-25 03:09:48 UTC
(In reply to Miroslav Šulc from comment #7)
> thank you Vladimir. could you please create the pull request? also, i'm just
> going to bump zabbix to the latest versions so it would be better doing it
> after the bump. thanks!

Saw the bump landing in the main tree. I'll make a pull request with a link to this bug.
Comment 9 Larry the Git Cow gentoo-dev 2021-03-09 08:00:20 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1240da9a7c32a0f285a627c7a4b711dee7dfba30

commit 1240da9a7c32a0f285a627c7a4b711dee7dfba30
Author:     Vladimir Timofeenko <id@vtimofeenko.com>
AuthorDate: 2021-02-25 17:42:53 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2021-03-09 08:00:07 +0000

    net-analyzer/zabbix: added agent2 useflag
    
    Implements the useflag to build zabbix-agent2, a go-based Zabbix agent.
    
    The agent2 service files provided in files/ directory were tested on
    openrc and systemd-based systems.
    
    Cleaned up some minor formatting in the original ebuild.
    
    Signed-off-by: Vladimir Timofeenko <id@vtimofeenko.com>
    Closes: https://bugs.gentoo.org/749351
    Package-Manager: Portage-3.0.14, Repoman-3.0.2
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 net-analyzer/zabbix/Manifest                     | 231 +++++++++
 net-analyzer/zabbix/files/zabbix-agent2.init     |  20 +
 net-analyzer/zabbix/files/zabbix-agent2.service  |  12 +
 net-analyzer/zabbix/files/zabbix-agent2.tmpfiles |   1 +
 net-analyzer/zabbix/metadata.xml                 |   1 +
 net-analyzer/zabbix/zabbix-5.2.5-r1.ebuild       | 601 +++++++++++++++++++++++
 6 files changed, 866 insertions(+)