Skip to content

Manual InfraSonar installation

All steps outlined below our automated in our deploy script.

Upgrade

First step is to update and upgrade your Ubuntu installation so we are current before proceeding.

sudo apt update
sudo apt upgrade
sudo reboot

VMware tools

Optional

When running on a VMware hypervisor it is recommended to install open-vm-tools.

# Update the APT package index.
sudo apt update
# Install open VMware tools.
sudo apt install -y open-vm-tools

Miscellaneous tools

sudo apt install -y vim nano cron dnsutils snmp iputils-ping curl snmpd jq

The above command installs a list of useful tools:

  • vim, VI text editor.
  • nano, text editor.
  • cron, task schedular.
  • dnsutils, handy tool for debugging dns issues.
  • snmp, snmpd daemon used to monitor the Linux operating system.
  • iputils-ping, tools for debugging network issues.
  • curl, command-line downloader
  • tmate, teamviewer like solution used to offer remote support on request.

SNMPD

As we use the default community string public and only require the snmpd daemon to listen on localhost, no further configuration is required.

Edit the /etc/snmp/snmpd.conf file to ensure access to all facilities:

/etc/snmp/snmpd.conf
# Read-only access to everyone to the systemonly view
rocommunity  public default -V systemonly
rocommunity6 public default -V systemonly

Change the above section to:

/etc/snmp/snmpd.conf
# Read-only access to everyone to the systemonly view
rocommunity  public default
rocommunity6 public default

Restart the snmpd service to make the changes effective:

service snmpd restart

Docker installation

All InfraSonar components run as Docker containers and are orchestrated using docker-compose.

The official Docker engine installation instructions can be found here.

sudo curl -sSL https://get.docker.com | bash

Unattended updates

As we want the InfraSonar appliance to be zero maintenance, we configure unattended updates and allow the appliance to reboot when necessary at 2:00 CET.

Create the following script as /root/ubuntu_update.bash:

ubuntu_update.bash
#!/bin/bash

# Log file for updates
LOG_FILE="/var/log/ubuntu_automatic_updates.log"

# Function to perform the updates
perform_updates() {
  echo "$(date): Starting automatic updates..." >> "$LOG_FILE"

  # Update package lists
  apt update >> "$LOG_FILE" 2>&1

  # Upgrade installed packages (including new packages if needed)
  apt upgrade -y >> "$LOG_FILE" 2>&1

  # Dist-upgrade to handle distribution upgrades if available (use cautiously)
  # apt dist-upgrade -y >> "$LOG_FILE" 2>&1  # Uncomment if you want dist-upgrades

  # Autoremove to remove unused packages
  apt autoremove -y >> "$LOG_FILE" 2>&1

  # Autoclean to remove old downloaded package files
  apt autoclean -y >> "$LOG_FILE" 2>&1

  # Check if a reboot is required
  if [ -f /var/run/reboot-required ]; then
    echo "$(date): Reboot required. Rebooting..." >> "$LOG_FILE"
    # Remove the lock file
    rm /tmp/ubuntu_automatic_updates.lock
    reboot
  else
    echo "$(date): No reboot required." >> "$LOG_FILE"
  fi

  echo "$(date): Automatic updates completed." >> "$LOG_FILE"
}


# Check if the script is already running
if [ -f /tmp/ubuntu_automatic_updates.lock ]; then
  echo "$(date): Automatic updates already running. Exiting." >> "$LOG_FILE"
  exit 1
fi

# Create a lock file
touch /tmp/ubuntu_automatic_updates.lock

# Perform the updates
perform_updates

# Remove the lock file
rm /tmp/ubuntu_automatic_updates.lock

exit 0

Add this script to crontab of user root like this:

sudo sh -c '(crontab -l ; echo "0 2 * * * /root/ubuntu_update.bash") | crontab -'

Note using sudo crontab -e you can edit the schedule to your liking.

InfraSonar installer

Our InfraSonar installer is available on GitHub

The following command ensure download and execution of our latest installer:

## Create and change into a temporary directory
cd $(mktemp -d)
## Download the latest InfraSonar appliance installer
curl -sL $(curl -s https://api.github.com/repos/infrasonar/appliance-installer/releases/latest | jq -r '.assets[] | select(.name | contains ("linux")) | .browser_download_url') -o appliance-installer-linux-amd64.tar.gz
## Unpack the InfraSonar appliance installer
tar -xzvf appliance-installer-linux-amd64.tar.gz
## Run the InfraSonar appliance installer
sudo ./appliance-installer

Follow the prompts from the installer.