Install and configure cacti 0.8.8 f from scratch under Ubuntu 14.04

Remember the time when I was given the task to install and configure cacti with 95th Percentile graphs and aggregation graphs. And these memories have overtaken me sad... First tried to install and configure cacti via ppa turnip – got a lot of problems with symlinkname, rights, etc Then put directly from the official REP is no problem, but I had to play with the patches, as the version of the program is a bit outdated. Looking for instructions for installing from source, but under Ubuntu it was very damp and was faced with the same problems. And then decided to take up an official documentation, which wrote about the need to put in General regardless of the distribution.
Decided to share gain experience in installing cacti 0.8.8 f (the latest version) under Ubuntu 14.04.
Install necessary packages.
the
root@cacti:~# apt-get install apache2 php5 php5-mysql php5-snmp-snmp php5-gd rrdtool mysql-server php5-ldap zip unzip
Next check, or we have everything you need for robots cacti php modules. There should be at least seven.
the
root@cacti:~# php -m | egrep '^(mysql|snmp|xml|session|sockets|ldap|gd)$'
gd
ldap
mysql
session
snmp
sockets
xml
All needed modules are there. Now download the source code of cacti and unpack to a local folder. At the moment, is the version 0.8.8 f.
the
root@cacti:~# wget http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz
root@cacti:~# tar xzvf cacti-0.8.8f.tar.gz
Proceed to the preparation of the mysql database. To begin, create the database.
the
root@cacti:~# mysqladmin -p-u root create cacti
Enter password:
The next thing you need to fill the structure of the newly created cacti database.
the
root@cacti:~# mysql -p-u root cacti < cacti-0.8.8 f/cacti.sql
Enter password:
And add a user with rights to administer.
the
root@cacti:~# mysql -p-u root-e 'GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY "your_password"; flush privileges;'
Enter password:
Work with the database completed, it now remains to write settings of the connection to the database in the configuration of cacti.
the
root@cacti:~# vim cacti-0.8.8f/include/config.php
...
$database_type = "mysql";
$specify database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "your_password";
$database_port = "3306";
$database_ssl = false;
...
Next transfer the pages to the cacti folder to /var/www (in the folder where will be stored the source code of the site) and set the owner and group www-data (the user running the web server).
the
root@cacti:~# rsync -aP cacti-0.8.8 f/ /var/www/cacti/
root@cacti:~# chown-R www-data:www-data /var/www/cacti
Still need to add cron job for poller-a and put him right in the performance.
the
root@cacti:~# echo'*/5 * * * * www-data php /var/www/cacti/poller.php > /dev/null 2>&1' > /etc/cron.d/cacti
root@cacti:~# chmod +x /var/www/cacti/poller.php
Check/change the default directory of apache,
the
root@cacti:~# cat /etc/apache2/sites-enabled/000-default.conf | grep DocumentRoot
DocumentRoot /var/www
The final touch to restart the web server.
the
root@cacti:~# /etc/init.d/apache2 restart
* Restarting web server apache2 ... waiting [ OK ]
Subsequent installation of cacti will go through the web interface at the link http://<server_ip>/cacti/.
When moving, you should see the following picture.

Read and click Next. Now we ask, what we want to do is to update or install of cacti. In our case – set. Select and click Next.

You should now see and edit (if necessary) the paths to rrdtool, php, snmp etc.

If everything is good – we press on and look for a successful completion of the installation of cacti.

Now, enter the username and password the default is admin/admin and you just need to change the default password.

