-
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_SCRIPTvariable. -
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_SCRIPTvariable. The script also moves the K9s binary to theBIN_DIRdirectory. -
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.gitandhttps://github.com/LoveSkylark/LibreNMS-Installer.git, respectively. The repositories are cloned into theLNMS_DIR/chart/LibreNMS-HelmandLNMS_DIR/installerdirectories, respectively. -
It copies the
lnms-config.yamlfile from the installer directory to theLNMS_DIRdirectory 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.ddirectory to/etc/profile.d/. -
It configures SNMP for LibreNMS monitoring by copying the SNMP configuration file from the installer's
snmpd.conf.ddirectory to/etc/snmp/snmpd.conf.dand restarting the SNMP daemon. -
The script prompts the user to configure the LibreNMS cluster by editing the
lnms-config.yamlfile using the Vim editor. -
The installation of the LibreNMS cluster is initiated by calling the
LibreClusterInstallfunction, 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
LibreSNMPaddfunction, which retrieves the host IP address and uses thelnms device:addcommand 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.