Installing Host metrics automatically

Comments

2 comments

  • Avatar
    Shobhit Garg

    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

    0
    Comment actions Permalink
  • Avatar
    Graham Watts

    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>





    0
    Comment actions Permalink

Please sign in to leave a comment.