Title | Date | URL | EditURL |
---|---|---|---|
Installing mackerel-agent in Amazon Linux |
2016-05-23 15:21:56 +0900 |
The content described on this page is also available from the New Host registration screen in Mackerel.
Amazon Linux and Amazon Linux 2 LTS run different commands for installation. Please check out each procedure. Installation can also be done directly using the `rpm` command.Execute the following command:
curl -fsSL https://mackerel.io/file/script/amznlinux/setup-all-yum-v2.sh | MACKEREL_APIKEY='<YOUR_API_KEY>' sh
You can check the API key from the Organization page’s API Keys tab. Keep in mind that this key is used to identify your organization, so we strongly advise not sharing it with others.
Execute the following command:
curl -fsSL https://mackerel.io/file/script/amznlinux/setup-all-yum.sh | MACKEREL_APIKEY='<YOUR_API_KEY>' sh
You can check the API key from the Organization page’s API Keys tab. Keep in mind that this key is used to identify your organization, so we strongly advise not sharing it with others.
To install mackerel-agent with rpm
run the following command:
sudo rpm -ivh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.amzn2.x86_64.rpm
To update Mackerel-agent with rpm
run the following command:
sudo rpm -Uvh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.amzn2.x86_64.rpm
To install mackerel-agent with rpm
run the following command:
sudo rpm -ivh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.x86_64.rpm
To update Mackerel-agent with rpm
run the following command:
sudo rpm -Uvh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.x86_64.rpm
Edit the /etc/mackerel-agent/mackerel-agent.conf
file to configure the agent.
By using the configuration file, the following can be implemented:
- Service and role configuration
- Posting user-defined custom metrics
- Adding monitors for script checks
For more details, check out the mackerel-agent specifications help page.
Please be sure to configure the API key if installed from rpm. This is done automatically if set up with the setup script.
apikey = "<YOUR_API_KEY>"
You can check the API key from the Organization page’s API Keys tab. Keep in mind that this key is used to identify your organization, so we strongly advise not sharing it with others.
The agent will start by running the following command:
sudo systemctl start mackerel-agent
The log is output to Journal. You can check the mackerel-agent log with the following command.
sudo journalctl -u mackerel-agent.service
When the agent begins to run properly, it will be registered as a host in Mackerel. Please confirm this in dashboards etc.
The agent will start by running the following command:
sudo /sbin/service mackerel-agent start
The agent’s log is output to /var/log/mackerel-agent.log
.
When the agent begins to run properly, it will be registered as a host in Mackerel. Please confirm this in dashboards etc.
To uninstall mackerel-agent, run the following command.
sudo yum erase mackerel-agent
By doing so, a file with the host ID documented will remain (at /var/lib/mackerel-agent/id
under default settings), so please make sure to delete it.