Important /Required Monitoring Tools/ Commands For Linux System Administrators

Hi Guys,

First of all thank you for for your love and support. In this article I’m trying to post my knowledge and experience about Linux server monitoring. As a system administrator it is essential to have good knowledge about monitoring weapons so you can keep your server calm and cool and can get better performance through it. so lets start::

The commands discussed below are some of the most basic commands when it comes to system analysis and debugging server issues such as:

  1. Finding out bottlenecks.
  2. Disk (storage) bottlenecks.
  3. CPU and memory bottlenecks.
  4. Network bottlenecks.

1: top – Display Linux tasks

top provides an ongoing look at processor activity in real time. It displays a listing of the most CPU-intensive tasks on the system, and can provide an interactive interface for manipulating processes. It can sort the tasks by CPU usage, memory usage and runtime. can be better configured than the standard top from the procps suite

Commonly Used Hot Keys

Friends, I always recommend to use all available tools/options with simple commands, so try below keys with “top” command.

Hot Key Usage
t Displays summary information off and on.
m Displays memory information off and on.
A Sorts the display by top consumers of various system resources. Useful for quick identification of performance-hungry tasks on a system.
f Enters an interactive configuration screen for top. Helpful for setting up top for a specific task.
o Enables you to interactively select the ordering within top.
r Issues renice command.
k Issues kill command.
z Turn on or off color/mono

#2: vmstat – Report virtual memory statistics

This command reports information about the kernel threads, virtual memory, disks, traps, and CPU activity.

    # vmstat 3
    Sample Outputs:

    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
     r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
     0  0      0 2540988 522188 5130400    0    0     2    32    4    2  4  1 96  0  0
     1  0      0 2540988 522188 5130400    0    0     0   720 1199  665  1  0 99  0  0
     0  0      0 2540956 522188 5130400    0    0     0     0 1151 1569  4  1 95  0  0
     0  0      0 2540956 522188 5130500    0    0     0     6 1117  439  1  0 99  0  0
     0  0      0 2540940 522188 5130512    0    0     0   536 1189  932  1  0 98  0  0
     0  0      0 2538444 522188 5130588    0    0     0     0 1187 1417  4  1 96  0  0
     0  0      0 2490060 522188 5130640    0    0     0    18 1253 1123  5  1 94  0  0
See Memory Utilization Slabinfo
    # vmstat -m
    Cache                       Num  Total   Size  Pages
    ip_conntrack_expect           0      0    136     28
    ip_conntrack               8048  11856    304     13
    ip_fib_alias                 50    118     64     59
    ip_fib_hash                  42    118     64     59
    iser_descriptors              0      0    128     30
    ib_mad                        0      0    448      8
    jbd_1k                        0      0   1024      4
    bio_map_info                100    105   1064      7
    dm_mpath                      0      0   1064      7
    jbd_4k                       26     48   4096      1
    dm_uevent                     0      0   2608      3
    dm_tio                        0      0     24    144
    dm_io                         0      0     40     92
    scsi_cmd_cache              143    170    384     10
    sgpool-128                   32     34   4096      1

#3: w – Display Logged in Sessions

we command displays information about the users currently on the machine, and their processes.

    root@linuxserverguide [~]# w
     09:17:33 up 18 days, 20:50,  1 user,  load average: 2.57, 2.61, 2.45
    USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
    root     pts/1    192.168.1.1   06:42    0.00s  0.06s  0.00s w

#4: uptime – Display system uptime

The uptime command can be used to see how long the server has been running. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.

    root@linuxserverguide [~]# uptime
    18:02:41 up 41 days, 23:42,  1 user,  load average: 0.00, 0.00, 0.00
1 can be considered as optimal load value. The load can change from system to system. For a single CPU system 1 – 3 and
SMP systems 6-10 load value might be acceptable.

#5: ps – Display Process Stats

