Here is How To Install Cacti To Monitor Server Resource Consumption and Usage. Example is Given With Ubuntu Instance With Nginx on HP Cloud. Yesterday, we were discussing about the OpenStack monitoring service on HP Cloud. It is better to install Cacti to monitor server in case of HP Cloud, at current situation.
What We Need To Install Cacti To Monitor Server
Cacti provides an easy to use system monitoring solution, the graphs are included by default includes load average and memory usage. You might not need to install MySQL and Nginx if you already have installed them on your server. You should take a snapshot of the image for HP Cloud before doing anything.
Steps To Install Cacti To Monitor Server
We already have Nginx installed, if you need to install Nginx, it is easy :
---
1 | sudo apt-get install nginx |
We need to install SNMPD Service as next step :
1 | sudo apt-get install rrdtool snmp snmpd |
Edit this file :
1 | nano /etc/default/snmpd |
Find (^ + W
) the phrase export MIBS=
and add ALL
:
1 | export MIBS=ALL |
Write out (^ + O
) and exit (^ + X
). Open this file :
1 | nano /etc/snmp/snmpd.conf |
Find the commented out line :
1 | #rocommunity public localhost |
Remove the hash, write out (^ + O
) and exit (^ + X
). Restart the service :
1 | sudo service snmpd restart |
This will initiate installation of Cacti. You must take a full backup if it is your only and main server.
1 | sudo apt-get install cacti-spine |
This is the prompt screen :
If we ran yes, you could not read this guide! Our MariaDB is on different server, but MariaDB is installed on this server too. It can not detect it. You can head to official website :
1 | http://www.cacti.net/ |
and download the tar and install.
After running it, it will give text based interface like installing PHPMyAdmin for :
changing php path
select the web server (go with none)
Cacti database configurations
Cacti username password
database admin user password
Usually, the public files are at – /usr/share/cacti/site
. So we need to symlink :
1 2 3 | cd /usr/share/nginx/html ln -s /usr/share/cacti/site cacti sudo chown -R root:www-data /usr/share/nginx/html/cacti |
Now, if you point towards :
1 | http://your-IP/cacti/ |
simple PHP web interface will help you to install Cacti. Username admin
and Password admin
– in case the text based interface gave you no option. It is designed for Apache2, but actually works fine on Nginx – MariaDB. Installing on a test instance or not so important instance is better for first time installation. If you go to the cacti public files :
1 | cacti/include |
you’ll see config.php
file, that is like any PHP-MySQL web software like WordPress. If polling does not work, add a cron. It is exactly like WordPress. Very easy, but gives minor initial pain.