Ec2 instance monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
krupats
Posts: 2
Joined: Fri Apr 30, 2021 8:30 am

Ec2 instance monitoring

Post by krupats »

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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Ec2 instance monitoring

Post by ssax »

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

Code: Select all

su - nagios
/usr/local/nagios/libexec/check_ec2.py -v --getinstances --accesskeyid='xxxx' --secretaccesskey='yyyy'
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Ec2 instance monitoring

Post by ssax »

Does it work if you do this?
- 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'
emguru1
Posts: 4
Joined: Wed May 05, 2021 3:50 pm

Re: Ec2 instance monitoring

Post by emguru1 »

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)?
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Ec2 instance monitoring

Post by vtrac »

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:

Code: Select all

from __future__ import print_function
Now, please try the command again.

Code: Select all

/usr/local/nagios/libexec/check_ec2.py -v --getinstances --accesskeyid='munged' --secretaccesskey='munged'

Best Regards,
Vinh
Locked