Published Monday 10th June 2024

Installing Rackspace DriveClient and monitoring agent on Rocky 9 or Alma 9

With CentOS 7.9 hitting end of life this month, we've been setting up new servers recently and decommissioning some of the older servers that we look after. We're a Rackspace partner and a lot of our security and management procedures are built around the Rackspace Cloud infrastructure, so naturally the new servers we've been spinning up are Rackspace Cloud servers, of which there are a variety of Linux distributions available to choose from.

Since CentOS 7.9 was a Redhat Enterprise Linux (RHEL) downstream distribution, we wanted to stick with a RHEL downstream for the new servers. To cut a long story short, we originally chose Rocky 9 as our preferred RHEL 9 downstream, because it was started by one of the original CentOS founders, Gregory Kurtzer, and is well-funded for continued development, but after setting up our first Rocky 9 server we discovered that the Plesk server management platform doesn't yet support installation on Rocky 9, so we ended up side-stepping to Alma 9. Both Rocky and Alma are essentially the same - they're both binary compatible RHEL downstream distributions, basically only differing in who maintains them and how they're funded.

With both Rocky 9 and Alma 9 though, we did find that the Rackspace backup agent (DriveClient) and Rackspace monitoring agent wouldn't install and run properly via the conventional installation method, so reached out to the Rackspace engineers for support. In the end we were able to get both DriveClient and the monitoring agent working on both distributions and everything has been working perfectly for a couple of months now, so here are the steps for anybody else struggling with this.

Rackspace DriveClient

After spinning up a new Rackspace Cloud Alma 9 or Rocky 9 server and setting up the drives and user accounts etc, one of the first things you'll want to do is install the Rackspace DriveClient. This is the server-side backup agent which communicates with the backup systems configured in your Rackspace Cloud account, to package up and transfer drive backups to remote cloud storage. Usually you would navigate to the server within your Cloud account and follow the link to set up the backup agent, but this doesn't currently work on Alma 9 or Rocky 9, so instead you'll need to follow these steps. Install DriveClient first.

First off, the installer uses wget to pull important files in, and tar + bzip2 to extract them. So we need to make sure these are all installed. Both Alma and Rocky Linux use the DNF package manager so the command is the same for either distribution:

sudo dnf install wget tar bzip2

Next up, we need to install the repository to pull RHEL LSB headers from. Which repository you install depends on whether you're setting up on Alma 9 or Rocky 9, so only run one of the following:

RHEL LSB headers for Rocky 9 servers:

sudo dnf --nogpg install https://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el9.noarch.rpm
sudo dnf --enablerepo=gf install redhat-lsb-core

RHEL LSB headers for Alma 9 servers:

sudo dnf install almalinux-release-devel
sudo dnf install redhat-lsb-core

Installing

Now you can install the driveclient software:

cd /opt
sudo wget https://agentrepo.drivesrvr.com/repo/cbu-updater-standalone.py
sudo python3 cbu-updater-standalone.py install cbu-updater driveclient

To configure DriveClient, you'll need a few pieces of information from your Rackspace Cloud account. You'll need to note down your primary Rackspace account username, the Rackspace API key for that same user account, and the data-centre shortcode where your server resides. So if your primary account username is foobah for example, then log in to the Rackspace Cloud with your foobah user account, navigate to your profile and click the Show button next to the Rackspace API Key value, and then navigate to your servers list, click in to the relevant server, and note down the three letter code next to Region.

Here, we assume that your username is foobah, your API key is abc123, and your region code is LON. Replace these values in the following command with your own:

sudo /usr/local/bin/driveclient --configure --user foobah --apikey abc123 --datacenter LON --flavor raxcloudserver

Finally, enable the installed DriveClient daemon to start up with any subsequent reboots, invoke it manually for the current session, and check its status to make sure it's actually running. You should then be able to configure and run backups via the Rackspace Cloud panel.

sudo systemctl enable driveclient
sudo systemctl start driveclient
sudo systemctl status driveclient

Rackspace monitoring agent

With the DriveClient installed and running, you're now able to configure and run backups via the Rackspace Cloud panel, but we're not quite done yet. Normally when you install the agent conventionally, the installer pulls in the Rackspace monitoring agent too, which feeds back things like processor and memory usage information so that you can configure email alerts when problems occur with your servers, and also so that the panel itself can display server health information. This monitoring agent isn't installed yet, so we need to proceed with that.

The first step is to install the signing key. There are two urls for this, one for alma-9.asc and one for rocky-9.asc, but both are actually identical so it doesn't really matter which you use. Either url will pull in the right file for either distribution.

curl https://monitoring.api.rackspacecloud.com/pki/agent/rocky-9.asc > /tmp/signing-key.asc
sudo rpm --import /tmp/signing-key.asc

Next we need to create a config file for the cloud monitoring repository. At the time of this writing, there isn't a Rocky 9 or Alma 9 specific baseurl to use, but the Rocky 8 or Alma 8 repositories work fine. You might prefer to browse the directory listing to see if there's now a version 9 tree to use here instead, as presumably one will be added eventually. Otherwise, just go with the version 8 url.

Be aware that the following line uses echo -e, which enables parsing of escape characters. So the \n instances represent line breaks and aren't part of the url itself. If you're swapping the url out for another, make sure you keep the suffixing \n.

For Rocky 9 servers:

echo -e "[rackspace]\nname=Rackspace Monitoring\nbaseurl=https://stable.packages.cloudmonitoring.rackspace.com/rockylinux-8-x86_64/\nenabled=1" | sudo tee /etc/yum.repos.d/rackspace-cloud-monitoring.repo

For Alma 9 servers:

echo -e "[rackspace]\nname=Rackspace Monitoring\nbaseurl=https://stable.packages.cloudmonitoring.rackspace.com/almalinux-8-x86_64/\nenabled=1" | sudo tee /etc/yum.repos.d/rackspace-cloud-monitoring.repo

Installing

Now install and configure the monitoring agent. Like with the DriveClient configuration, you'll need your primary Rackspace username and API key here. So if your primary account username is foobah for example, then log in to the Rackspace Cloud with your foobah user account, navigate to your profile and click the Show button next to the Rackspace API Key value.

Here, we assume that your username is foobah, and your API key is abc123. Replace these values in the following command with your own:

sudo dnf update
sudo dnf install rackspace-monitoring-agent
sudo rackspace-monitoring-agent --setup --username foobah --apikey abc123

Finally, enable the installed monitoring agent to make sure it starts with subsequent boots, and manually invoke it for the current session.

rackspace-monitoring-agent start -D
sudo systemctl start rackspace-monitoring-agent
sudo systemctl enable rackspace-monitoring-agent

You should now be able to navigate to the server within your Rackspace Cloud portal and see CPU, RAM, and disk usage information. You can also configure alert emails from here.

Photo of Ric

Ric

Ric is a senior web and game programmer with nearly 30 years industry experience and countless programming languages in his skillset. He's worked for and with a number of design and development agencies, and is the proprietor of QWeb Ltd. Ric is also a Linux server technician and an advocate of free, open-source technologies. He can be found on Mastodon where he often posts about the projects he's working on both for and outside of QWeb Ltd, or you can follow and support his indie game project on Kofi. Ric also maintains our Github page of useful scripts.

Blog posts are written by individuals and do not necessarily depict the opinions or beliefs of QWeb Ltd or its current employees. Any information provided here might be biased or subjective, and might become out of date.

Discuss this post

Nobody has commented yet.

Leave a comment

Your email address is used to notify you of new comments to this thread, and also to pull your Gravatar image. Your name, email address, and message are stored as encrypted text. You won't be added to any mailing list, and your details won't be shared with any third party.

This site is protected by reCAPTCHA and the Google Privacy Policy & Terms of Service apply.