ps command will report a snapshot of the current processes. To select all processes use the -A or -e option:

    root@linuxserverguide [~]# ps -A

    Sample Outputs:

      PID TTY          TIME CMD
        1 ?        00:00:02 init
        2 ?        00:00:02 migration/0
        3 ?        00:00:01 ksoftirqd/0
        4 ?        00:00:00 watchdog/0
        5 ?        00:00:00 migration/1
        6 ?        00:00:15 ksoftirqd/1
    ....
    .....
     4881 ?        00:53:28 java
     4885 tty1     00:00:00 mingetty
     4886 tty2     00:00:00 mingetty
     4887 tty3     00:00:00 mingetty
     4888 tty4     00:00:00 mingetty
     4891 tty5     00:00:00 mingetty
     4892 tty6     00:00:00 mingetty
     4893 ttyS1    00:00:00 agetty
    12853 ?        00:00:00 cifsoplockd
    12854 ?        00:00:00 cifsdnotifyd
    14231 ?        00:10:34 lighttpd
    14232 ?        00:00:00 php-cgi
    54981 pts/0    00:00:00 vim
    55465 ?        00:00:00 php-cgi
    55546 ?        00:00:00 bind9-snmp-stat
    55704 pts/1    00:00:00 ps

    ps is just like top but provides more information.

Show Long Format Output

    root@linuxserverguide [~]# ps -Al
    F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
    4 S     0     1     0  0  75   0 -  2592 -      ?        00:00:00 init
    1 S     0     2     1  0 -40   - -     0 migrat ?        00:00:02 migration/0
    1 S     0     3     1  0  94  19 -     0 ksofti ?        00:00:01 ksoftirqd/0
    5 S     0     4     1  0 -40   - -     0 watchd ?        00:00:00 watchdog/0
    1 S     0     5     1  0 -40   - -     0 migrat ?        00:00:01 migration/1
    1 S     0     6     1  0  94  19 -     0 ksofti ?        00:00:00 ksoftirqd/1
    5 S     0     7     1  0 -40   - -     0 watchd ?        00:00:00 watchdog/1
    1 S     0     8     1  0 -40   - -     0 migrat ?        00:00:00 migration/2

#6: free – Display Memory Usage

Please see below output carefully, you will find used and free memory by system also it shows buffered memory used by kernel.

    root@linuxserverguide [~]# free

    Sample Output:

                total       used       free     shared    buffers     cached
    Mem:      12302896    9739664    2563232          0     523124    5154740
    -/+ buffers/cache:    4061800    8241096
    Swap:      1052248          0    1052248

#7: iostat – Display Disk Activity

Friends, this is very powerful command which shows CPU avarage load and disk activity simultaneously, see the sample output below to understand it better

    root@linuxserverguide [~]# iostat

    Sample Outputs:

    Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 	06/26/2009
    avg-cpu:  %user   %nice %system %iowait  %steal   %idle
               3.50    0.09    0.51    0.03    0.00   95.86
    Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
    sda              22.04        31.88       512.03   16193351  260102868
    sda1              0.00         0.00         0.00       2166        180
    sda2             22.04        31.87       512.03   16189010  260102688
    sda3              0.00         0.00         0.00       1615          0

#8: sar – Display System Activity

The sar command is used to collect, report, and save system activity information. To see network counter, enter:

    root@linuxserverguide [~]#sar -n DEV | more
    To display the network counters from the 24th:
    
    root@linuxserverguide [~]# sar -n DEV -f /var/log/sa/sa24 | more
    You can also display real time usage using sar:
    
    root@linuxserverguide [~]# sar 4 5

    Sample Outputs:

    Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 		06/26/2009
    06:45:12 PM       CPU     %user     %nice   %system   %iowait    %steal     %idle
    06:45:16 PM       all      2.00      0.00      0.22      0.00      0.00     97.78
    06:45:20 PM       all      2.07      0.00      0.38      0.03      0.00     97.52
    06:45:24 PM       all      0.94      0.00      0.28      0.00      0.00     98.78
    06:45:28 PM       all      1.56      0.00      0.22      0.00      0.00     98.22
    06:45:32 PM       all      3.53      0.00      0.25      0.03      0.00     96.19
    Average:          all      2.02      0.00      0.27      0.01      0.00     97.70

#9: mpstat – Multiprocessor Usage

The mpstat command displays activities for each available processor, processor 0 being the first one. mpstat -P ALL to display average CPU utilization per processor:

    root@linuxserverguide [~]# mpstat -P ALL

    Sample Output:

    Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in)	 	06/26/2009
    06:48:11 PM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
    06:48:11 PM  all    3.50    0.09    0.34    0.03    0.01    0.17    0.00   95.86   1218.04
    06:48:11 PM    0    3.44    0.08    0.31    0.02    0.00    0.12    0.00   96.04   1000.31
    06:48:11 PM    1    3.10    0.08    0.32    0.09    0.02    0.11    0.00   96.28     34.93
    06:48:11 PM    2    4.16    0.11    0.36    0.02    0.00    0.11    0.00   95.25      0.00
    06:48:11 PM    3    3.77    0.11    0.38    0.03    0.01    0.24    0.00   95.46     44.80
    06:48:11 PM    4    2.96    0.07    0.29    0.04    0.02    0.10    0.00   96.52     25.91
    06:48:11 PM    5    3.26    0.08    0.28    0.03    0.01    0.10    0.00   96.23     14.98
    06:48:11 PM    6    4.00    0.10    0.34    0.01    0.00    0.13    0.00   95.42      3.75
    06:48:11 PM    7    3.30    0.11    0.39    0.03    0.01    0.46    0.00   95.69     76.89

 

How to install mod_evasive on a cPanel server

We are going to install mod_evasive to help protect our cPanel server from low end ddos attacks. The installation is really quite simple.

This module instantiates for each listener individually, and therefore has a built-in cleanup mechanism and scaling capabilities. Because of this per-child design, legitimate requests are never compromised (even from proxies and NAT addresses) but only scripted attacks. Even a user repeatedly clicking on ‘reload’ should not be affected unless they do it maliciously. mod_evasive is fully tweakable through the Apache configuration file, easy to incorporate into your web server, and easy to us.

OK, now that’s done, how do we install this thing? Pretty simple, lets log into a terminal session as root.

I always download everything to my downloads folder, so, we change to it:

    root@linuxserverguide[~] # cd downloads

Now, we need to grab the file (this is the latest version as of this post):

Of course, we now need to extract them:

    root@linuxserverguide[~/downloads] # tar zxvf mod_evasive_1.10.1.tar.gz

Now, change into the directory that was just created:

    root@linuxserverguide[~/downloads] #cd mod_evasive

Now, you can view the README file for information on how to install this on a couple of different types of servers, however, we are going to focus on installing mod_evasive on an Apache2x server. We also have cPanel running on this box, so, to install, we run the following:

    root@linuxserverguide[~/downloads] #/usr/local/apache/bin/apxs -i -a -c mod_evasive20.c

Now, that will create an entry in the httpd.conf file, and, if we want to retain that after an upgrade/rebuild, we need to tell cPanel not to take it out! Do do this, we now run this:

    root@linuxserverguide[~/downloads] # /usr/local/cpanel/bin/apache_conf_distiller –update

Now, to change the settings for mod_evasive, we need to add them in some place. All we have done so far, is install the actually module into apache, and, even with a restart, it would not be using it. So, I like to add things into my includes files through either WHM, or, directly through the terminal. To do this, we run the following:

    root@linuxserverguide[~/downloads] # vim /usr/local/apache/conf/includes/post_virtualhost_2.conf

Once the file is open, lets add in the following lines to the bottom of the file:

    <IfModule mod_evasive20.c>
    DOSHashTableSize 3097
    DOSPageCount 2
    DOSSiteCount 50
    DOSPageInterval 1
    DOSSiteInterval 1
    DOSBlockingPeriod 3600
    DOSEmailNotify root
    </IfModule>

Once done, save the file, this varies depending on your editor of choice, in VI and VIM, its :wq enter.

That’s all folks! This will help to lesson the load on your server under a mild ddos attack, or, someone just being silly and trying to increase the load on your server.

 

Install MP4Box on Linux

MP4Box is a MP4 multiplexer. It can import MPEG-4 video, DivX, XviD, 3ivx, h264 etc, audio streams and subtitles into the .mp4 container. The end result is a compliant MP4 stream. It can also extract streams from a .mp4. MP4Box is a command line tool, but can be used with graphical user interfaces such as YAMB or my MP4box GUI.

Source: http://sourceforge.net/projects/gpac/files/

 

Install other dependencies using yum

    root@linuxserverguide[~]# yum -y install freetype-devel SDL-devel freeglut-devel

Download and install gpac

    root@linuxserverguide[~]# cd /usr/local/src/

    root@linuxserverguide[~]# wget http://nchc.dl.sourceforge.net/project/gpac/GPAC/GPAC%200.4.5/gpac-0.4.5.tar.gz

    root@linuxserverguide[~]# wget http://nchc.dl.sourceforge.net/project/gpac/GPAC%20extra%20libs/
    GPAC%20extra%20libs%200.4.5/gpac_extra_libs-0.4.5.tar.gz

    root@linuxserverguide[~]# tar -zxvf gpac-0.4.5.tar.gz
    root@linuxserverguide[~]# tar -zxvf gpac_extra_libs-0.4.5.tar.gz
    root@linuxserverguide[~]# cd gpac_extra_libs
    root@linuxserverguide[~]# cp -r * /usr/local/src/gpac/extra_lib
    root@linuxserverguide[~]# cd ../gpac
    root@linuxserverguide[~]# chmod 755 configure
    root@linuxserverguide[~]# ./configure
    root@linuxserverguide[~]# make lib
    root@linuxserverguide[~]# make apps
    root@linuxserverguide[~]# make install lib
    root@linuxserverguide[~]# make install
    root@linuxserverguide[~]# cp bin/gcc/libgpac.so /usr/lib

mp4box installed successfully, you can verify it as follows

    root@linuxserverguide[~]# which MP4Box
    /usr/local/bin/MP4Box

OR

    root@linuxserverguide[~/gpac]# /usr/local/bin/MP4Box -version
    MP4Box – GPAC version 0.4.5 (build 33)
    GPAC Copyright: (c) Jean Le Feuvre 2000-2005
    (c) ENST 2005-200X

 

Getting following error while running make.

    /usr/bin/ld: cannot find -lglut
    collect2: ld returned 1 exit status

Apply following fix

    Check
    root@linuxserverguide[~]# ls /usr/lib64 |grep glut
    libglut.so.3

    root@linuxserverguide[~]# ln -s /usr/lib64/libglut.so.3 /usr/lib64/libglut.so

Install memcached with CentOS and WHM/cPanel

This guide will walk you through installing memcache and memcached on a dedicated or vps server.

For the wiki version of this guide visit: http://wiki.beyondhosting.net/Memcached_and_PHP_with_cPanel

 

    root# yum install libevent libevent-devel -y
    Open /etc/memcached.conf with your favorite editor and paste in:
    #Memory a usar
    -m 16
    # default port
    -p 11211
    # user to run daemon nobody/apache/www-data
    -u nobody
    # only listen locally
    -l 127.0.0.1
    touch /etc/init.d/memcached
    chmod +x /etc/init.d/memcached

Open /etc/init.d/memcached with your favorite editor and paste in:

    #!/bin/bash
    #
    # memcached This shell script takes care of starting and stopping
    # standalone memcached.
    #
    # chkconfig: – 80 12
    # description: memcached is a high-performance, distributed memory
    # object caching system, generic in nature, but
    # intended for use in speeding up dynamic web
    # applications by alleviating database load.
    # processname: memcached
    # config: /etc/memcached.conf
    # Source function library.
    . /etc/rc.d/init.d/functions
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    DAEMON=/usr/local/bin/memcached
    DAEMONBOOTSTRAP=/usr/local/bin/start-memcached
    DAEMONCONF=/etc/memcached.conf
    NAME=memcached
    DESC=memcached
    PIDFILE=/var/run/$NAME.pid
    [ -x $DAEMON ] || exit 0
    [ -x $DAEMONBOOTSTRAP ] || exit 0
    RETVAL=0
    start() {
    echo -n $”Starting $DESC: ”
    daemon $DAEMONBOOTSTRAP $DAEMONCONF
    RETVAL=$?
    [ $RETVAL -eq 0 ] && touch $PIDFILE
    echo
    return $RETVAL
    }
    stop() {
    echo -n $”Shutting down $DESC: ”
    killproc $NAME
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && rm -f $PIDFILE
    return $RETVAL
    }
    # See how we were called.
    case “$1″ in
    start)
    start
    ;;
    stop)
    stop
    ;;
    restart|reload)
    stop
    start
    RETVAL=$?
    ;;
    status)
    status $prog
    RETVAL=$?
    ;;
    *)
    echo $”Usage: $0 {start|stop|restart|status}”
    exit 1
    esac
    exit $RETVAL
    touch /usr/local/bin/start-memcached
    chmod +x /usr/local/bin/start-memcached

