search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Linux Server, Virtual Machine Manager | 23 Comments | 29,526 views | 15/08/2011 01:23

First part, we installed required components for Cacti. In this part, we’ll install and configure Cacti.

After MySQL installation, first we should set MySQL root password.

1
2
mysqladmin --user=root password p@ssw0rd!
mysqladmin --user=root --password reload

Let’s download latest Cacti release.

1
2
cd /home
wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz

Untar tar ball.

1
2
tar -zxvf cacti-0.8.7g.tar.gz
cd cacti-0.8.7g

Create the MySQL database for Cacti. You have to type your root password to create database.

mysqladmin --user=root create cacti --password

Import the default Cacti database.

mysql -u root -p cacti < cacti.sql

Create a MySQL username and password for Cacti for security reasons.

1
2
3
4
mysql -u root -p mysql
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipass!';
flush privileges;
exit

Edit “include/config.php” and specify the database type, name, host, user and password for your Cacti configuration.

nano include/config.php
$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “cactipass!”;

Move Cacti files into /var/www/html for web access.

1
2
cd /home
mv /home/cacti-0.8.7g /var/www/html/cacti

Go into Cacti directory and set the appropriate permissions for graph/log generation.

1
2
cd /var/www/html
chown -R apache:apache cacti

Add a line to your ”/etc/crontab” file.

nano /etc/crontab
*/5 * * * * cactiuser /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1

Disable SeLinux to web restrictions.

nano /etc/sysconfig/selinux
SELINUX=disabled

Reboot your server to apply changes. After reboot, go to php.ini configuration and change timezone.

nano /etc/php.ini
date.timezone = “Europe/Istanbul”

We finished Cacti installation. Now go to your web browser and connect to http://yourserverip/cacti.

Choose “New Install” and click next.

Correct RRDTool default path.

RRDTool Binary Path: /usr/local/rrdtool/bin/rrdtool

Now Cacti is online!

You can login to Cacti with default username and password. After your first login, you should change password.

username: admin
password: admin

Now you can start adding your graphs :)


Posted in Linux Server, Virtual Machine Manager | 14 Comments | 30,637 views | 14/08/2011 16:22

Cacti is one of the best snmp based monitoring software. I’ll show you how to install and configure it on Hyper-V.
I’ve already posted couple of articles about CentOS 6 installation on Hyper-V, so I won’t mention about that again.

You can see CentOS 6 installation on Hyper-V at the following posts:

So I assume you have a CentOS 6 with Hyper-V LIS v3.1. So lets continue with Cacti installation.
Cacti requires that the following software is installed on your system.

1. Apache
2. PHP 5.x
3. MySQL 5.x
4. RRDTool 1.2.x

It’s time to install Apache on CentOS 6.

yum install httpd

Type “y” and press Enter to accept installation.

Now, start the Apache/httpd.

1
2
chkconfig httpd on
service httpd start

Now let’s install PHP.

yum install php php-mysql php-snmp php-xml

Type “y” and press Enter to accept installation.

Now we will install MySQL.

yum install mysql mysql-server

Type “y” and press Enter to accept installation.

Now, start the MySQL/mysqld.

1
2
chkconfig mysqld on
service mysqld start

It’s time to install last component, RRDTools. First, we need to install required dependencies.

yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel

Type “y” and press Enter to accept installation.

Install gcc to compile RRDTool.

yum install gcc

Type “y” and press Enter to accept installation.

Download latest RRDTool.

1
2
cd /opt/
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz

Untar tar ball.

1
2
tar -zxvf rrdtool-1.4.5.tar.gz
cd rrdtool-1.4.5

You need to set PKG_CONFIG_PATH.

PKG_CONFIG_PATH=/usr/lib/pkgconfig/

Now let’s configure and install RRDTool.

1
2
3
./configure
make
make install

After installation is completed, let’s test RRDTool.

1
2
3
4
cd /usr/local/rrdtool/share/rrdtool/examples/
./stripes.pl
ls -l
cp stripes.png /var/www/html/

Lets see our test graph:

We finished installation of required components for Cacti. Next part, we will see how to install and configure Cacti.

You can continue with Part 2: