Installing Cacti on Solaris
=================================
1. INTRODUCTION
1.1 Disclaimer
Use the information in this document at your own risk. I disavow any
potential liability for the contents of this document. Use of the
concepts, examples, and/or other content of this document is
entirely at your own risk.
All copyrights are owned by their owners, unless specifically noted
otherwise. Use of a term in this document should not be regarded as
affecting the validity of any trademark or service mark.
Naming of particular products or brands should not be seen as
endorsements.
You are strongly recommended to take a backup of your system before
major installation and backups at regular intervals.
1.2 Software Versions
In my case, I have been able to install Cacti on a Solaris host
using the software versions listed below. It does not mean you
should use those versions. Version numbers are provided as a
reference.
- I suppose Cacti should work fine on Solaris x86 as well.
- I have installed the "Developer System Support" configuration
(64-bit)
3. INSTALL SUNFREEWARE PACKAGES
Solaris does not provide a C compiler, so it is necessary to install
some development tools. I recommend to install at least the
following packages from http://www.sunfreeware.com/. Be sure to pick
the packages that have been compiled for your OS version and
architecture.
Solaris provides a version of Perl (/usr/bin/perl), but I prefer to
install mine. In my case, I have compiled 5.8.5 from
http://perl.org/ and installed it on /opt/perl:
$ rm -f config.sh Policy.sh
$ sh Configure -Dprefix=/opt/perl -des
$ make
$ make test
# make install
6. INSTALL RRDTOOL (1.0.49)
Download RRDtool from
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/ and:
$ sh configure --prefix=/opt/rrdtool
$ make
# make install
7. INSTALL APACHE (2.0.52)
Download Apache from http://www.apache.org/ and:
$ configure --prefix=/opt/apache --enable-so
$ make
# make install
(Optional) I have edited my /opt/apache/conf/httpd.conf so:
User cacti
Group cacti
ServerName 'hostname'
ServerRoot /opt/cacti/cacti-0.8.6b
Notes:
- 'hostname' can be the real hostname.
- /opt/cacti/cacti-0.8.6b is the path where Cacti is going to be
installed.
8. INSTALL MYSQL (4.1.7)
First of all, you need to create a group and a user for MySQL:
# groupadd -g 101 mysql
# useradd -u 101 -g mysql -s /usr/bin/bash -d
> /export/home/mysql -m mysql
# passwd mysql
Download MySQL from http://www.mysql.com/ and:
$ ./configure --prefix=/opt/mysql
$ make
# make install
# cp support-files/my-large.cnf /etc/my.cnf
# cd /opt/mysql
# bin/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql var
# chgrp -R mysql .
- If you 'make clean', be careful because there is a bug in MySQL.
'make clean' does not remove the file sql/lex_hash.h and it
should be removed by hand.
9. INSTALL LIBXML2 (2.6.16)
PHP 5 requires a recent version of libxml2. The version that comes
with Solaris 9 is too old. Download it from http://xmlsoft.org/ and:
$ ./configure --prefix=/opt/libxml2
$ make
# make install
10. INSTALL ZLIB (1.2.1)
zlib is also required by PHP 5. Download it from
http://www.gzip.org/zlib/ and:
$ ./configure --prefix=/opt/zlib
$ make
# make install
11. INSTALL PHP (5.0.2)
I have not been able to compile PHP 5 with SNMP support, it is in my
'to do' list. If you do not have PHP support activated Cacti will use
NET-SNMP instead.
Download PHP from http://www.php.net/ and:
$ ./configure --with-apxs2=/opt/apache/bin/apxs
> --with-mysql=/opt/mysql --prefix=/opt/php
> --with-libxml-dir=/opt/libxml2 --with-zlib=/opt/zlib
$ make
# make install
You have to add several lines to your Apache configuration file
(/opt/apache/conf/httpd.conf):
$ /opt/net-snmp/bin/snmpget -v 1 -c community
> localhost sysUpTime.0
13. INSTALL CACTI (0.8.6b)
Once you have installed all the required components you can follow
chapter 2 of Cacti documentation (Installing Under Unix).
Note:
- If you try to execute 'php poller.php' directly in the crontab is
not going to work because php can not find all the dynamic
libraries needed. The simplest solution is to have in the crontab: