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

Do not uri escape on default vhost (slash), fixes queue check #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Napsty
Copy link

@Napsty Napsty commented Jan 4, 2024

The plugin does a uri_escape on the vhost, which is by default set to /. This then creates a %2F character instead of the / slash character, failing to find the URL:

$ /usr/lib/nagios/plugins/check_rabbitmq_queue.pl -H localhost --port 15672 --username monitoring --password secret
RABBITMQ_QUEUE CRITICAL - Access Refused : http://localhost:15672/api/queues/%2F

With this PR, this is fixed and only does a uri_escape on actual vhost names, not on /.

$ /tmp/check_rabbitmq_queue.pl -H localhost --port 15672 --username monitoring --password secret
RABBITMQ_QUEUE OK - All queues under the thresholds | messages=0.8636;; messages_ready=0.8636;; messages_unacknowledged=0.0000;; consumers=0.5682;;

This probably also fixes #106 .

@Napsty Napsty changed the title Do not unicode escape on default vhost (slash), fixes queue check Do not uri escape on default vhost (slash), fixes queue check Jan 4, 2024
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

Successfully merging this pull request may close these issues.

queues with unicode characters cannot be tested
1 participant