After the introduction of a new password you will be taken in the cacti GUI. Now cacti is ready to work.
Next install the spine poller under cacti 0.8.8 f. Download and raspaculo to a local folder.
the
root@cacti:~# wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8f.tar.gz
root@cacti:~# tar xzvf cacti-spine-0.8.8f.tar.gz
Set to compile and work packages.
the
root@cacti:~# apt-get install libmysqlclient-dev libsnmp-dev libtool make automake
Compiled.
the
root@cacti:~# cd cacti-spine-0.8.8 f
root@cacti:~/cacti-spine-0.8.8 f# aclocal
root@cacti:~/cacti-spine-0.8.8 f# libtoolize --force
root@cacti:~/cacti-spine-0.8.8 f# autoheader
root@cacti:~/cacti-spine-0.8.8 f# autoconf
root@cacti:~/cacti-spine-0.8.8 f# automake
root@cacti:~/cacti-spine-0.8.8 f# ./configure
root@cacti:~/cacti-spine-0.8.8 f# make
root@cacti:~/cacti-spine-0.8.8 f# make install
make[1]: Entering directory `/home/vagrant/cacti-spine-0.8.8 f'
test-z "/usr/local/spine/bin" || /bin/mkdir -p "/usr/local/spine/bin"
/bin/bash ./libtool --mode=install /usr/bin/install-c spine '/usr/local/spine/bin'
libtool: install: /usr/bin/install-c spine /usr/local/spine/bin/spine
test-z "/usr/local/spine/etc" || /bin/mkdir -p "/usr/local/spine/etc"
/usr/bin/install-c-m 644 spine.conf.dist '/usr/local/spine/etc'
make[1]: Leaving directory `/home/vagrant/cacti-spine-0.8.8 f'
From the resulting output shows that the binary spin-a lies on the path /usr/local/spine/bin/spine and the configuration has to be here — /usr/local/spine/etc/spine.conf.dist. So cacti can use it, you need to rename and edit the spine.conf and set the path to the spine in the GUI. To start, rename the configuration file and add access to the database.
the
root@cacti:~/cacti-spine-0.8.8 f# mv /usr/local/spine/etc/{spine.conf.dist spine.conf}
root@cacti:~/cacti-spine-0.8.8 f# vim /usr/local/spine/etc/spine.conf
...
DB_Host localhost
DB_Database cacti
DB_User cactiuser
DB_Pass your_password
DB_Port 3306
...
Now check spine configuration from the console.
the
root@cacti:/usr/local/spine/bin# cd /usr/local/spine/bin/
root@cacti:/usr/local/spine/bin# ./spine -V 5-R
If you don't get a single line of output – it means problems with access to the database (review the configuration of the spine.conf).
Now we have to set the path to spine and to choose as the poller by default. Login to the web interface of cacti and go to Configuration -> Settings -> Paths or direct link http://<server_ip>/cacti/settings.php?tab=path, write the path of the spine (in our case /usr/local/spine/bin/spine) and save all.

We have to activate a new type of poller. Go to the tab and select the spine Poller.

Save, wait 5-10 minutes and watch the logs for errors Utilities - > System Utilities - > View Cacti Log File.

As you can see, there is no problem and all data is normally updated by a new method, spine.
In cacti version 0.8.8 f continues to be a problem with 64-bit counters for the 95th Percentile and Total Bandwidth graphs. To fix it, you need to add a new template. I once found and downloaded on the cacti forum, but where exactly – can't find. Can download it SDAs.
Now it just need to add in cacti. Go to Import/Export - > Import Templates or the link http://<server_ip>/cacti/templates_import.php, select the file and click Import.

And get this result.

Now, when you create graphs on statistics of the network interfaces we will have In/Out Bits with 95th Percentile (64-bit Counters) and In/Out Bits with Total Bandwidth (64-bit Counters).

Lastly, add the aggregate and weathermap plugins.
Aggregate. This plugin is used in cacti to combine multiple schedules in one. For example, if you want to see how many incoming and outgoing traffic generates all the CDN as a whole, not the individual server.
Go to the folder with the cacti aggregate plugin and download the latest version.
the
root@cacti:~/cacti-spine-0.8.8 f# cd /var/www/cacti/plugins/
root@cacti:/var/www/cacti/plugins# wget http://docs.cacti.net/_media/plugin:aggregate-v0.75.tgz the-O aggregate-v0.75.tgz
Raspokovat and deleted files, also don't forget to change the owner and group for all files.
the
root@cacti:/var/www/cacti/plugins# tar xzvf aggregate-v0.75.tgz
aggregate/setup.php
aggregate/aggregate_functions.php
aggregate/color_templates_items.php
aggregate/aggregate.php
aggregate/color_templates.php
aggregate/README
aggregate/aggregate_manual.pdf
aggregate/LICENSE
aggregate/color_html.php
root@cacti:/var/www/cacti/plugins# rm aggregate-v0.75.tgz
root@cacti:/var/www/cacti/plugins# chown-R www-data:www-data aggregate/
Now we have to go to the web interface, install and activate the plugin.
Go to Configuration - > Plugin Management and click on the arrow in the Actions field opposite the Aggregate plugin to install.

Then click on the green arrow to activate.

The plugin is activated. How to use it can see in the attached source code in manual.
Weathermap. This plugin is used in cacti to build a network map, with visualization of all network hops and download channels. There are a lot of articles with descriptions and examples, therefore, we consider only the installation and activation.
Go to the folder with cacti plugins weathermap and download the files.
the
root@cacti:/var/www/cacti/plugins# wget http://network-weathermap.com/files/php-weathermap-0.97c.zip
Raspokovat and deleted files.
the
root@cacti:/var/www/cacti/plugins# unzip php-weathermap-0.97c.zip
root@cacti:/var/www/cacti/plugins# rm php-weathermap-0.97c.zip
Change the owner and group to all files and turn on visual editor weathermap.
the
root@cacti:/var/www/cacti/plugins# chown-R www-data:www-data weathermap/
root@cacti:/var/www/cacti/plugins# vim weathermap/editor.php
...
$ENABLED=true;
...
Now we just need to go to the web interface and activate the plugin.
Go to Configuration - > Plugin Management and click on the arrow in the Actions field opposite the Weathermap plugin to activate.

The plugin is activated. How to use can watch on the official pages of the project.
It remains only to add hosts to monitor them.
Комментарии
Отправить комментарий