歡迎您光臨本站 註冊首頁

linux cacti

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0
Chapter 2. Installing Under Unix
Please make sure, the following packages are installed according to your operating systems requirements. Verify, that
httpd and mysqld are started at system startup.
2.1. Required Packages for RPM-based Operating Systems
• httpd
• php
• php-mysql
• php-snmp
• mysql
• mysql-server
• net-snmp
2.2. Ports for FreeBSD
• www/apache2
• net/rrdtool
• net/net-snmp
• www/php4-cgi
• lang/php4 (With MySQL and SNMP Support)
• databases/mysql323-server
2.3. Configure PHP
Please find the file /etc/php.ini and make the following changes to it:
extension_dir = /etc/php.d
This will enable PHP to find more configuration directives in that very directory.
Activate the MySQL extension via /etc/php.d/mysql.ini
; Enable mysql extension module
extension=mysql.so
Activate the SNMP extension via /etc/php.d/snmp.ini
; Enable snmp extension module
extension=snmp.so
If using PHP 4.3.5 or less include the following line. If using 4.3.6 or greater, you should remove this line if present.
session.save_path=/tmp
If you want to allow template importing, uncomment the following line:
file_uploads = On
2.4. Configure the Webserver (Apache)
If you are using Apache 1.3.x, installation of PHP 5 is not recommended.
Please find the file /etc/httpd/conf/httpd.conf or equivalent and make the following changes to it:
# Load config files from the config directory "/etc/httpd/conf.d".
2
Chapter 2. Installing Under Unix
Include conf.d/*.conf
Now, please locate the PHP configuration file at /etc/httpd/conf.d/php.conf
If using PHP 5, then add the following lines.
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
LoadModule php5_module modules/libphp5.so


#
# Cause the PHP interpreter to handle files with a .php extension.
AddHandler php5-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
DirectoryIndex index.php
2.5. Configure MySQL
Set a password for the root user
shell> mysqladmin --user=root password somepassword
shell> mysqladmin --user=root --password reload
2.6. Install and Configure Cacti
1. Extract the distribution tarball.
shell> tar xzvf cacti-version.tar.gz
2. Create the MySQL database:
shell> mysqladmin --user=root create cacti
3. Import the default cacti database:
shell> mysql cacti < cacti.sql
4. Optional: Create a MySQL username and password for Cacti.
shell> mysql --user=root mysql
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 』somepassword』;
mysql> flush privileges;
5. Edit include/config.php and specify the database type, name, host, user and password for your Cacti configuration.
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cacti";
6. Set the appropriate permissions on cacti』s directories for graph/log generation. You should execute these commands
from inside cacti』s directory to change the permissions.
shell> chown -R cactiuser rra/ log/
(Enter a valid username for cactiuser, this user will also be used in the next step for data gathering.)
7. Add a line to your /etc/crontab file similar to:
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
Replace cactiuser with the valid user specified in the previous step.
Replace /var/www/html/cacti/ with your full Cacti path.
8. Point your web browser to:
http://your-server/cacti/
Log in the with a username/password of admin. You will be required to change this password immediately.


Make sure to fill in all of the path variables carefully and correctly on the following screen.
3
Chapter 2. Installing Under Unix
2.7. (Optional) Install and Configure Spine
Spine is a very fast poller engine, written in C. It is an optional replacement for cmd.php. If you decide to use it, you
will have to install it explicitely. It does not come with cacti itself.
The easiest way is to install Spine using rpm or ports. You will find packages for Spine at the main cacti site or from
your distribution.
To compile Spine, please download it to any location of your liking. Then, please issue from the downloaded directory
following commands
shell>aclocal
shell>libtoolize --force (glibtoolize --force on Max OS)
shell>autoheader
shell>autoconf
shell>automake
shell>./configure
shell>make
shell>make install
Assuming, you』ve managed to install Spine correctly, you will have to configure it. The configuration file may be
placed in the same directory as Spine itself or at /etc/Spine.conf.
DB_Host 127.0.0.1 or hostname (not localhost)
DB_Database cacti
DB_User cactiuser
DB_Password cacti
DB_Port 3306
All other pre 0.8.6 settings are obsolete.
2.8. Apply Patches
Please visit the Cacti website at http://www.cacti.net/download_patches.php If any patch has been released, you
will find installation instructions there.
As an example, please find patch installation instructions for cacti 0.8.6j here. Do not apply those patches to recent
releases!
wget http://www.cacti.net/downloads/patches/0.8.6j/ping_php_version4_snmpgetnext.patch
wget http://www.cacti.net/downloads/patches/0.8.6j/tree_console_missing_hosts.patch
wget http://www.cacti.net/downloads/patches/0.8.6j/thumbnail_graphs_not_working.patch
wget http://www.cacti.net/downloads/patches/0.8.6j/graph_debug_lockup_fix.patch
wget http://www.cacti.net/downloads/patches/0.8.6j/snmpwalk_fix.patch


patch -p1 -N < ping_php_version4_snmpgetnext.patch
patch -p1 -N < tree_console_missing_hosts.patch
patch -p1 -N < thumbnail_graphs_not_working.patch
patch -p1 -N < graph_debug_lockup_fix.patch
patch -p1 -N < snmpwalk_fix.patch
You might need to reapply file/folder security on the files patched. Double check they are correct.


[火星人 ] linux cacti已經有426次圍觀

http://coctec.com/docs/linux/show-post-52901.html