Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include ignored on zabbix_agentd.conf when using use_config #127

Open
i2dcarrasco opened this issue Apr 23, 2020 · 0 comments
Open

Include ignored on zabbix_agentd.conf when using use_config #127

i2dcarrasco opened this issue Apr 23, 2020 · 0 comments

Comments

@i2dcarrasco
Copy link

Hello,

I'm starting to use this module and finaly I made it work, but I've noticed that use_config options seems to be ignoring the includes of config file.

I've the config file with the default options (I preffer to leave it). Then I have a custon config inside /etc/zabbix/zabbix_agentd.d folder that replace those default options, and is working fine on the zabbix agent and also on zabbix_sender command.
One of those options is the zabbix server, and I'm thinking that are no being loaded, because I'm getting this error trying to send data with use_config=True:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/pyzabbix/sender.py", line 398, in _chunk_send
    connection.connect(host_addr)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./get_memory.py", line 167, in <module>
    sender.send(packet)
  File "/usr/local/lib/python3.5/dist-packages/pyzabbix/sender.py", line 433, in send
    result.parse(self._chunk_send(metrics[m:m + self.chunk_size]))
  File "/usr/local/lib/python3.5/dist-packages/pyzabbix/sender.py", line 408, in _chunk_send
    logger.warn('Sending failed: %s', err.msg)
AttributeError: 'ConnectionRefusedError' object has no attribute 'msg'

I was trying to figure out what was the problem until I've decided to use the host IP instead that option, and then has worked perfectly. After looking into the code to see if maybe I did something wrong, I've seen that looks like the problem is the configparser library, because looks like is not able to manage the imports (or at least I was not able to found a way beyond the manual import of every file).

Is there any way to manage this?.
I know that just setting the file where the serverIP is located works, but I preffer something more generic, to avoid problems later because the "out of default" customizations.

Best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant