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>' sh

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.

Updates can be performed using the yum command.

sudo yum update mackerel-agent

Using rpm

To install mackerel-agent with rpm run the following command:

sudo rpm -ivh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.noarch.rpm

To update Mackerel-agent with rpm run the following command:

sudo rpm -Uvh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.noarch.rpm

Editing 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-agent

You can find the log file here: /var/log/mackerel-agent.log.

sudo journalctl -u mackerel-agent.service

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 erase mackerel-agent

If the agent was installed with rpm:

sudo rpm -e mackerel-agent

Lastly, 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 | sh

Once that’s done, we can use yum to install:

sudo yum install mackerel-agent-kcps

You can also use yum to update Mackerel-agent:

sudo yum update mackerel-agent-kcps

Using 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.rpm

To update Mackerel-agent with rpm run the following command:

sudo rpm -Uvh http://198.18.0.16/file/rpm/mackerel-agent-kcps-latest.noarch.rpm

Editing 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 start

You 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 erase mackerel-agent-kcps

If the agent was installed with rpm:

sudo rpm -e mackerel-agent-kcps

Lastly, please do not forget to delete the file /var/lib/mackerel-agent-kcps/id which by default contains the host ID.

-

If you have any questions please contact our support team at support@mackerel.io