Hi,
On 2016-01-27 02:31, Nathan Scott wrote:
> ----- Original Message -----
>> I'm curious how others are managing PCP and Zabbix. The PCP docs for zbxpcp
>> mention that pmcd needs to be running before the zabbix-agent. The issue
>> that I'm curious about is how the order is achieved in CentOS 6 and system
>> V. Installing PCP from bintray and Zabbix from EPEL results in pmcd (95)
>> starting in runlevel 3 after zabbix-agent (86).
>>
>> The only maintainable solution I can think of is to put something like
>> 'service zabbix-agent restart' in /etc/rc.local.
>>
>> I'm curious if maybe there's some more elegant solution I'm just overlooking.
>
> None that I know of so far, but Marko is the zbxpcp guru, perhaps he has one.
> The zbxpcp code could possibly acquire ability to delay pmNewContext(3) and/or
> use the pmReconnectContext(3) libpcp API to tackle this.
Unfortunately this won't work. When zabbix-agent loads the zbxpcp
module, it calls "mandatory" zbx_module_init() and "optional"
zbx_module_item_list() functions [1]. If the module is not connected to
pmcd(1) at that time, the module cannot retrieve and return the list of
available metrics to zabbix-agent. Then when a request comes for an
unregistered pcp.* metric, zabbix-agent checks its list of known items
and, since the item is not found, returns an error thus never giving a
chance for the zbxpcp module to connect to pmcd(1).
1)
https://www.zabbix.com/documentation/3.0/manual/config/items/loadablemodules
The good news is that now after looking into think I think we can use
pmReconnectContext(3) to recover from pmcd(1) restarts later on, I'll
test a bit and send a patch later today or tomorrow.
Wrt the solution for starting up the services in the right order, I was
doing more or less the same as Trey (I had zabbix-agent chkconfig'ed off
and started in /etc/rc.local). Perhaps one option would be adjusting
priorities for these services so that pmcd(1) would be started first but
I'm not sure how elegant that would be unless either upstream changes
them. If there are no better suggestions, perhaps we could try asking
the zabbix-agent maintainers for that.
Thanks,
--
Marko Myllynen
|