-
It begins by updating the Linux system and installing essential tools such as curl, git, and vim.
-
Next, it downloads and installs K3s, a lightweight Kubernetes distribution, by executing the installation script obtained from the URL specified by the
K3S_INSTALL_SCRIPT
variable. -
It then downloads and installs K9s, a terminal-based Kubernetes dashboard, by executing the installation script obtained from the URL specified by the
K9S_INSTALL_SCRIPT
variable. The script also moves the K9s binary to theBIN_DIR
directory. -
The script proceeds to download and install Helm, the Kubernetes package manager, by executing the installation script obtained from the Helm GitHub repository.
-
It fetches the LibreNMS Helm chart and installer repositories from the GitHub repository specified by the URLs
https://github.com/LoveSkylark/LibreNMS-Helm.git
andhttps://github.com/LoveSkylark/LibreNMS-Installer.git
, respectively. The repositories are cloned into theLNMS_DIR/chart/LibreNMS-Helm
andLNMS_DIR/installer
directories, respectively. -
It copies the
lnms-config.yaml
file from the installer directory to theLNMS_DIR
directory if it doesn't already exist. -
The script sets up aliases for managing Kubernetes and Helm by copying the necessary files from the installer's
profile.d
directory to/etc/profile.d/
. -
It configures SNMP for LibreNMS monitoring by copying the SNMP configuration file from the installer's
snmpd.conf.d
directory to/etc/snmp/snmpd.conf.d
and restarting the SNMP daemon. -
The script prompts the user to configure the LibreNMS cluster by editing the
lnms-config.yaml
file using the Vim editor. -
The installation of the LibreNMS cluster is initiated by calling the
LibreClusterInstall
function, which uses Helm to install the LibreNMS Helm chart with the specified configuration file. -
It adds the host IP address to SNMP monitoring by calling the
LibreSNMPadd
function, which retrieves the host IP address and uses thelnms device:add
command to add it to SNMP monitoring. -
Finally, the script displays a completion message and provides instructions for managing the Kubernetes cluster, accessing the LibreNMS web interface, using the K9s dashboard, editing the LibreNMS cluster configuration, and adding additional devices to LibreNMS.
Please note that the script assumes certain directory paths (BIN_DIR
, LNMS_DIR
) and URLs (K3S_INSTALL_SCRIPT
, K9S_INSTALL_SCRIPT
). Make sure to modify them according to your environment before running the script.