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

listenip in agent not resolving to IP address from network interface name #493

Closed
glafir opened this issue Mar 29, 2018 · 9 comments · Fixed by #494
Closed

listenip in agent not resolving to IP address from network interface name #493

glafir opened this issue Mar 29, 2018 · 9 comments · Fixed by #494
Labels
bug Something isn't working

Comments

@glafir
Copy link

glafir commented Mar 29, 2018

Hello!
A upgraded puppet-zabbix (v4.1.3 -> v6.3.0) then "listenip" in agent not resolv to address from networl face name.
In zabbix-agent config
ListenIP=enp0s18

But it is not IP-address. How I can resolve this problem?

@bastelfreak
Copy link
Member

Hi @glafir, thanks for rising this issue. Can you provide the code you use to call this module? I assume you set explicitly set listenip?

The used regex doesn't match your network name:

/^(eth|lo|bond|lxc|eno|tap|tun|virbr).*/ => fact("networking.interfaces.${listen_ip}.ip"),

I think that's the issue.

@bastelfreak
Copy link
Member

@glafir I proposed a fix in #494, could you test that?

@glafir
Copy link
Author

glafir commented Mar 29, 2018

Oh, Yes, yes!
I forget for this,
I change it in pre-versions.

so I did it

$listen_ip = $listenip ? {
/^(eth|lo|bond|ens|enp|lxc|eno|vmbr|tap|tun|virbr)./ => fact("networking.interfaces.${listen_ip}.ip"),
'
' => undef,
default => $listenip,
}

But listenIP now is empty (((

@bastelfreak
Copy link
Member

I updated my patch. There is currently a typo in the code. Can you test it again? Can you paste the code you use to call the zabbix::agent class?

@glafir
Copy link
Author

glafir commented Mar 29, 2018

It not working now. In zabbix-conf

+ListenIP=enp0s18

(((

@glafir
Copy link
Author

glafir commented Mar 29, 2018

But if I write in regex my inet-faces, I get empty $listenIP
For example

/^(eth|lo|bond|lxc|ens|enp|vmbr|eno|tap|tun|virbr).*/ => .....

@glafir
Copy link
Author

glafir commented Mar 29, 2018

Oh, Yes!
It is working now for me!

/^(eth|lo|bond|lxc|ens|enp|vmbr|eno|tap|tun|virbr).*/ => fact("networking.interfaces.${$listenip}.ip"),

Add please to repo! Thanks!

@glafir
Copy link
Author

glafir commented Mar 29, 2018

Full-code in listenip-section

  $listen_ip = $listenip ? {
    /^(eth|lo|bond|lxc|ens|enp|vmbr|eno|tap|tun|virbr).*/ => fact("networking.interfaces.${$listenip}.ip"),
    '*' => undef,
    default => $listenip,
  }

@bastelfreak
Copy link
Member

We can do a new release as soon as #494 got reviewed and merged

@glafir glafir changed the title listenip in agent not resolv to address from networl face name listenip in agent not resolv to IP-address from network face name Mar 29, 2018
@alexjfisher alexjfisher changed the title listenip in agent not resolv to IP-address from network face name listenip in agent not resolving to IP address from network interface name Mar 29, 2018
@alexjfisher alexjfisher removed the needs-feedback Further information is requested label Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants