Automated Deployments in AWS

Need to   install a Nagios 3.x distro on the image ( micro )  - both the daemon and the client should be installed on the machine.
*   the installation should be performed using a script invoked remotely i.e. without a need to manually ssh into the machine.

Any help appreciated. Looked at  cloudformation, but I am not sure about how to use it.
TIA !
LVL 63
SysExpertAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

btanExec ConsultantCommented:
it looks the use case may required a Amazon Machine Image (AMI) and with Nagios installed  ideally, but most of it is using AMI, connect to it then install. Like http://community.spiceworks.com/how_to/93152-installing-nagios-core-on-amazon-linux-instance#how_to/93152-installing-nagios-core-on-amazon-linux-instance

But not going via SSH as above link stated, it has to be offline type to create some sort of template file and push into the AWS to automate the necessary service and instance interfaces. Indeed unless we can get a readily available Nagios AMI (finding the AMI in marketplace did not surface much and those in public is pretty out-dated) otherwise its seems AWS Cloudformation is one mean you stated. You can know how Cloudformation actually works in - in short come up with a local template file, of AWS CloudFormation type (a JSON-formatted text file that describes your AWS infrastructure) and ask latter to automatically uploads your created template into an Amazon (S3) bucket in your AWS account. http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-howdoesitwork.html

May be good to have some starter reads ...this demonstrate for a Wordpress blog http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/GettingStarted.Walkthrough.html

I saw a sample Nagios Cloudformation below but of 2010 though
http://sea2shore.googlecode.com/svn-history/r3/trunk/src/infrastructure/nagios/nagios.template

But do note CLoudformation has limitations stated too and be aware (if venturing into it and seems the only optimal means ...) http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html

More info on Cloudformation in public doing https://opentodo.net/2015/01/aws-cloudformation-defining-your-stack/
0
SysExpertAuthor Commented:
AWS has an option to run an install file when an instance is strted. The problem is that none of install scripts I have found work properly on any of the RHEL, AWS or ubuntu Micros T2 instances. Ubuntu is closest, but requires manual input for mail server and other stuff.
I am going to add a nagios category. Maybe someone has a better script.
0
btanExec ConsultantCommented:
agree not well tested but it is going to tough to have one working out unless marketplace has one which is not available as well. Hard pulling effort to work out this script as most are outdated...

Cloudformation tmpl is preferred as it comes with script to install and deploy into the EC2 using a set of helper scripts (cfn-init, cfn-signal, cfn-get-metadata, and cfn-hup) that are based on cloud-init. The bootstrapping of appl in general in AWS can be handy ...
https://s3.amazonaws.com/cloudformation-examples/BoostrappingApplicationsWithAWSCloudFormation.pdf
Tool page -
•cfn-init: Used to retrieve and interpret the resource metadata, installing packages, creating files and starting services.
•cfn-signal: A simple wrapper to signal an AWS CloudFormation CreationPolicy or WaitCondition, enabling you to synchronize other resources in the stack with the application being ready.
•cfn-get-metadata: A wrapper script making it easy to retrieve either all metadata defined for a resource or path to a specific key or subtree of the resource metadata.
•cfn-hup: A daemon to check for updates to metadata and execute custom hooks when the changes are detected.
http://aws.amazon.com/developertools/AWS-CloudFormation/4026240853893296

There are sample but not drilled into them though http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-sample-templates.html

But as shared too...getting the nagios AMI with cloudformation (latest) may not easily avail, though I shared an instance in first post..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Firewall Audit Checklist

Preparing for a firewall audit today is almost impossible.
AlgoSec, together with some of the largest global organizations and auditors, has created a checklist to follow when preparing for your firewall audit. Simplify risk mitigation while staying compliant all of the time!

SysExpertAuthor Commented:
Resolved issue. Needed EPEL for 7 not 6 on RHEL micro. used user-data in AWS console to  use auto install script.
0
SysExpertAuthor Commented:
Thanks. I already had all the info, just an issue with the install script.
0
btanExec ConsultantCommented:
thanks for sharing, indeed as stated "--userdata" parameter under
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
AWS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.