rrdtool-1.2.11-3 + cacti-0.8.6f-2 (Monitoring)

Tested on 08/Nov/2005 by SuSE 10.0

RRDTool (Round Robin Database Tool) is a tool to generate graph from any kind of data sources. This tool can replace MRTG.

This tool, perhaps, does not have a data gathering function. It needs some front-end tool to gather data such as, HotSaNIC, and Cacti.

Cacti can be configured on Web by PHP/MySQL.

Install SNMP

  • Make sure net-snmp is installed, configured, and running.
  • On Linux, net-snmp-5.2.1-10.i586.rpm should be installed, and configuration would look like this (/etc/snmp/snmp.conf).
    #
    # First, map the community name "public" into a "security name"
    #	sec.name source	community
    com2sec	public	default	public
    
    # Second, map the security name into a group name.
    #	groupName	securityModel	securityName
    group	public		v1		public
    group	public		v2c		public
    group	public		usm		public
    
    # Third, create a view for us to let the group have rights to:
    #	name	incl/excl	subtree	mask(optional)
    view	all	included	.1
    
    # Finally, grant the group read-only access to the systemview view.
    #	group	context	sec.model	  sec.level prefix	read	write	notif
    access	public	""	any		noauth	exact	all	all	all
    
    # System contact information
    #
    syslocation	xxxxxxxx
    syscontact	foo@host
    
  • On Windows 2000, XP, and 2003, SNMP Service should be installed, and configured like this,
  • On CISCO products, SNMP configuration would look like this,
    gw(config)#snmp-server community public RO
    
  • Make sure the snmp service is running and accessible. If necessary, open 161 tcp, udp ports on the target device.
    # snmpwalk -v 1 192.168.1.100 -c public | less
    SNMPv2-MIB::sysDescr.0 = STRING: Hardware: x86 Family 6 Model 9 Stepping 5 AT/AT CO
    MPATIBLE - Software: Windows 2000 Version 5.1 (Build 2600 Uniprocessor Free)
    SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.311.1.1.3.1.1
    DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (80732) 0:1
    SNMPv2-MIB::sysContact.0 = STRING:
    SNMPv2-MIB::sysName.0 = STRING: TS-NEC
    SNMPv2-MIB::sysLocation.0 = STRING:
    SNMPv2-MIB::sysServices.0 = INTEGER: 76
    IF-MIB::ifNumber.0 = INTEGER: 4
    ....
    

    Install Cacti

  • rrdtool must be installed in default. If not, install
    # rpm -ihv rrdtool-1.2.11-3.i586.rpm
    
  • You need MySQL, apache, php...etc, and also running. Make sure you have a session module for the php.
    # rpm -qa | grep php4-session
    php4-session-4.4.0-6
    
  • Install cacti.
    # rpm -ihv cacti-0.8.6f-2.noarch.rpm
    
  • Create database in mysql. If you did not yet set the password, just press enter.
    # cd /usr/share/cacti
    # mysqladmin -u root -p create cacti
    Enter password:
    # mysql -p cacti < cacti.sql
    Enter password:
    
  • Create a password and access permission to cactiuser.
    # mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 87 to server version: 4.1.10a
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'password';
    mysql> flush privileges;
    mysql> \q
    Bye
    
  • Verify the database
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | cacti              |
    | mysql              |
    | test               |
    | tmp                |
    +--------------------+
    5 rows in set (0.00 sec)
    
    mysql> use cacti
    Database changed
    mysql> show tables;
    +---------------------------+
    | Tables_in_cacti           |
    +---------------------------+
    | cdef                      |
    | cdef_items                |
    | colors                    |
    | data_input                |
    | data_input_data           |
    | data_input_fields         |
    | data_local                |
    ...
    
  • Edit /usr/share/cacti/include/config.php
    ...
    $database_type = "mysql";
    $database_default = "cacti";
    $database_hostname = "localhost";
    $database_username = "cactiuser";
    $database_password = "password";
    ...
    
  • You may give access permission to your LAN. Edit /etc/apache2/conf.d/cacti.conf
    Alias /cacti/ /usr/share/cacti/
    <Directory /usr/share/cacti/>
       Options None
       order deny,allow
       deny from all
       allow from 127.0.0.1 192.168.0.0/24
    </Directory>
    
  • Restart apache
    # /etc/init.d/apache2 reload
    
  • Open http://localhost/cacti/ and click [Next]
  • Select [New Install], and click [Next]
  • This screen must show all [FOUND] if you installed by rpm. Click [Next]
  • Type username: admin, password: admin
  • Type a user password twice. After this, you will see a main screen
  • Using default templates

  • To use Cacti's default templates, click [Devices], and select [localhost]
  • Type [public] at Community text box.
  • Click [Save]. You will see [Save Successful].
  • Click [localhost] again. If the configuration is correct, you can see the snmp information.
  • Next, you can add new graph. Click [New Graphs] from the menu. Gray items are already added. Click [create]. You can monitor HDD in default.
  • Click [Data Sources] from the menu to view added items
  • Click [Graphs], and [Preview View]
  • Add traffic graph

  • From the menu, click [Devices], and click [localhost] at the right.
  • Change [Add Data Query] combo box at [Associated Data Queries] to [SNMP - Interface Statistics], and click [Add]
  • Verify the added item, and click [Save]
  • From the menu, click [New Graphs]. From [Data Query], check interface(s) you want to monitor, and click [Create]. If you success to add, the item will be grey.
  • From the menu, click [Data Sources], and review the added items.
  • From the [Graph Management], you can add items to show the graph.
    Back
    Google
    Web www.grape-info.com