Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Graphite ====== The installation consists of two parts * Setting up the graphite monitoring engine * Configuring to feed xAP ===== Introduction ===== Where as cacti uses a __pull__ mechanism to reach out and gather statistics which requires something to cache previous values until the cacti back-end is ready to get them. Graphite on the other hand uses a __push__ mechanism which is much simpler. It also means that as new xAP data elements are created they are automatically fed into your charts with zero additional work, unlike cacti which requires lots of extra effort for each new item you want to store and graph. Its the preferred charting solution for xAP data. {{:livebox:graphitexap.png?direct&640|}} ===== Setting up Graphite ===== What is Graphite? http://graphite.wikidot.com/ The documentation for graphite: http://graphite.readthedocs.org/ Its suggested that you designate a new VM/Server as the graphite monitoring and graphing resource. These instructions have been tested on a RedHat Enterprise Linux/CentOS 6.3 and 6.5 x64 server. You're mileage may vary with other Operating system hosts. ===== Pre requisites ===== First first thing we need to do configure EPEL, a public domain software repository library that contains many of the RPM already pre-built that are required. <code> # rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm </code> ====== Graphite installation ====== We need these packages: * python-carbon.noarch : Back-end data caching and persistence daemon for Graphite * graphite-web.noarch : A Django webapp for enterprise scalable realtime graphing * mysql * mysql-server * MySQL-python <code> # yum install python-carbon graphite-web mysql mysql-server MySQL-python </code> Start up mysql and setup a root password. <code> # service mysqld start # /usr/bin/mysql_secure_installation </code> Configure graphite to use the MySQL database within the /etc/graphite-web/local_settings.py config file. /etc/graphite-web/local_settings.py <code> DATABASES = { 'default': { 'NAME': 'graphite', 'ENGINE': 'django.db.backends.mysql', 'USER': 'graphite', 'PASSWORD': 'secret', 'HOST': 'localhost', 'PORT': '3306', } } </code> Create graphite database <code> # mysql -e "CREATE USER 'graphite'@'localhost' IDENTIFIED BY 'secret';" -u root -p # mysql -e "GRANT ALL PRIVILEGES ON graphite.* TO 'graphite'@'localhost';" -u root -p # mysql -e "CREATE DATABASE graphite;" -u root -p # mysql -e 'FLUSH PRIVILEGES;' -u root -p </code> Setup the graphite database with a schema <code> /usr/lib/python2.6/site-packages/graphite/manage.py syncdb </code> Restart apache. <code> # chkconfig httpd on # service httpd restart </code> If all goes well you can point your browser at your graphite VM and you should be rewarded with the graphite home page. Start carbon daemons <code> # chkconfig carbon-cache on # service carbon-cache start </code> ====== xAP Applet configuration ====== The sample applet that can feed data to a Carbon data aggregator is called [[http://code.google.com/p/livebox-hah/source/browse/branches/portable/userapps/hah/xap-plugboard/samples/graphiteApplet.lua|graphiteApplet.lua]] and can be found in the plugboard samples directory. The only change required is to adjust the IP address to that of your graphite server. <code lua> graphite={port=2003,host="192.168.4.46"} </code> Copy the sample to the /etc/plugboard directory, edit, then restart the plugboard engine <code> /etc/init.d/xap restart plugboard </code> By default the applet will feed all xAPBSC.event data items to the back-end for recording and charting, along with the [[http://www.xapautomation.org/index.php?title=xAP_Weather_Schema|weather.data]] schema. Adjust the code to suit your environment. {{tag>graphite}} livebox/graphite.txt Last modified: 2014/10/01 03:05by brett