Install CACTI Centos

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 <root@localhost> (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

<Directory /usr/share/cacti/>
        Order Deny,Allow
        Deny from all
        Allow from 10.0.0.0/8
</Directory>

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.

How do I configure SNMP data collection?

SNMP can be used to monitor server traffic. Once installed login to cacti.
=> Click on Devices

=> Select Localhost

=> Make sure SNMP options are selected as follows:

Fig.01: SNMP configuration

Fig.01: SNMP configuration

Finally, click on Save button.

How do I create SNMP graphs?

Click on “Create Graphs for this Host” link on top right side.

Select SNMP – Interface Statistics

Select a graph type (such as In/Out bytes with total bandwidth)

Finally, click on Create button.

How do I view graphs?

To view graphs click on Graphs tab. Here is sample graph from one my own box:

 

Fig.02: Cacti in Action - Memory, CPU and Network Usage

Fig.02: Cacti in Action – Memory, CPU and Network Usage

Courtesy: www.cyberciti.biz/faq/fedora-rhel-install-cacti-monitoring-rrd-software/

Repair mysql Tables using Mysqlcheck

This happened when my cacti crashed after a power failure.

 

Repair a table inside database

This will repair host table in cacti databse

# mysqlcheck -r cacti host -u root -p

The following checks, optimizes and repairs all the corrupted table in cacti database.

# mysqlcheck -u root -p --auto-repair -c -o cacti

Check All Tables and All Databases

To check all the tables and all the databases use the “–all-databases” along with -c option as shown below.

# mysqlcheck -c  -u root -p --all-databases
Enter password:

Additional Useful Mysqlcheck Options

The following are some of the key options that you can use along with mysqlcheck.

  • -A, –all-databases Consider all the databases
  • -a, –analyze Analyze tables
  • -1, –all-in-1 Use one query per database with tables listed in a comma separated way
  • –auto-repair Repair the table automatically it if is corrupted
  • -c, –check Check table errors
  • -C, –check-only-changed Check tables that are changed since last check
  • -g, –check-upgrade Check for version dependent changes in the tables
  • -B, –databases Check more than one databases
  • -F, –fast Check tables that are not closed properly
  • –fix-db-names Fix DB names
  • –fix-table-names Fix table names
  • -f, –force Continue even when there is an error
  • -e, –extended Perform extended check on a table. This will take a long time to execute.
  • -m, –medium-check Faster than extended check option, but does most checks
  • -o, –optimize Optimize tables
  • -q, –quick Faster than medium check option
  • -r, –repair Fix the table corruption

benefits of cloud computing

 

logo (1)

I have been managing in house Linux, mac and Windows servers for various clients for years . different clients need different features with low cost .

 

After introducing myself into the world of Cloud Storage , I am doing SaaS and cloud storage effectively. I prefer doing cloud storage in local geographic locations as it becomes hard to get initial data of 500GB offsite.

these are the benefits of cloud computing i have found

  • Maintain easy access to your information with minimal upfront cost. Pay as you go (monthly or yearly), based on demand.
  • There’s no need to spend big money on hardware, data center, software or licensing fees.
  • Stretch and grow without the need to buy expensive software licenses or programs. (normal cloud SaaS license is something like 1-5 users)
  • You can change direction without serious “people” or “financial” issues at stake. – that improve flexibility
  • You have access anytime, anywhere, making your life so much easier! (as long as you are online)
  • increase volume output or productivity with fewer people. Your cost per unit or project
  • Software updates and renewals are also handled by the cloud vendor and occur several times a year at no cost to the customer.
  • on-premise solutions require 2-3 years to implement but cloud solution will only take 2-3 months.  Not only is implementation time reduced, but the IT resources required to roll-out cloud solutions are much less.
  • With cloud deployments, capacity and location planning are no longer in the hands of the customer, but are the responsibility of the cloud vendor.  This allows companies to respond quickly to any business changes that may arise unexpectedly
  • SECURITY: One of the top concerns of cloud skeptics is the fear of sacrificing data security when allowing company data to exist outside the internal firewall. well with proper Encryption methods, user policies and regular security audits.  So no more worrying about lost laptops with confidential data and hacking threats.
  • Since all your data is stored in the cloud, backing it up and restoring the same is relatively much easier than storing the same on a physical device.

www.soleclouds.com  and SaaS service on www.radonit.com

 

graph exim mail count on cacti

this was a tough thing as i failed to configure exim to publish via SNMP

i have setup a cronjob to run below command

*/1 * * * * echo “exim_queue:$(/usr/sbin/exim -bpc)” > /tmp/exim_stat

Then i got cacti to graph the exim stat  as data input method – script

ssh -q -x user@host.com  “cat /tmp/exim_stat”

 

Install yum-skip-broken

Install yum-skip-broken

Type the following command as root user:
# yum -y install yum-skip-broken

 

 

How to handle skiping packages with dependency problems

Now type the command as follows:
# yum -y upgrade --skip-broken
OR
# yum -y update --skip-broken

WP Twitter Auto Publish Powered By : XYZScripts.com