Wednesday, May 16, 2012

Configure the network card in Linux


Red hat Linux provides following tools to make changes to Network configuration such as add new card, assign IP address, change DNS server etc.
[a] GUI tool (X Windows required) - system-config-network
[b] Command line text based GUI tool (No X Windows required) - system-config-network
[c] Edit configuration files stored in /etc/sysconfig/network-scripts/ directory.
Following instructions are compatible with
(1) Cent OS Linux
(2) Fedora Core Linux
(3) Red Hat Enterprise Linux (RHEL) 3/4/5
Method # 1: GUI tool system-config-network
Type the following command at shell prompt (open x terminal):
$ system-config-network &
Red hat enterprise Linux 5 configure the network card - system-config-network
You will see Window as above. Now select your Ethernet card (eth0 or eth1) and click on Editbutton. You can now setup IP address, netmask, default gateway and other properties.
setup IP address, netmask, default gateway and other properties
You can obtain IP address using DHCP or setup manually. Once IP address assigned, click onOk button to save the changes. You can activate card by clicking on Activate button.

Method # 2: Command line tool system-config-network-tui

If you don’t have X windows GUI installed type the following command at shell prompt:
# system-config-network-tui &
Command line tool system-config-network-tui
(click to enlarge image)
You will see text based GUI as above. Select your Ethernet card (eth0 or eth1) and hit [Enter] or [F12] special key.
Cent OS, Fedora Core, RHEL configure the network card - system-config-network-tui
(click to enlarge image)
You can obtain IP address using DHCP or setup manually. Once IP address assigned, click onOk button to save the changes

Method #3: Edit configuration files stored in /etc/sysconfig/network-scripts/

You can configure network card by editing text files stored in /etc/sysconfig/network-scripts/directory. First change directory to /etc/sysconfig/network-scripts/:
# cd /etc/sysconfig/network-scripts/
You need to edit / create files as follows:
  • /etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file
  • /etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file
To edit/create first NIC file, type command:
# vi ifcfg-eth0
Append/modify as follows:

# Intel Corporation 82573E Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:30:48:56:A6:2E
IPADDR=10.10.29.66
NETMASK=255.255.255.192
ONBOOT=yes
Save and close the file. Define default gateway (router IP) and hostname in /etc/sysconfig//network file:
# vi /etc/sysconfig/network
Append/modify configuration as follows:
NETWORKING=yes
HOSTNAME=www1.nixcraft.in
GATEWAY=10.10.29.65
Save and close the file. Restart networking:
# /etc/init.d/network restart
Make sure you have correct DNS server defined in /etc/resolv.conf file:
# vi /etc/resolv.conf
Setup DNS Server as follows:
nameserver 10.0.80.11
nameserver 10.0.80.12
nameserver 202.67.222.222
Save and close the file. Now you can ping the gateway/other hosts:
$ ping 10.0.80.12
Output:
PING 10.0.80.12 (10.0.80.12) 56(84) bytes of data.
64 bytes from 10.0.80.12: icmp_seq=1 ttl=251 time=0.972 ms
64 bytes from 10.0.80.12: icmp_seq=2 ttl=251 time=1.11 ms
You can also check for Internet connectivity with nslookup or host command:
$ nslookup cyberciti.biz
Output:
Server:         10.0.80.11
Address:        10.0.80.11#53
Non-authoritative answer:
Name:   cyberciti.biz
Address: 75.126.43.232
You can also use host command:
$ host nixcraft.in
Output:
nixcraft.in has address 75.126.43.232
nixcraft.in mail is handled by 10 mail.nixcraft.in.

Thursday, May 10, 2012

Mysql Crash Recovery

Possible solution to mailbox stopped mysql.server not running

From Zimbra :: Wiki

Jump to: navigation, search

Contents

[hide]

Mysql Crash Recovery

