[Ussuri - Octavia] check_amphorae reports empty list - NRPE: Unable to read output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charm-openstack-service-checks |
Fix Released
|
High
|
Jose Guedez |
Bug Description
Focal / Ussuri deployment
Test failing:
$ /usr/lib/
NRPE: Unable to read output
$ sudo -u nagios /usr/local/
Traceback (most recent call last):
File "/usr/local/
main()
File "/usr/local/
status, message = process_
File "/usr/local/
return nagios_exit(args, checks[
File "/usr/local/
bad_amp = [
File "/usr/local/
if item["status"] in bad_status_list
KeyError: 'status'
When running check_octavia.py manually on openstack-
b'{"amphorae": [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}], "amphorae_links": []}'
Looking into openstackclients snap code:
https:/
It seems to use python-
In the snap case, it is working correctly.
Related branches
- Adam Dyess (community): Approve
- 🤖 prod-jenkaas-bootstack (community): Needs Fixing (continuous-integration)
- BootStack Reviewers: Pending requested
- BootStack Reviewers: Pending requested
-
Diff: 67 lines (+37/-8)2 files modifiedsrc/files/plugins/check_octavia.py (+18/-8)
src/tests/unit/test_check_octavia.py (+19/-0)
Changed in charm-openstack-service-checks: | |
status: | Confirmed → In Progress |
importance: | Undecided → High |
assignee: | nobody → Jose Guedez (jfguedez) |
Changed in charm-openstack-service-checks: | |
status: | In Progress → Fix Committed |
Possible patch (that works for me on Focal+Ussuri OpenStack deployment):
--- /usr/local/ lib/nagios/ plugins/ check_octavia. py 2021-02-23 10:53:58.535026981 +0000 lib/nagios/ plugins/ check_octavia_ phausman. py 2021-02-23 10:53:41.843180345 +0000 connection) : load_balancer get("/v2/ octavia/ amphorae" ) STATUS_ WARNING, "amphorae api not working")] resp.content) "amphorae" , [])
+++ /usr/local/
@@ -171,15 +171,7 @@
def check_amphorae(
"""Check amphorae status."""
lb_mgr = connection.
-
- resp = lb_mgr.
- # python api is not available yet, use url
- if resp.status_code != 200:
- return [(NAGIOS_
-
- data = json.loads(
- # ouput is like {"amphorae": [{...}, {...}, ...]}
- items = data.get(
+ items = lb_mgr.amphorae()
# raise CRITICAL for ERROR status status_ list = ["ERROR"]
bad_