Open /usr/local/bin/start-memcached with your favorite editor and paste in:

    #!/usr/bin/perl -w
    # start-memcached
    # 2003/2004 – Jay Bonci <jaybonci@debian.org>
    # This script handles the parsing of the /etc/memcached.conf file
    # and was originally created for the Debian distribution.
    # Anyone may use this little script under the same terms as
    # memcached itself.
    use strict;
    if ($> != 0 and $< != 0) {
    print STDERR “Only root wants to run start-memcached.n”;
    exit;
    }
    my $etcfile = shift || “/etc/memcached.conf”;
    my $params = [];
    my $etchandle;
    # This script assumes that memcached is located at /usr/bin/memcached, and
    # that the pidfile is writable at /var/run/memcached.pid
    my $memcached = “/usr/local/bin/memcached”;
    my $pidfile = “/var/run/memcached.pid”;
    # If we don’t get a valid logfile parameter in the /etc/memcached.conf file,
    # we’ll just throw away all of our in-daemon output. We need to re-tie it so
    # that non-bash shells will not hang on logout. Thanks to Michael Renner for
    # the tip
    my $fd_reopened = “/dev/null”;
    sub handle_logfile {
    my ($logfile) = @_;
    $fd_reopened = $logfile;
    }
    sub reopen_logfile {
    my ($logfile) = @_;
    open *STDERR, “>>$logfile”;
    open *STDOUT, “>>$logfile”;
    open *STDIN, “>>/dev/null”;
    $fd_reopened = $logfile;
    }
    # This is set up in place here to support other non -[a-z] directives
    my $conf_directives = {
    “logfile” => &handle_logfile
    };
    if (open $etchandle, $etcfile) {
    foreach my $line (<$etchandle>) {
    $line =~ s/#.*//go;
    $line = join ‘ ‘, split ‘ ‘, $line;
    next unless $line;
    next if $line =~ /^-[dh]/o;
    if ($line =~ /^[^-]/o) {
    my ($directive, $arg) = $line =~ /^(.*?)s+(.*)/;
    $conf_directives->{$directive}->($arg);
    next;
    }
    push @$params, $line;
    }
    }
    unshift @$params, “-u root” unless (grep $_ eq ‘-u’, @$params);
    $params = join ” “, @$params;
    if (-e $pidfile) {
    open PIDHANDLE, “$pidfile”;
    my $localpid = <PIDHANDLE>;
    close PIDHANDLE;
    chomp $localpid;
    if (-d “/proc/$localpid”) {
    print STDERR “memcached is already running.n”;
    exit;
    } else {
    `rm -f $localpid`;
    }
    }
    my $pid = fork();
    if ($pid == 0) {
    reopen_logfile($fd_reopened);
    exec “$memcached $params”;
    exit(0);
    } elsif (open PIDHANDLE,”>$pidfile”) {
    print PIDHANDLE $pid;
    close PIDHANDLE;
    } else {
    print STDERR “Can’t write pidfile to $pidfile.n”;
    }

Now we start the memcached daemon. (it is ok if “shutting down memcached” says fail.)

    [root@ ~]# /etc/init.d/memcached restart
    Shutting down memcached: [ OK ]
    Starting memcached: [ OK ]

Make sure its running by:

    [root@srv01 init.d]# ps aux | grep memcached
    nobody 5966 0.5 0.3 18248 16444 pts/0 S 13:55 0:00 /usr/local/bin/me

Now we will set memcached to run at startup:

    [root@ ~]# /sbin/chkconfig memcached on
    [root@ ~]# /sbin/chkconfig –list | grep memcached
    memcached 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Now we will install the memcache plugin for PHP.
Download the latest stable version of memcache from http://pecl.php.net/package/memcache

Now open /usr/local/lib/php.ini with your favorite text editor and find the dynamic extension section.

Add this

    extension=memcache.so

Now restart apache with:

    service httpd restart

We will now check to make sure memcached is running.

Create an empty file called test.php and place this in it:

    <? phpinfo();  ?>
    root# php -f test.php  | grep “memcache support”
    memcache support => enabled

If this command does not return any thing the memcache plugin did not load correctly.

You can now delete test.php, your memcache installation should be functional.

Cacti installation on 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)

  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           publicgroup 
MyRWGroup v1         localgroup 
MyRWGroup v2c        localgroup 
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 

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>

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.