In the event of database corruption it may be necessary to manually perform database recovery. See Bug 15797 for an example of an issue with mysql that will require database recovery. In that example, a warning message like the following appeared in the mysql error log:
InnoDB: Serious error! InnoDB is trying to free page 716
InnoDB: though it is already marked as free in the tablespace!
InnoDB: The tablespace free space info is corrupt.
InnoDB: You may need to dump your InnoDB tables and recreate the whole
InnoDB: database!
Before beginning a full database recovery, check to see if the corruption may be limited to a single mboxgroup or a single user within an mboxgroup. This type of corruption frequently lets the server run normally for extended periods of time, with crashes occurring only when an affected user attempts to access certain mailbox items. If this is the case, it may be possible to dump, drop and recover only the affected entries without disrupting the database as a whole. Please see the instructions in the Mysql Crash Recovery (alternate method) article.

Overview of Recovery Process

  1. Configure mysql to start in recovery mode
  2. Generate SQL dumps of all relevant databases
  3. Remove all existing (and possibly corrupt) databases
  4. Re-create all databases
  5. Repopulate the databases with the data from the SQL dumps
  6. Test databases and start all ZCS services

Details of Recovery Process

1. Configure mysql to start in recovery mode

  1. Edit the file /opt/zimbra/conf/my.cnf and add a line like innodb_force_recovery = 1 under the [mysqld] section (Note that it may be necessary to increase the recovery level depending on the extent of the database corruption, as shown at the end of the database dump step)
  2. Save the file and start mysqld
mysql.server start

2. Generate SQL dumps of all databases

  1. Load some mysql configuration into shell variables (i.e. $mysql_socket and $mysql_root_password; note that you will use these again in step 3)
  2. Make a list of the existing databases
  3. Create a directory to hold the SQL dumps
  4. Generate the SQL dumps from the database list
source ~/bin/zmshutil ; zmsetvars
mysql --batch --skip-column-names -e "show databases" | grep -e mbox -e zimbra > /tmp/mysql.db.list
mkdir /tmp/mysql.sql 
for db in `cat /tmp/mysql.db.list`; do
 ~/mysql/bin/mysqldump $db -S $mysql_socket -u root --password=$mysql_root_password > /tmp/mysql.sql/$db.sql
     echo "Dumped $db"
 done
Note: If you encounter any mysql errors while dumping the databases, start over by re-editing /opt/zimbra/conf/my.cnf, incrementing the value for innodb_force_recovery by one, and restarting mysqld. The maximum recovery level is 6. Please see MySQL's Forcing InnoDB Recovery guide for more information.
Note: An error of "bash: /tmp/mysql.sql/$db.sql: ambiguous redirect" probably indicates your using an apostrophe or single quote ' rather than a tick ` -- which is one the same key as the tilde ~ .
Note: Do not reboot the machine, as some Operating Systems will remove all contents in the /tmp directory during the reboot sequence, i.e. your /tmp/mysql.sql will be removed.

3. Remove all existing (and possibly corrupt) databases

Note that we drop the zimbra database last because the mboxgroup* databases depend on it
for db in `cat /tmp/mysql.db.list |grep mbox`
do
    mysql -u root --password=$mysql_root_password -e "drop database $db"
    echo -e "Dropped $db"
done
mysql -u root --password=$mysql_root_password -e "drop database zimbra"
Remove existing InnoDB tablespace and log files
rm -rf /opt/zimbra/db/data/ib*
Note: First, use with caution - this shouldn't need to be used often. Issue came about because of some rsync issues. Can't dump db's because of 'connection' issues at this point? One could move the /opt/zimbra/db/data directory - mv /opt/zimbra/db/data /opt/zimbra/db/data-old and then make the db - mkdir /opt/zimbra/db/data w/ ownership of zimbra:zimbra . Remove the innodb_force_recovery line from /opt/zimbra/conf/my.cnf . Then recreate a default mysql db by running /opt/zimbra/libexec/zmmyinit --sql_root_pw $mysql_root_password and then attempt this steps over again to confirm you can drop them. Also note that you may have to reset the zimbra password manually in mysql, then set it again in Zimbra with the instructions from this page: http://wiki.zimbra.com/wiki/Resetting_LDAP_%26_MySQL_Passwords

