Installing mackerel-agent in Red Hat Enterprise Linux derivatives
Contents described on this page are also available from the New host registration screen in Mackerel.
When using RHEL 8 (or later) based Linux Distributions
Execute the following command:
curl -fsSL https://mackerel.io/file/script/setup-all-yum-v2.sh | MACKEREL_APIKEY='<YOUR_API_KEY>' shYou can obtain the API key from the API tab on your organization's page. Keep in mind this key is used to identify your organization, so we strongly advise not sharing it with others.
Updates can be performed using the yum command.
sudo yum update mackerel-agentUsing `rpm`
To install mackerel-agent with rpm run the following command:
sudo rpm -ivh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.noarch.rpmTo update Mackerel-agent with rpm run the following command:
sudo rpm -Uvh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.noarch.rpmEditing configuration files
Edit the file /etc/mackerel-agent/mackerel-agent.conf and set the API key.
apikey = "<YOUR_API_KEY>"You can obtain the API key from the API tab on your organization's page. Keep in mind this key is used to identify your organization, so we strongly advise not sharing it with others.
For more information, please refer to mackerel-agent specifications.
Using configuration files the following can be done:
Launching mackerel-agent
When using RHEL 8 (or later) based Linux Distributions
To launch Mackerel-agent run the following command:
sudo systemctl start mackerel-agentYou can find the log file here: /var/log/mackerel-agent.log.
sudo journalctl -u mackerel-agent.serviceOnce the agent starts functioning properly, the host will be registered with Mackerel, which you can confirm by checking the Dashboard.
Uninstalling mackerel-agent
To uninstall Mackerel-agent run one of the following commands:
If the agent was installed with yum:
sudo yum remove mackerel-agentIf the agent was installed with rpm:
sudo rpm -e mackerel-agentLastly, please do not forget to delete the file /var/lib/mackerel-agent/id which by default contains the host ID.
Installing the KCPS edition of mackerel-agent as an RPM package
Using yum
First things first, we need to register the Mackerel yum repository:
curl -fsSL http://198.18.0.16/file/setup-yum-kcps.sh | shOnce that’s done, we can use yum to install:
sudo yum install mackerel-agent-kcpsYou can also use yum to update Mackerel-agent:
sudo yum update mackerel-agent-kcpsUsing rpm
To install mackerel-agent with rpm run the following command:
sudo rpm -ivh http://198.18.0.16/file/rpm/mackerel-agent-kcps-latest.noarch.rpmTo update Mackerel-agent with rpm run the following command:
sudo rpm -Uvh http://198.18.0.16/file/rpm/mackerel-agent-kcps-latest.noarch.rpmEditing configuration files
Edit the file /etc/mackerel-agent-kcps/mackerel-agent-kcps.conf and set the API key.
apikey = "<YOUR_API_KEY>"You can obtain the API key from your organization's page. Keep in mind this key is used to identify your organization, so we strongly advise not sharing it with others.
For more information, please refer to mackerel-agent specifications.
Using configuration files the following can be done:
Launching mackerel-agent
To launch Mackerel-agent run the following command:
sudo /etc/init.d/mackerel-agent-kcps startYou can find the log file here: /var/log/mackerel-agent-kcps.log
Once the agent starts functioning properly, the host will be registered with Mackerel, which you can confirm by checking the Dashboard.
Uninstalling mackerel-agent
To uninstall Mackerel-agent run one of the following commands:
If the agent was installed with yum:
sudo yum remove mackerel-agent-kcpsIf the agent was installed with rpm:
sudo rpm -e mackerel-agent-kcpsLastly, please do not forget to delete the file /var/lib/mackerel-agent-kcps/id which by default contains the host ID.