Nagios UI can't run the plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sujan54004
Posts: 2
Joined: Wed Oct 18, 2017 1:46 am

Nagios UI can't run the plugin

Post by sujan54004 »

Hi,

I'm trying to get the AWS cloudwatch_status plugin to work and I've installed all the packages necessary for the plugin (ruby and the dependencies in this case).
I'm able to run the cloudwatch command from the the cli using 'root' and 'nagios' users. However, I coundn't get the plugin working in the UI.

When I run normally with either nagios or root user, it ruturns the status without any errors:
ruby /usr/local/nagios/libexec/check_cloudwatch_status.rb -a XXXXXXXX -i "i-XXXXXX" -C CPUUtilization -f /usr/local/nagios/etc/aws_credentials.cfg

But the same thing does not work in the Nagios UI:
Also checked with 'sudo -u nagios', doesn't work.
sudo -u nagios ruby /usr/local/nagios/libexec/check_cloudwatch_status.rb -a XXXXXXXX -i "i-XXXXXX" -C CPUUtilization -f /usr/local/nagios/etc/aws_credentials.cfg

I get the warning message in "Status Information" in the UI:
(No output on stdout) stderr: /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- fog (LoadError)

fog and fog-aws packages are installed and works well from the cli.

BR,
Sujan
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Nagios UI can't run the plugin

Post by gormank »

Check line 55 in the file named in the error.
bolson

Re: Nagios UI can't run the plugin

Post by bolson »

Run the following commands and post the result:

Code: Select all

ls -l /usr/local/nagios/libexec/check_cloudwatch_status.rb
ls -l /usr/local/nagios/etc/aws_credentials.cfg
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Nagios UI can't run the plugin

Post by tacolover101 »

how do you have this defined in Nagios XI? can you post a screenshot?
sujan54004
Posts: 2
Joined: Wed Oct 18, 2017 1:46 am

Re: Nagios UI can't run the plugin

Post by sujan54004 »

Hi All,

Thanks for your replies.

I've tried different permissions but it didn't help at all. Here are the current permissions for the files:
-rwxrwxr-x. 1 apache nagios 258 10.10. 09:07 check_cloudwatch_status.cfg
-rwxrwxr-x. 1 apache nagios 130 10.10. 09:07 ec2_credentials.cfg

Attachment contains the command definition snapshot.
ruby $USER1$/check_cloudwatch_status.rb -a $ARG1$ -i $ARG2$ -f $USER1$/aws_credentials.cfg -C CPUUtilization -c $ARG3$ -w $ARG4$

Cheers,
Sujan
You do not have the required permissions to view the files attached to this post.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios UI can't run the plugin

Post by mcapra »

This could be an issue with how your Ruby environment is configured. The nagios user's environment likely doesn't have access to the fog gem.
Former Nagios employee
https://www.mcapra.com/
kyang

Re: Nagios UI can't run the plugin

Post by kyang »

Thanks @mcapra!
Locked