pcp
[Top] [All Lists]

Re: [pcp] PCP / Zabbix Agent Loadable Module

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: [pcp] PCP / Zabbix Agent Loadable Module
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Mon, 9 Nov 2015 21:15:18 +0200
Cc: pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <852045589.5144136.1446765609785.JavaMail.zimbra@xxxxxxxxxx>
Organization: Red Hat
References: <563099A2.8040901@xxxxxxxxxx> <852045589.5144136.1446765609785.JavaMail.zimbra@xxxxxxxxxx>
Reply-to: myllynen@xxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
Hi,

On 2015-11-06 01:20, Nathan Scott wrote:
>>
>> - pmNewContext(PM_CONTEXT_LOCAL, "") of course works as expected from
>> standalone clients but seems to fail from the DSO. This means that the
> 
> Can you paste the failure message somewhere?  (in case I can't get it
> to work, below)  Off the top of my head I don't know why it would fail
> in local context mode.

this might be something completely Zabbix related after all, I tried
with the two attached tests which seems to work just fine.

>> What do you think, could this live in pcp.git?
> 
> Maybe - there seems to be alot of conceptual overlap between this and
> the "pmrep -o zabbix ..." kind of approach - I suspect we should focus
> on doing one way well rather than both?

It sounds like Zabbix users have lots of different kinds of needs /
environments so one tool won't fit all. But in general I think this
loadable module approach might be more preferable one.

> How stable is the Zabbix module API/ABI?  Are those headers available
> in distribution builds etc?

I'd suspect the API is not that widely used but it should be pretty
stable, it was introduced in Zabbix 2.2 released in Nov 2013 and the API
is still the same in Zabbix 3.0, currently under development.

I didn't find the headers in Fedora/RHEL packages so I downloaded the
sources from http://www.zabbix.com/download.php, then unpacked, ran
./configure (no need for any params), and then the headers were ready
for inclusion.

> Done that - I'm missing a bit of the recipe here though: where do the
> Zabbix headers come from?  (needed for compiling zbxpcp.c).  And once
> I have that built, how do I inform Zabbix agent?  Taa.

See above, it's a bit clumsy. I added these lines to the
/etc/zabbix/zabbix_agentd.conf file and restarted the agent:

LoadModulePath=/tmp
LoadModule=zbxpcp.so

>> and then do something like "zabbix_agentd -p | grep pcp".
> 
> (I have "zabbix_agentd -p" working, but obviously not the bridge part
> yet, so no "pcp" found just yet).

You can also test fetching individual metrics with something like:

$ zabbix_get -s 127.0.0.1 -s 10050 -k pcp.mem.util.free

Thanks,

-- 
Marko Myllynen

Attachment: pmlib.so
Description: Binary data

Attachment: pmtest.c
Description: Text document

Attachment: pmtest2.c
Description: Text document

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