Hi,
I am trying to add EC2 instance to Nagios XI using access and secret key, but getting ""There were no Instances found. Verify your AWS credentials and try again"".
What can be the issue ?
Kindly help me with prerequisites and proper steps to be followed while adding Ec2 instance to Nagios XI for monitoring.
Thanks
Ec2 instance monitoring
Re: Ec2 instance monitoring
Please SSH into the XI server and su - to the nagios user, and run the command from the CLI, and PM the full output:
- Change xxxx/yyyy
- Change xxxx/yyyy
Code: Select all
su - nagios
/usr/local/nagios/libexec/check_ec2.py -v --getinstances --accesskeyid='xxxx' --secretaccesskey='yyyy'Re: Ec2 instance monitoring
Does it work if you do this?
- Set the region to what yours is
- Set the region to what yours is
Code: Select all
su - nagios
/usr/local/nagios/libexec/check_ec2.py -v --getinstances --accesskeyid='xxxx' --secretaccesskey='yyyy' --region 'xx-xxxx-x'Re: Ec2 instance monitoring
I'm having the same issue in the latest release of XI. The error I'm getting presented with from the command line after inputting my keys and region is as follows.
[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_ec2.py -v --getinstances --accesskeyid='munged' --secretaccesskey='munged' --region 'us-east-2'
File "/usr/local/nagios/libexec/check_ec2.py", line 176
print instance_list
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(instance_list)?
[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_ec2.py -v --getinstances --accesskeyid='munged' --secretaccesskey='munged' --region 'us-east-2'
File "/usr/local/nagios/libexec/check_ec2.py", line 176
print instance_list
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(instance_list)?
Re: Ec2 instance monitoring
Hi,
How are you doing?
I am assuming that you are using "Python 3".
Please add the below line at the top of "/usr/local/nagios/libexec/check_ec2.py" file:
Now, please try the command again.
Best Regards,
Vinh
How are you doing?
I am assuming that you are using "Python 3".
Please add the below line at the top of "/usr/local/nagios/libexec/check_ec2.py" file:
Code: Select all
from __future__ import print_function
Code: Select all
/usr/local/nagios/libexec/check_ec2.py -v --getinstances --accesskeyid='munged' --secretaccesskey='munged'
Best Regards,
Vinh