4. Re-create all databases

  1. Run mysql in non-recovery mode
    1. Remove the innodb_force_recovery line from /opt/zimbra/conf/my.cnf
    2. Save the file and restart mysqld
  2. Re-create the databases from the database list
mysql.server restart
for db in `cat /tmp/mysql.db.list`
do
    mysql -e "create database $db character set utf8"
    echo "Created $db"
done

5. Repopulate the databases with the data from the SQL dumps

Import the data from the SQL dumps. Note that we import the zimbra database first because the mboxgroup databases depend on it
mysql zimbra < /tmp/mysql.sql/zimbra.sql
for sql in /tmp/mysql.sql/mbox*
do
    mysql `basename $sql .sql` < $sql
    echo -e "Updated `basename $sql .sql` \n"
done

6. Test databases and start all ZCS services

Note that this is an example query. If you know of any particular databases that were corrupt, you may want to construct other queries to verify normal access to the data.
mysql zimbra -e "select * from mailbox order by id desc limit 1"
Once you are satisfied that the databases are restored intact, start the rest of the zimbra services.
zmcontrol start
Check /opt/zimbra/log/mysql_error.log and /opt/zimbra/log/mailbox.log for database errors.

Sunday, April 22, 2012

Installing the Plugin Architecture (PIA)



The Plugin Architecture (PIA) is a set of code changes to core cacti. It is provided by Jimmy Conner (cigamit), one of the Cacti core developers. The Plugin Architecture for Cacti was designed to be both simple in nature and robust enough to allow freedom to do almost anything in Cacti. Cacti itself is designed nicely enough that integrating into it is fairly easy with very little modifications necessary. Eventually Cacti will come with a standard plugin architecture that will allow you to create addons without the need to modify your installation, but until that time comes (we are working on it) you will need to follow the directions below.
The following has been taken from the above link and updated to PIA 2.8+

Download

The first step is to download the Plugin Architecture. You can get it in either zip or gzip compressed archives.

Extract

You will need to extract this archive. On Windows there are several ways to extract zips/gzips, just use the program of your choice (ex: Winzip). Using Unix you can extract it using a command similar to this one, but your milage may vary depending on the Distribution you are running.
tar -zvxf cacti-plugin-arch.tar.gz
If all goes well, you should have a folder called cacti-plugin-arch with a few patch files and a folders in it. It does not matter in particular to where you download and extract these files to, as we will be moving just the files we need.

Installing

There are two ways of install the Plugin Architecture. The first way is by using the patch files. A patch file contains the difference between the original files and the “new” files, which makes them very small as they only contain exactly what we need to make the changes. The other way is by using the pre-patched full files. These files are the full install of the necessary files with the patch already applied to them. With these you can directly override the files already in your Cacti directory. I only include the files that are necessary to change, so you don't have to override every file in your Cacti install.

Using the Pre-Patched Files

Using the pre-patched files is easiest and most straight forward way to install the Plugin Architecture. You will of course want to backup your Cacti install first before attempting any add-on modifications. Once you have backed up your install. Goto the directory that you extracted the Plugin Architecture to. In this directory you will find several other directories. One of them will look like this “files-0.8.7g”. This is to show you that these are the pre-patched files for Cacti v0.8.7g, there may be other versions available if that is not your version.
Now you will need to determine where your original Cacti install is. For instance on Fedora Core 3, my original Cacti files are located at ”/var/www/html/”. This will vary between Distributions and of course between Linux and Windows, and it is outside the scope of this document to discover where your installation is placed. Once you have the location, remember where it is as you will need it shortly.
You will now copy the files from the “files-0.8.7g” directory to your Cacti install directory, overriding any files if you are prompted. There are several ways to copy the files over (Explorer in Windows, FTP, command line, etc…) so I will not go into that here.
From here you are done installing the Plugin Architecture, but it is necessary to configure it first before you continue using Cacti (or Cacti will probably not function properly!)

Using the Patch

