How to configure RabbitMQ Nagios Plugins in Linux
Scenario:
I had to spent a lot of time figuring out how RabbitMQ Nagios Plugins installation can be done in linux environment, especially on perl modules installation and build errors. There is a real struggle in fixing these errors. And the documentation/blogs on this topic is very less so i thought of putting my findings here.!
Below is my effort to minimise the struggle on configuring RabbitMQ Nagios Plugins :)
Solution:
Step 1 : Download the latest release from GIT
wget https://github.com/nagios-plugins-rabbitmq/nagios-plugins-rabbitmq/archive/refs/tags/2.0.3.tar.gz
Step 2 : Extract 2.0.3.tar.gz to Nagios plugins directory
tar — xvf 2.0.3.tar.gz -C /usr/local/nagios/libexec/
Step 3 : Try executing script — check_rabbitmq_server
cd /usr/local/nagios/libexec/nagios-plugins-rabbitmq-2.0.3/scripts
./check_rabbitmq_server
Here we will get an expected error message:
Can’t locate Monitoring/Plugin.pm in @INC (@INC contains: /home/ec2-user/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi /home/ec2-user/perl5/lib/perl5/5.16.3 /home/ec2-user/perl5/lib/perl5/x86_64-linux-thread-multi /home/ec2-user/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./scripts/check_rabbitmq_server line 12.
This above error is related to missing Monitoring plugin and its expected, there will be couple of more errors on JSON and LWP::UserAgent modules.
To fix above errors we need to install those using cpan. Run below commands one by one to install each modules
cpan install Monitoring::Plugin
cpan instal lLWP::UserAgent
cpan install JSON
If CPAN is not installed, please install it using respective package manager.
Step 4: Try executing script — check_rabbitmq_server
After all the dependecies are installed, check_rabbitmq_server it should not give any perl module error, instead you’ll see the following missing argument usage error message:
[root@hostname nagios-plugins-rabbitmq-2.0.3]# ./scripts/check_rabbitmq_server
Usage: check_rabbitmq_server [options] -H hostname
Missing argument: hostname
I hope this post will help someone who is looking for solutions to configure RabbitMQ Nagios Plugins