Deploying and fixing LibreNMS for ESXi Host
LibreNMS is a free and great monitoring tool, but is quite challenging to deploy without having a good knowledge in Linux. The images provided by LibreNMS.org is suppose to help, but unfortunately appear to be improper configured, making deployment using their images quite difficult as well.
In my first attempt, I download their Virtualbox OVA image and attempt to convert it into OVF image using the guide here.
Unfortunately it doesn't work, because there are just too many incompatible hardware components between the two virtualisation platforms.
In my next attempt, I download their VMDK image and create a new Virtual Machine with similar specification after reviewing the VM specification found in their VirtualBox OVA image:
- 1 vCPU
- 2 GB RAM (I upgrade 1 to 2GB RAM)
- 10GB Storage (after creating the VM, I upload the vmdk image from librenms.org, removing existing harddisk and add a new harddisk using the new vmdk image)
Next I install the vmtools by mounting it from vSphere webclient and enter the following commands:
- mkdir /mnt/cdrom
- mkdir /tmp/vmtools
- mount /dev/cdrom /mnt/cdrom
- cp /mnt/cdrom/VMwareTools... /tmp/vmtools/ (... = use Tab to let system auto fill the filename)
- cd /tmp/vmtools/
- tar -xvf VMware... (... = use Tab to let system auto fill the filename)
- cd /tmp/vmtools/vmware-tools-distrib
- ./vmware-install.pl
As the image default to UK keyboard, I have to change it to US keyboard:
- localectl set-keymap us
Next is setting up a static address for it, as it is default to dynamic IP. However, I notice that there are two ethernet configuration files: ifcfg-enp0s3 and ifcfg-wired_connection_1. ifcfg-wired_connection_1 is the correct file to amend in order to assign a static IP address. You can edit the file using vi command or use the UI:
- nmtui edit (enter all the required information such as IP address, Gateway and DNS etc)
However, I notice that the UI does not have a subnet mask field, resulting in the prefix remaining at 32. So I still have to use the vi command to correct it:
- sudo vi /etc/sysconfig/network-scripts/ifcfg-wired_connection_1 (amend PREFIX=32 to PREFIX=24 if you are using Class C IP address)
- :wq! (write and quit)
Everything appears to be working but one day later, the Web UI failed with this error:
Error: Missing dependencies! Run the following command to fix:
./scripts/composer_wrapper.php install --no-dev
When I attempt to execute the suggested command, I got these:
Problem 1
- The requested PHP extension ext-mysqlnd * is missing from your system. Install or enable PHP’s mysqlnd extension.
Problem 2
- The requested PHP extension ext-mbstring * is missing from your system. Install or enable PHP’s mbstring extension.
Problem 3
- Installation request for erusev/parsedown 1.7.1 -> satisfiable by erusev/parsedown[1.7.1].
- erusev/parsedown 1.7.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 4
- Installation request for laravel/framework v5.4.36 -> satisfiable by laravel/framework[v5.4.36].
- laravel/framework v5.4.36 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 5
- laravel/framework v5.4.36 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- wpb/string-blade-compiler 3.4.x-dev requires laravel/framework 5.4.* -> satisfiable by laravel/framework[v5.4.36].
- Installation request for wpb/string-blade-compiler 3.4.x-dev -> satisfiable by wpb/string-blade-compiler[3.4.x-dev].
I try to redeploy the vmdk image again and got it to work again. But the next day, the same error reappear. I finally resolve it using the following commands:
- sudo su
- yum update
- yum install php70w-mbstring
- yum remove php70w-mysql
- yum install php70w-mysqlnd
- yum swap php70w-mysql php70w-mysqlnd
- ./scripts/composer_wrapper.php install --no-dev
- ./validate.php
- ./daily.sh
- chown -R librenms:librenms /opt/librenms
- chmod 755 /opt/librenms/.pki/nssdb
restart the apache/nginx service or reboot the VM
To add ESXi hosts into LibreNMS for monitoring, I found this website.
btw, for security reason, do remember to change the default passwords provided by the images. Remember to change the root password too! Their documentation missed this, but I found out that it's the same as librenms default password.
Network Administrator at BCI - Banco Comercial e de Investimentos
3 年Hello Boon Hong Wong, I’ve just downloaded the new ova file " librenms-ubuntu-20.04-amd64.ova" and gone to deploy it in my ESXi server, but get the following error. How solve it?
Bachelor's degree at American InterContinental University
5 年Great work! I can't login though. What is the default login?
It looks like the image provided by librenms.org has many outdated components with many improper or incomplete configuration as well. The instruction guide on the website given is incomplete too. Time zone has to be configured not just at the OS level, but also at both the php and database level. rrdcached.service is configured wrongly as well, pointing to /usr/bin/rrdcached instead of /bin/rrdcached. Root password has to be changed and this is not even mentioned on the guide too. But the first thing to do is to change the default UK keyboard to US keyboard or else if you change the password first and happen use any symbol such as # and end up with £, it would be fatal once you change keyboard! lol Fortunately the root password is the same as the librenms account and I manage to use root login to change librenms password.?(Using copy and paste doesn’t work.)