Nrpe cannot bind to server_address(bind address) due to using a floating IP
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NRPE Charm |
Fix Released
|
High
|
Xav Paice |
Bug Description
$ juju version
2.9.9-ubuntu-amd64
An OpenStack instance/VM where nrpe was deployed has two IP address, 10.5.5.16 as the main and private one, and 192.168.151.74 as a floating IP. The latter one is assigned at a Neutron router for DNAT so it's not bound to the VM itself.
$ openstack server show juju-572b1d-
+------
| Field | Value |
+------
| addresses | internal=10.5.5.16, 192.168.151.74 |
+------
Nrpe failed to start by trying to bind the service to 192.168.151.74 which doesn't exist locally. The IP was written to nrpe.cfg by the charm. According to the unit log, it looks like the initial address was 10.5.5.16 which was expected, then changed to 192.168.151.74.
"network-get monitors" doesn't include the floating IP(192.168.151.74) so I'm not sure how the charm got it. Also, I ran "network-get monitors" over night but the output was stable and no floating IP was recorded.
$ juju run -u nrpe/0 -- network-get monitors
bind-addresses:
- mac-address: fa:16:3e:35:a9:b7
interface-name: ens3
addresses:
- hostname: ""
address: 10.5.5.16
cidr: 10.5.5.0/24
macaddress: fa:16:3e:35:a9:b7
interfacename: ens3
- mac-address: c2:05:47:10:f6:e5
interface-name: fan-252
addresses:
- hostname: ""
address: 252.16.0.1
cidr: 252.0.0.0/8
macaddress: c2:05:47:10:f6:e5
interfacename: fan-252
egress-subnets:
- 10.5.5.16/32
ingress-addresses:
- 10.5.5.16
- 252.16.0.1
2021-07-23 16:32:36 INFO unit.nrpe/
2021-07-23 16:32:37 INFO unit.nrpe/
2021-07-23 16:32:37 INFO unit.nrpe/
2021-07-23 16:32:37 INFO unit.nrpe/
2021-07-23 16:32:37 INFO unit.nrpe/
2021-07-23 16:32:37 INFO unit.nrpe/
--
2021-07-23 16:32:45 INFO unit.nrpe/
2021-07-23 16:32:45 INFO unit.nrpe/
2021-07-23 16:32:45 INFO unit.nrpe/
--
2021-07-23 16:37:31 INFO unit.nrpe/
2021-07-23 16:37:31 INFO unit.nrpe/
2021-07-23 16:37:31 INFO unit.nrpe/
2021-07-23 16:37:31 INFO unit.nrpe/
2021-07-23 16:37:31 INFO unit.nrpe/
2021-07-23 16:37:31 INFO unit.nrpe/
--
2021-07-23 16:37:35 INFO unit.nrpe/
2021-07-23 16:37:35 INFO unit.nrpe/
2021-07-23 16:37:35 INFO unit.nrpe/
$ cat /etc/nagios/
#------
# This file is managed by Juju
#------
# See https:/
server_
server_port=5666
allowed_
nrpe_user=nagios
nrpe_group=nagios
dont_blame_nrpe=0
debug=0
command_timeout=60
pid_file=
# All configuration snippets go into nrpe.d/
include_
$ sudo systemctl status nagios-nrpe-server
● nagios-
Loaded: loaded (/lib/systemd/
Active: failed (Result: exit-code) since Fri 2021-07-23 16:37:42 UTC; 11h ago
Docs: http://
Process: 846294 ExecStart=
Process: 846303 ExecStopPost=
Main PID: 846294 (code=exited, status=1/FAILURE)
Jul 23 16:37:42 juju-572b1d-
Jul 23 16:37:42 juju-572b1d-
Jul 23 16:37:42 juju-572b1d-
Jul 23 16:37:42 juju-572b1d-
Jul 23 16:37:42 juju-572b1d-
Jul 23 16:37:42 juju-572b1d-
Related branches
- 🤖 prod-jenkaas-bootstack (community): Approve (continuous-integration)
- BootStack Reviewers: Pending requested
- BootStack Reviewers: Pending requested
-
Diff: 12 lines (+1/-0)1 file modifiedhooks/nrpe_helpers.py (+1/-0)
- 🤖 prod-jenkaas-bootstack (community): Approve (continuous-integration)
- James Troup (community): Needs Fixing
- BootStack Reviewers: Pending requested
-
Diff: 269 lines (+115/-56)4 files modifiedhooks/nrpe_helpers.py (+29/-42)
tests/functional/tests/bundles/focal.yaml (+1/-0)
tests/functional/tests/tests.yaml (+3/-1)
tests/unit/test_nrpe_helpers.py (+82/-13)
Changed in charm-nrpe: | |
status: | Triaged → In Progress |
assignee: | nobody → Xav Paice (xavpaice) |
milestone: | none → 21.10 |
Changed in charm-nrpe: | |
status: | In Progress → Fix Committed |
Changed in charm-nrpe: | |
status: | Fix Committed → Fix Released |
Ah, now I get where the floating IP comes from.
$ juju run -u nrpe/0 -- network-get monitors
bind-addresses:
- mac-address: fa:16:3e:35:a9:b7
interface-name: ens3
addresses:
- hostname: ""
address: 10.5.5.16
cidr: 10.5.5.0/24
macaddress: fa:16:3e:35:a9:b7
interfacename: ens3
- mac-address: c2:05:47:10:f6:e5
interface-name: fan-252
addresses:
- hostname: ""
address: 252.16.0.1
cidr: 252.0.0.0/8
macaddress: c2:05:47:10:f6:e5
interfacename: fan-252
egress-subnets:
- 10.5.5.16/32
ingress-addresses:
- 10.5.5.16
- 252.16.0.1
$ juju run -u nrpe/0 -- network-get monitors -r monitors:20
bind-addresses:
- mac-address: fa:16:3e:35:a9:b7
interface-name: ens3
addresses:
- hostname: ""
address: 10.5.5.16
cidr: 10.5.5.0/24
macaddress: fa:16:3e:35:a9:b7
interfacename: ens3
- mac-address: c2:05:47:10:f6:e5
interface-name: fan-252
addresses:
- hostname: ""
address: 252.16.0.1
cidr: 252.0.0.0/8
macaddress: c2:05:47:10:f6:e5
interfacename: fan-252
egress-subnets:
- 192.168.151.74/32
ingress-addresses:
- 192.168.151.74