Zabbix IBM MQM可加载模块阻止ZABBIX代理服务

时间:2018-03-16 14:23:23

标签: module centos ibm-mq zabbix

我正在尝试测试ZABBIX的IBM MQ模块,所有代码都发布在the ZABBIX share上,但由于我是新手并且没有解释的步骤,我被卡住了。 所以我正在使用ZABBIX 3.4的源代码和MQM 8试用版的标题(在Centos7 64bit上运行)。 首先,当我尝试编译文件mq.c时,变量argc我认为它不应该存在!错误就像:

[root@osboxes dummy]# make
gcc -fPIC -shared -o mq.so mq.c -I../../../include -I/opt/mqm/inc
mq.c: In function ‘mq_q_depth’:
mq.c:61:9: error: ‘argc’ undeclared (first use in this function)
     if (argc > 1) strncpy(queue, param, (size_t)MQ_Q_NAME_LENGTH);
         ^
mq.c:61:9: note: each undeclared identifier is reported only once for each funct                              ion it appears in
make: *** [mq] Error 1

我评论了这一行,其中有argc:

if (argc > 1) strncpy(queue, param, (size_t)MQ_Q_NAME_LENGTH);

编译成功,但是当我尝试在ZABBIX代理配置上上传模块时,代理无法启动并给我这个错误:

[root@osboxes dummy]# service zabbix-agent start
Redirecting to /bin/systemctl start zabbix-agent.service
Job for zabbix-agent.service failed because a configured resource limit was exceeded. See "systemctl status zabbix-agent.service" and "journalctl -xe" for details.


[root@osboxes dummy]# systemctl status zabbix-agent.service
● zabbix-agent.service - Zabbix Agent
Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: resources) since Fri 2018-03-16 14:35:43 CET; 3s ago
Process: 5069 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)

Mar 16 14:35:43 osboxes.org systemd[1]: zabbix-agent.service never wrote its PID file. Failing.
Mar 16 14:35:43 osboxes.org systemd[1]: Failed to start Zabbix Agent.
Mar 16 14:35:43 osboxes.org systemd[1]: Unit zabbix-agent.service entered failed state.
Mar 16 14:35:43 osboxes.org systemd[1]: zabbix-agent.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

[root@osboxes dummy]# journalctl -xe
--
-- The result is failed.
Mar 16 14:36:04 osboxes.org systemd[1]: Unit zabbix-agent.service entered failed state.
Mar 16 14:36:04 osboxes.org systemd[1]: zabbix-agent.service failed.
Mar 16 14:36:14 osboxes.org systemd[1]: zabbix-agent.service holdoff time over, scheduling resta
Mar 16 14:36:14 osboxes.org systemd[1]: Starting Zabbix Agent...
-- Subject: Unit zabbix-agent.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.or...
--
-- Unit zabbix-agent.service has begun starting up.
Mar 16 14:36:14 osboxes.org systemd[1]: PID file /run/zabbix/zabbix_agentd.pid not readable (yet
Mar 16 14:36:14 osboxes.org systemd[1]: zabbix-agent.service never wrote its PID file. Failing.
Mar 16 14:36:14 osboxes.org systemd[1]: Failed to start Zabbix Agent.
-- Subject: Unit zabbix-agent.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.or...
--
-- Unit zabbix-agent.service has failed.
--
-- The result is failed.
Mar 16 14:36:14 osboxes.org systemd[1]: Unit zabbix-agent.service entered failed state.
Mar 16 14:36:14 osboxes.org systemd[1]: zabbix-agent.service failed.

我希望你能给我一些帮助。 感谢

1 个答案:

答案 0 :(得分:0)

确定。所以无论谁为Zabbix的mq.c编写代码都是懒惰的,并从他们的qdepth.c示例中复制它。

  

我评论了这一行,其中有argc:

糟糕的主意。它看起来应该是:

if (request->nparam == 1) strncpy(queue, param, (size_t)MQ_Q_NAME_LENGTH);

我无法访问Zabbix的SDK,所以这只是猜测。

  

zabbix-agent.service的作业失败,因为已配置的资源   超出限额。请参阅“systemctl status zabbix-agent.service”和   “journalctl -xe”了解详情。

那个错误信息非常清楚。现在是时候阅读文档/手册以找出最低或推荐资源设置是什么,因为您显然没有足够的资源来运行所有内容。