Using the patch files is slightly harder that using the pre-patched files, but it is recommended for anyone that has already modified their Cacti install using other mods, or their own custom tweaks. This is mostly used on Linux/Unix etc… but can also be done on Windows if you have the appropriate tools installed. You will ofcourse want to backup your Cacti install first before attempting any add-on modifications.
Now you will need to determine where your original Cacti install is. For instance on Fedora Core 3, my original Cacti files are located at ”/var/www/html/”. This will vary between Distributions and ofcourse between Linux and Windows, and it is outside the scope of this document to discover where your installation is placed. Once you have the location, remember where it is as you will need it shortly.
Now goto the directory that you extracted the Plugin Architecture to. In this directory you will find several files with names similar to this “cacti-plugin-0.8.6f.diff”. This is a patch file that contains everything you need to install the Plugin Architecture. You will copy the file that corresponds with your Cacti version to the location of your Cacti install using a command prompt (if you weren't already using one!)
We will first run this command from the Cacti Install directory
patch -p1 -N --dry-run < cacti-plugin-arch.diff
This will not make any changes, it will only attempt to do the install and report back any errors. If you receive and FAILED errors, then you know that you will run into a few problems. These problems can usually be addressed by posting in the forums. If you have not modified your Cacti install by using any other mods, then it is usually fairly safe to override the file that “FAILED” with a pre-patched file that is also provided in the archive (See the directions above). Your config.php file will almost always fail to be patched if you have either already configured your database settings for Cacti, or you are using an RPM/DEB install (and possibly even the Windows MSI install). If so, then just override the file, and reconfigure it for your database.
To continue with the patching process, just run this command
patch -p1 -N < cacti-plugin-arch.diff
This will modify the files and report back and errors. Assuming that all went well, then you can now proceed to configuring your Cacti install.
WARNING: I just discovered a new “problem” when using patches. I received permission errors on all files, that are created from scratch by using the patch. Don't misunderstand me: the files exist and look fine, but still “permission denied”. No SELinux alerts. But I suppose it's been an issue with SELinux nevertheless. The soltion was to delete the newly created files and to copy them from the files-0.8.7g directory. This removed all permission errors.

Configuration

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 = "cactiuser";

/* load up old style plugins here */
$plugins = array();
//$plugins[] = 'thold';

/*
   Edit this to point to the default URL of your Cacti install
   ex: if your cacti install as at http://serverip/cacti/ this
   would be set to /cacti/
*/
$url_path = "/cacti/";

/* Default session name - Session name must contain alpha characters */
#$cacti_session_name = "Cacti";
The $plugins array is required for using the Plugin Architecture (PIA) only. For legacy plugins, those that must be installed in global.php, we have moved the plugins array out of global.php and into config.php. This was done to insure that global.php remains pristine. It is a file that is not intended to be modified, so with the PIA installed, you should not have to.
The variable “$url_path” has also been moved from global.php to config.php for the same reason as the plugins array. For those of you upgrading from very old Plugin Architectures you should know that in the past, we attempted to “detect” this path. However, the process was not reliable. Therefore, you have to specify that path in config.php.
If your Cacti Install is at http://servername/projects/cacti/testing/ then you would need to set the option to this
$url_path = "/projects/cacti/testing/";
It is important to note that you must include the '/' at the front and end of the location. This is to prevent other issues later down the road.

SQL

The plugin architecture includes a pa.sql file. You will need to import this into your cacti SQL database.
Once this is done, you will have successfully completed installing the Plugin Architecture. You will now want to proceed with downloading and install Plugins. You can refer to Installing Plugins to help with it.

Installing Plugins

The Plugins Repository and the Forums provide a huge list of plugins. Many of them are maintained by Cacti core developers; others are provided by different users.
There are two types of plugins today, the legacy plugins and those conforming to the 2.x architecture. Their installation process differs. All plugin authors are asked to upgrade to the PIA 2.x type of plugins.

Installation of Legacy Plugins

The first step to is to download the plugin of your choice. You can choose either the zip or gzip compressed archive. You will then need to extract this archive to a temporary location. When you extract the archive it should, depending on your archive software, create a directory with several files inside of it. We will use the Monitor Plugin as an example.

Download

Begin by downloading the Monitor plugin. After the download is complete, the filename should look something like this. monitor-0.82.zip or monitor-0.82.tar.gz

Extract

You will need to extract this archive. On Windows there are several ways to extract zips/gzips, just use the program of your choice (ex: Winzip). Using Unix you can extract it using a command similar to this one, but your milage may vary depending on the Distribution you are running.
tar -zvcf monitor-0.82.tar.gz
If all goes well, you should have a folder called monitor with a few files and possibly a few folders in it. To be sure that you are looking at the correct directory, check and make sure that you have a file called “setup.php” directly inside of your monitor folder. On Windows if you happen to end up with a parent folder called monitor-0.82 with a subfolder called monitor then you will need to ignore the parent folder and just use the subfolder.
It is extremely important that you do not alter the case or the name of this folder or the plugin will not function at all. And please make sure, that there is no second directory like e.g.monitor.old

Upload

Once you are satisfied that you are working with the correct directory, then you will need to upload this file into your Cacti install's Plugin directory. This will vary greatly depending on where you actually installed Cacti. For example, on Linux, if your Cacti files are in a directory like this. /var/www/html/cacti/ then your Plugin Directory would be here/var/www/html/cacti/plugins/ On Windows using IIS, it could be located here C:\inetpub\wwwroot\cacti\plugins\
You will need to upload/copy the complete “monitor” folder into this “plugins” folder on your web server. So that you have a structure kinda like this /var/www/html/cacti/plugins/monitor/ orC:\inetpub\wwwroot\cacti\plugins\monitor\
That takes care of the difficult part of the installation (download, uncompress, upload). Now we will just turn the newly installed plugin on.

Activate

You will now need to modify Cacti's configuration file to activate the plugin. This the same file that you had to use to configure Cacti to connect to the correct database. Using the above example, Cacti's config file would be located here /var/www/html/cacti/include/config.php or here C:\inetpub\wwwroot\cacti\include\config.php
Inside this configuration file, as you proceed down a few lines, you will find a line that looks like this
$plugins = array();
Directly after this, you may see an example line like this
//$plugins[] = 'thold';
This is in place to basically show you how to activate a plugin. The ”//” is a comment line in PHP Code which effectively disables the text directly proceeding it from being executed. What we will need to do, is to change that line to look like this
$plugins[] = 'monitor';
If the example line does not exist, then just put this directly below the
$plugins = array();
line. You may also have a few other plugins already installed, and if so your configuration file may look like this.
$plugins = array();
$plugins[] = 'thold';
$plugins[] = 'monitor';
$plugins[] = 'discovery';
It is extremely important that the name in the quotation marks is the folder name of the plugin you installed. This folder name also can not be changed from the original or the plugin will not work correctly!
For example, if you had a plugin with a folder name of “logpurge” then you would have to a configuration like this
$plugins[] = 'logpurge';
You are now completely done installing the plugin, and at this point it should have been a fairly painless process.

Configuration

A few plugins will require their own little tweaks or configuration changes to complete the installation of the Plugin. These are outside the scope of this document, as you will need to consult the individual documentation of the Plugin. But if you are stuck and can not locate the specific configuration options for a Plugin, you might try looking at the Settings link in the Console to see if any new options were added.

Removal

Removing a plugin is very simple. If you want to just disable the plugin, just remove the line from Cacti's config.php or comment it out like so
//$plugins[] = 'thold';
The ”//” is a comment line in PHP Code which effectively disables the text directly proceeding it from being executed. To completely remove the plugin, just delete the directory for the plugin from your plugins directory.

Installation of PIA 2.x-Type Plugins

This works very much like the above. The main difference is, that there's no need to change ./include/config.php. PIA will autodetect the existance of such a new plugin as soon as it is found in the ./plugins directory.

Managing Plugins

PIA 2.8+ introduces a new menu item to manage the plugins. But this menue item is not available for all users by default. It is govern by a realm permission for each user. To provide access to Plugin Management, please visit User Management and select the user in question. The Realm Permission tab will show up like Realm Permission
You may not have all the plugins listed in this image. But please make sure to have Plugin Management checked. After saving, you will find Plugin Management underneath ConfigurationPlugin Management
Selecting this new console menu item may look like: Using Plugin Management
Hitting the icons to the left will allow you to install (blue icon), enable (green icon), disable (red square) or uninstall (red circle) a plugin. You may change the load order by first selectiong the column heading Load Order and then moving plugins around using the blue arrows. You can't move around System plugins.

Cacti installation guide for Fedora and CentOS


Cacti is a network graphing tool similar to MRTG. How do I install and configure common options to collect SNMP data and various other data (such as system load, network link status, hard disk space, logged in users etc) into an RRD?

From the official project site:
Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data in a MySQL database. The frontend is completely PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti handles the data gathering. There is also SNMP support for those used to creating traffic graphs with MRTG.

Required software(s)

You need to install the following software on RHEL / Fedora / CentOS Linux:
  1. MySQL Server : Store cacti data.
  2. NET-SNMP server - SNMP (Simple Network Management Protocol) is a protocol used for network management.
  3. PHP with net-snmp module - Access SNMP data using PHP.
  4. Apache / lighttpd / ngnix webserver : Web server to display graphs created with PHP and RRDTOOL.

Install the software

First, login as root user and type the following command to install mysql, apache and php:
# yum install mysql-server mysql php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP php-mysql httpd

Configure MySQL server

First, set root password:
# mysqladmin -u root password NEWPASSWORD

Create cacti MySQL database

Create a database called cacti, enter:
# mysql -u root -p -e 'create database cacti'
Create a user called cacti with a password called zYn95ph43zYtq, enter:
# mysql -u root -p
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'zYn95ph43zYtq';
mysql> FLUSH privileges;
mysql> \q

Install snmpd

Type the following command to install net-snmpd
# yum install net-snmp-utils php-snmp net-snmp-libs
Configure snmpd, open /etc/snmp/snmpd.conf
# vi /etc/snmp/snmpd.conf
Append / modify it as follows (see snmpd.conf man page for details):
com2sec local     localhost           public
group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
view all    included  .1                               80
access MyRWGroup ""      any       noauth    exact  all    all    none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root  (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
Save and close the file. Turn on snmpd service:
# /etc/init.d/snmpd start
# chkconfig snmpd on

Make sure you are getting information from snmpd:
# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
Sample ouptut:
IP-MIB::ipAdEntIfIndex.10.10.29.68 = INTEGER: 2
IP-MIB::ipAdEntIfIndex.67.yy.zz.eee = INTEGER: 3
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1

Install cacti

First, make sure EPEL repo is enabled. Type the following command to install cacti:
# yum install cacti

Install cacti tables

Type the following command to find out cacti.sql path:
# rpm -ql cacti | grep cacti.sql
Sample output:
/usr/share/doc/cacti-0.8.7d/cacti.sql
Type the following command to install cacti tables (you need to type the cacti user password):
# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.7d/cacti.sql

Configure cacti

Open /etc/cacti/db.php file, enter:
# vi /etc/cacti/db.php
Make changes as follows:
 
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "zYn95ph43zYtq";
$database_port = "3306";
 
Save and close the file.

Configure httpd

Open /etc/httpd/conf.d/cacti.conf file, enter:
# vi /etc/httpd/conf.d/cacti.conf
You need to update allow from line. Either set to ALL or your LAN subnet to allow access to cacti:
 
#
# Cacti: An rrd based graphing tool
#
Alias /cacti    /usr/share/cacti
 

        Order Deny,Allow
        Deny from all
        Allow from 10.0.0.0/8

 
Another option is create /usr/share/cacti/.htaccess file and password protect the directory. Finally, restart httpd:
# service httpd restart

Setup cacti cronjob

Open /etc/cron.d/cacti file, enter:
# vi /etc/cron.d/cacti
Uncomment the line:
*/5 * * * *     cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
Save and close the file.

Run cacti installer

Now cacti is ready to install. Fire a webbrowser and type the url:
http://your.example.com/cacti/
OR
http://your.server.ip.address/cacti/
Just follow on screen instructions. The default username and password for cacti is admin / admin. Upon first login, you will be force to change the default password.