Installing Host metrics automatically
Hi Team,
I want to collect metrics for EC2 instances. I get that I need installed collectors for getting the host metrics. I have load balancers already in place. So I need a way so that Sumo collectors will be installed on my EC2 instances on the fly. I have looked on below link:
https://help.sumologic.com/07Sumo-Logic-Apps/14Hosts_and_Operating_Systems/Host_Metrics
Baking collector on EC2 image is not an option for me.
Any suggestions?
-
Hi Jyotsna,
When you say you want to install the collector on the fly on EC2 instances, I assume that you mean whenever a EC2 instance is spin up you want to have a collector installed.
The only way is to bake the collector in EC2 image, apart from this there is no automated process we have.
Ultimately, we need the installation file, access id, access key and source configuration(host metrics source). If you can make an automated script which you can deploy that can download and provide the required details for the installation then it can be done. But again that wont be on the fly, you have to provide the script to that instance.
Regards,
Shobhit
-
Hi Jyotsna,
We can install the Sumo Collector and Sources (sources.json) with User Data:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-console
For example, you can add user data (a bootstrap script) that will do the following:
1. Download/copy your sources.json file - you can host this in S3 and download from there, for example, or build it into your machine image
2. Download/copy the Sumo collector, rename and make executable:
wget "https://collectors.us2.sumologic.com/rest/download/linux/64" -O SumoCollector.sh && chmod +x SumoCollector.sh
3. Start the collector and point to your sources.json file to add sources automatically
sudo ./SumoCollector.sh -q -Vsumo.accessid=<accessId> -Vsumo.accesskey=<accessKey> -Vsources=<absolute_filepath>
After the sources.json file has been copied onto the server, here is an example user data script to install the collector on Linux:
wget "https://collectors.us2.sumologic.com/rest/download/linux/64" -O SumoCollector.sh && chmod +x SumoCollector.sh sudo ./SumoCollector.sh -q -Vsumo.accessid=<accessId> -Vsumo.accesskey=<accessKey> -Vsources=<absolute_filepath>
Please sign in to leave a comment.
Comments
2 comments