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
Nagios UI can't run the plugin
Re: Nagios UI can't run the plugin
Check line 55 in the file named in the error.
Re: Nagios UI can't run the plugin
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
- tacolover101
- Posts: 432
- Joined: Mon Apr 10, 2017 11:55 am
Re: Nagios UI can't run the plugin
how do you have this defined in Nagios XI? can you post a screenshot?
-
- Posts: 2
- Joined: Wed Oct 18, 2017 1:46 am
Re: Nagios UI can't run the plugin
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
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.
Re: Nagios UI can't run the plugin
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/
https://www.mcapra.com/