Nagios AWS AMI + AWS_Cloudwatch metrics

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jraj90
Posts: 7
Joined: Thu Feb 27, 2014 2:27 am

Nagios AWS AMI + AWS_Cloudwatch metrics

Post by jraj90 »

Hi,

I've just spun up a Nagios instance using the pre-configured AMI which is available on the AWS
(http://assets.nagios.com/downloads/nagi ... _Cloud.pdf)

I got this running and configured, and its working great. Next, I am trying to integrate nagios with the AWS cloudwatch plugin
(http://exchange.nagios.org/directory/Pl ... s#rev-2629)

I am facing an issue here, whereby I am getting 'error code 127 out of bounds - plugin may be missing' from the Nagios web panel. However if I ran the command directly on the terminal, it works fine. It just doesn't seem to work when you add it in the 'Service Management' and do a 'test command'. The output is empty.

Anyone has come across this issue, and care the share how it was solved.

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios AWS AMI + AWS_Cloudwatch metrics

Post by scottwilkerson »

did you upload the .rb files through the web UI?

Can you show the permissions for

Code: Select all

ls -l /usr/local/nagios/libexec/check_cloudwatch_status-1.9.98.rb
ls -l /usr/local/nagios/libexec/encrypt_credentials.rb
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jraj90
Posts: 7
Joined: Thu Feb 27, 2014 2:27 am

Re: Nagios AWS AMI + AWS_Cloudwatch metrics

Post by jraj90 »

yes i did upload it using the web ui

initially the permission was owner=apache group=apache
that didnt work..so i changed the permission to match the rest on of the plugins in that directory

the second file u asked for permission i believe is the cfg file? The encrypt is just a scripts that encrypts your credential.

-rwxr-xr-x. 1 root root 20K Feb 26 04:25 check_cloudwatch_status.rb
-r-------- 1 nagios nagios 130 Feb 19 15:56 /etc/nagios/aws/ec2-nagios_credentials.cfg

I've tried using different permissions and owners, and it works absolutely fine when i run the command directly on the Nagios server terminal:-

ruby /usr/local/nagios/libexec/check_cloudwatch_status.rb -a mydbserver -i mydb -f /etc/nagios/aws/ec2-nagios_credentials.cfg -D CPUUtilization -w 20 -c 10
CloudWatch Metric: CPUUtilization, Average: 3.37, Maximum: 4.41, Minimum: 2.33|metric_average=3.37 metric_maximum=4.41 metric_minimum=2.33


However, from the web ui I get an empty output:-

COMMAND: ruby /usr/local/nagios/libexec/check_cloudwatch_status.rb -a mydbserver -i mydb -f /etc/nagios/aws/ec2-nagios_credentials.cfg -D CPUUtilization
OUTPUT:

Another strange thing is, I suspect the command is not really being executed from the WEB UI. Reason is, if I change one of the parameters above, (eg: the path of the credential file) to a non existent path (eg: -f /abcd/efgh/file.cfg) it still seem to work from the web. It doesn't return error 'path does not exist' which on the terminal it does.

Thanks again for you assist
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios AWS AMI + AWS_Cloudwatch metrics

Post by abrist »

The "test check command" has certain . . . limitations due to escaping and security. The test check will run as the apache user, may have issues escaping certain characters, and cannot use user macros.
Have you tried just configuring the check in XI and allowing it to check as it normally would?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jraj90
Posts: 7
Joined: Thu Feb 27, 2014 2:27 am

Re: Nagios AWS AMI + AWS_Cloudwatch metrics

Post by jraj90 »

Hi guys,

thx everyone for their input. I managed to solve the problem by fixing the ruby. Initially i used RVM to manage my rubies and somehow that didnt seem to work. I got rid of that, and installed ruby using 'yum' and that seem to have solved my problem
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios AWS AMI + AWS_Cloudwatch metrics

Post by tmcdonald »

Glad to see it working. I'll be closing this thread now but feel free to start another if you need to.
Former Nagios employee
Locked