Page 1 of 1

ssh into ec2 nagios

Posted: Thu Mar 29, 2012 1:27 pm
by metadojo
hello,

I have done everything perfectly but cant ssh into nagios...

(from a ubuntu vm on my desktop)
ssh -i testnewkp.pem [email protected]
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

ive tried a new pem file, changing perms on the pem file
tried from mindterm java applet from aws console
tried from putty
tried from a ubuntu vm on my desktop
ive tried ec2-user, root, nagiosadmin,

Re: ssh into ec2 nagios

Posted: Thu Mar 29, 2012 1:52 pm
by scottwilkerson
How long after starting the instance did you try the connection?

After bringing up the instance for the first time, it takes about 15-20 minutes (on a m1.large) before all the software is installed.

It takes even longer for smaller instances.

Re: ssh into ec2 nagios

Posted: Mon Apr 02, 2012 9:52 am
by metadojo
many hours after initial installation.

Re: ssh into ec2 nagios

Posted: Mon Apr 02, 2012 11:12 am
by scottwilkerson
The key file needs to be the one downloaded from Amazon. No others will work.

Amazon places the public key on the server after bootup.

The user you need to login as is ec2-user, and the permissions on the keyfile should be 600

Re: ssh into ec2 nagios

Posted: Mon Apr 02, 2012 12:09 pm
by metadojo
yes ive done all that. actually the first box i fired up suddenly worked today.
24 hours?!

i created a new VM in ec2
and seeing the same symptoms now.

anyway to speed this up?

Re: ssh into ec2 nagios

Posted: Mon Apr 02, 2012 1:24 pm
by scottwilkerson
What size instances are you starting?

Re: ssh into ec2 nagios

Posted: Mon Apr 02, 2012 2:05 pm
by metadojo
small.

Re: ssh into ec2 nagios

Posted: Mon Apr 02, 2012 2:17 pm
by metadojo
ok i was able to get in finally...

i have another issue now... the original problem....

Hello,

I am running a small instance of
AMI: nagiosxi/centos/6/2.2-SNAPSHOT-1/x86_64 (ami-8f8d53e6)
the nagios image in AWS EC2.

I tried installing the check_mongo.py plugin into nagios XI with these directions....
http://www.doug.kerr-net.us/mediawiki/i ... _Configure

in short...
define command {
command_name check_mongodb
command_line $USER1$/nagios-plugin-mongodb/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$
}

define service {
use generic-service
hostgroup_name Mongo Servers
service_description Mongo Connect Check
check_command check_mongodb!connect!27017!2!4

}

and then i go to the XI UI and
create a command
a host to point to my mongodb install
and a nagios service that runs the check command

unfortunately i get Return code of 127 is out of bounds, plugin may be missing

I tried installing pymongo manually with yum install pymongo.

I tried changing the command structure from

$USER1$/nagios-plugin-mongodb/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$
To
$USER1$ /check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$
To
/usr/local/nagios/libexec/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$

and i chmod the check_mongo.py file to 777

nothing has worked so far.

any ideas?

Re: ssh into ec2 nagios

Posted: Mon Apr 02, 2012 3:21 pm
by scottwilkerson
metadojo wrote:ok i was able to get in finally...

i have another issue now... the original problem....
Answered here
http://support.nagios.com/forum/viewtop ... f=6&t=5379