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

NRPE relation provides public address when nagios_address_type=private #157

Open
sudeephb opened this issue Jan 4, 2024 · 2 comments
Open

Comments

@sudeephb
Copy link
Contributor

sudeephb commented Jan 4, 2024

Using Juju 2.9.12, master branch of NRPE and Nagios charms as at 2021-09-10. All hosted on AWS in a default VPC.

Using a cross model relation between the controller model and the monitoring model, NRPE in the controller model and Nagios in the main model.

Out of 3 units, 2 received the public address of the controller machines, and one received the private address. I expected to see all 3 get the private address.

nagios_address_type=private

On a host with the incorrect info:

relation-get -r monitors:75 - nrpe-controller/1
egress-subnets: (public address/32)
ingress-address: (public address)
machine_id: "1"
model_id: b0a3c2ff-739d-4c45-8032-dbb9b043a593
monitors: '{''monitors'': {''remote'': {''nrpe'': {''juju_health'': {''command'':
''check_juju_health''}, ''jujud-machine-1'': {''command'': ''check_jujud-machine-1''},
''snap.juju-db.daemon'': {''command'': ''check_snap.juju-db.daemon''}, ''check_conntrack'':
''check_conntrack'', ''check_disk_root'': ''check_disk_root'', ''check_load'': ''check_load'',
''check_swap_activity'': ''check_swap_activity'', ''check_mem'': ''check_mem'',
''check_arp_cache'': ''check_arp_cache'', ''check_ro_filesystem'': ''check_ro_filesystem''}}},
''version'': ''0.3''}'
private-address: 18.133.193.77
target-id: juj-controller-juju-controller-1

On a host with the correct info:

relation-get -r monitors:75 - nrpe-controller/0
egress-subnets: (public address/32)
ingress-address: 172.31.29.247 # (private address)
machine_id: "0"
model_id: b0a3c2ff-739d-4c45-8032-dbb9b043a593
monitors: '{''monitors'': {''remote'': {''nrpe'': {''juju_health'': {''command'':
''check_juju_health''}, ''jujud-machine-0'': {''command'': ''check_jujud-machine-0''},
''snap.juju-db.daemon'': {''command'': ''check_snap.juju-db.daemon''}, ''check_conntrack'':
''check_conntrack'', ''check_disk_root'': ''check_disk_root'', ''check_load'': ''check_load'',
''check_swap_activity'': ''check_swap_activity'', ''check_mem'': ''check_mem'',
''check_arp_cache'': ''check_arp_cache'', ''check_ro_filesystem'': ''check_ro_filesystem''}}},
''version'': ''0.3''}'
private-address: 172.31.29.247
target-id: juju-controller-juju-controller-0

The only difference between the units is that the one with the correct address has a public address starting with 3.x and private starting 172.x, and the ones with incorrect address have public addresses starting 18.x

network-get output for the relation:

juju run -u nrpe/1 "network-get -r monitors:7 monitors"
bind-addresses:

  • mac-address: 02:bb:d7:48:e2:e6
    interface-name: ens5
    addresses:
    • hostname: ""
      address: 172.31.11.182
      cidr: 172.31.0.0/20
      macaddress: 02:bb:d7:48:e2:e6
      interfacename: ens5
      egress-subnets:
  • (public IP)/32
    ingress-addresses:
  • (public IP)

Imported from Launchpad using lp2gh.

@sudeephb
Copy link
Contributor Author

sudeephb commented Jan 4, 2024

(by xavpaice)
https://bugs.launchpad.net/juju/+bug/1863916 maybe relevant for background if it's a regression of some description.

@sudeephb
Copy link
Contributor Author

sudeephb commented Jan 4, 2024

(by xavpaice)
Also of note: The bind address in nrpe.cfg is the public address, which results in:

Sep 10 05:34:52 ip-172-31-29-247 nrpe[397095]: Starting up daemon
Sep 10 05:34:52 ip-172-31-29-247 nrpe[397095]: Bind to port 5666 on (public address) failed: Cannot assign requested address.
Sep 10 05:34:52 ip-172-31-29-247 nrpe[397095]: Cannot bind to any address.
Sep 10 05:34:52 ip-172-31-29-247 systemd[1]: nagios-nrpe-server.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited

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

No branches or pull requests

1 participant