pcp
[Top] [All Lists]

Re: [PATCH] initial pass at fixing zbxpcp.so for Zabbix v3

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: [PATCH] initial pass at fixing zbxpcp.so for Zabbix v3
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Tue, 8 Mar 2016 12:52:54 +0200
Cc: pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <889910044.28687035.1457397212945.JavaMail.zimbra@xxxxxxxxxx>
Organization: Red Hat
References: <675485289.27235420.1457066754101.JavaMail.zimbra@xxxxxxxxxx> <56DD5312.2030004@xxxxxxxxxx> <889910044.28687035.1457397212945.JavaMail.zimbra@xxxxxxxxxx>
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
Hi,

On 2016-03-08 02:33, Nathan Scott wrote:
> ----- Original Message -----
>> On 2016-03-04 06:45, Nathan Scott wrote:
>>> This switches between using v2/v3 interface based on presence or lack
>>> of a named file.  This is a bit suboptimal as it still involves some
>>> manual user interaction, but its better than having multiple shared
>>> libraries I think.  If we could find some reliable way of detecting a
>>> Zabbix 3 vs 2 install (?) at runtime, we'd be laughing.  [...]
>>
>> Thanks, this is a nice idea [... snip comments re config files]
> 
> As discussed on IRC, I've changed it to make version detection dynamic
> using a separate script, so that we avoid relying on the end-user doing
> the configuration themselves.  Lightly tested, will flesh out the QA if
> you're thinking this approach still looks OK at this stage?

Otherwise looks good but few tiny issues and one crucial problem:

- perhaps the script could be named zabbix-agent-version
- with v2 the -V output is slightly different so parsing fails in the
case the agent is not running (so need to strip the v):

Zabbix Agent (daemon) v2.4.7 (revision 56694) (12 November 2015)
Compilation time: Nov 13 2015 10:42:17

zabbix_agentd (daemon) (Zabbix) 3.0.0
Revision 58460 15 February 2016, compilation time: Feb 15 2016 16:15:24

- did you test this with Zabbix agent or by some other means? I'm seeing
the following:

  7132:20160308:123810.407 using configuration file:
/etc/zabbix/zabbix_agentd.conf
  7132:20160308:123810.414 One child process died
(PID:7133,exitcode/signal:2). Exiting ...
  7132:20160308:123810.414 Zabbix Agent stopped. Zabbix 2.4.7 (revision
56694).

It seems that Zabbix code sets up a SIGCHLD handler as part of its
daemonizing code.

> One open question to my mind is whether we should make zbxpcp.so fail to
> load if it cannot get the Zabbix version reliably, rather than continue
> on with a default version.

I guess trying to go on with the default version is ok, perhaps with
some logging explaining what's going on. There's no real logging
mechanism available but anything printed to stderr seems to end to
zabbix-agent.log.

Thanks,

-- 
Marko Myllynen

<Prev in Thread] Current Thread [Next in Thread>