Newton Linux User Group Graphing SNMP with Cacti and RRDtool



Similar documents
Install Cacti Network Monitoring Tool on CentOS 6.4 / RHEL 6.4 / Scientific Linux 6.4

Cacti complete network graphing solution. Oz Melamed E&M Computing Jun 2009

Using Cacti To Graph MySQL s Metrics

Network and Server Statistics using Cacti

Monitoring disk stats with Cacti

Cacti The ULTIMATE Management Solution

May PZ-0502A-WWEN Prepared by: Internet & E-Commerce Solutions

Deploying the BIG-IP LTM with the Cacti Open Source Network Monitoring System

Local Caching Servers (LCS): User Manual

Rebasoft Auditor Quick Start Guide

Dell SupportAssist Version 2.0 for Dell OpenManage Essentials Quick Start Guide

Maintaining Non-Stop Services with Multi Layer Monitoring

NeuralStar Installation Guide

OnCommand Performance Manager 1.1

Upgrading MySQL from 32-bit to 64-bit

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

Easy Setup Guide 1&1 CLOUD SERVER. Creating Backups. for Linux

AXIGEN Mail Server Reporting Service

HP A-IMC Firewall Manager

VERSION 9.02 INSTALLATION GUIDE.

HP IMC Firewall Manager

There are numerous ways to access monitors:

BaseManager & BACnet Manager VM Server Configuration Guide

User Manual. Onsight Management Suite Version 5.1. Another Innovation by Librestream

HP LeftHand SAN Solutions

Required Virtual Interface Maps to... mgmt0. virtual network = mgmt0 wan0. virtual network = wan0 mgmt1. network adapter not connected lan0

IBM. IBM Cloud Automated Modular Managed (AMM) - monitoring services User Guide

Rancid Server Build and Operation Overview (v0.3) (This is being done from memory so expect some errors)

Using SNMP with Content Gateway (not V-Series)

Virtual Appliance Setup Guide

TANDBERG MANAGEMENT SUITE 10.0

SQL Server Setup for Assistant/Pro applications Compliance Information Systems

LOCKSS on LINUX. Installation Manual and the OpenBSD Transition 02/17/2011

Livezilla How to Install on Shared Hosting By: Jon Manning

Tue Apr 19 11:03:19 PDT 2005 by Andrew Gristina thanks to Luca Deri and the ntop team

Partek Flow Installation Guide

EZblue BusinessServer The All - In - One Server For Your Home And Business

IBM Security QRadar SIEM Version MR1. Log Sources User Guide

42goISP Documentation

ISPConfig Documentation

SHAREPOINT 2013 IN INFRASTRUCTURE AS A SERVICE

Installing Platform RTM. Platform RTM Version Release date: October 2011

Project management integrated into Outlook

Management, Logging and Troubleshooting

System Administration and Log Management

Network and Server Statistics Using Cacti

Projetex 9 Workstation Setup Quick Start Guide 2012 Advanced International Translations

Oracle Enterprise Manager. Description. Versions Supported. Prerequisites

Network and Server Statistics Using Cacti

EZblue BusinessServer The All - In - One Server For Your Home And Business

Quick Installation Guide For Sensors with Cacti

Local Caching Servers (LCS) February 2015

Installation Instructions

How To Set Up A Backupassist For An Raspberry Netbook With A Data Host On A Nsync Server On A Usb 2 (Qnap) On A Netbook (Qnet) On An Usb 2 On A Cdnap (

Advanced Server Monitoring Setup Guide

Avira Update Manager User Manual

RPM Utility Software. User s Manual

SYMANTEC BACKUPEXEC2010 WITH StorTrends

How to configure Linksys SPA for VOIP Connections

Solr Bridge Search Installation Guide

Security Correlation Server Quick Installation Guide

FrontDesk Installation And Configuration

VELOCITY. Quick Start Guide. Citrix XenServer Hypervisor. Server Mode (Single-Interface Deployment) Before You Begin SUMMARY OF TASKS

Installation and Configuration Manual

Knowledge is Power. He who gets wisdom loves his own soul; he who cherishes understanding prospers. (Proverbs 19:8)

Syncplicity On-Premise Storage Connector

NOC PS manual. Copyright Maxnet All rights reserved. Page 1/45 NOC-PS Manuel EN version 1.3

How To Create An Easybelle History Database On A Microsoft Powerbook (Windows)

RecoveryVault Express Client User Manual

Back Up Linux And Windows Systems With BackupPC

Quick Start Guide for Parallels Virtuozzo

TimeIPS Server. IPS256T Virtual Machine. Installation Guide

If you re not using Citrix XenCenter 6.0, your screens may vary. Required Virtual Interface Maps to... mgmt0. virtual network = mgmt0 wan0

Deploying IBM Lotus Domino on Red Hat Enterprise Linux 5. Version 1.0

Quick Start Guide for VMware and Windows 7

CN=Monitor Installation and Configuration v2.0

Online Backup Linux Client User Manual

Keri USB-A Connection and Configuration

LAMP Quickstart for Red Hat Enterprise Linux 4

TSM for Windows Installation Instructions: Download the latest TSM Client Using the following link:

BF2CC Daemon Linux Installation Guide

1. Product Information

Online Backup Client User Manual

NetIQ Sentinel Quick Start Guide

OpenPro ERP Software Installation Guide REDHAT LINUX

SuperLumin Nemesis. Administration Guide. February 2011

Rev 7 06-OCT Site Manager Installation Guide

XCloner Official User Manual

Setting Up Specify to use a Shared Workstation as a Database Server

Lexia Network Installation Instructions

CommandCenter Secure Gateway

CA Spectrum and CA Service Desk

InstantSearch+ for Magento Extension

Kollaborate Server Installation Guide!! 1. Kollaborate Server! Installation Guide!

SOS SO S O n O lin n e lin e Bac Ba kup cku ck p u USER MANUAL

System Administration Training Guide. S100 Installation and Site Management

Remote Unix Lab Environment (RULE)

TransNav Management System Documentation. Management Server Guide

HOW TO BUILD A VMWARE APPLIANCE: A CASE STUDY

Transcription:

Newton Linux User Group Graphing SNMP with Cacti and RRDtool Summary: Cacti is an interface that can be used to easily manage the graphing of SNMP data. These graphs allow you to visualize performance trends within your Linux systems or network infrastructure. We have been using Cacti to manage RRD based graphs of our hosting network for quite some time now. When we considered moving from MRTG based graphing to RRDtool based graphing, it seemed that configuring RRDtool was going to be much more difficult than configuring MRTG had been. Cacti has made config and management of MANY data sources a breeze. I ll be demonstrating the following: * How to install and configure Cacti on a RedHat 9 system * How to graph cpu/memory/disk usage on a Linux system via SNMP. * How to graph network usage on a managed switch via SNMP You could also use Cacti to graph Windows system performance. We won t be covering this because the "L" in NLUG doesn t stand for Windows. :) Website References: Cacti: Web-based RRDtool Frontend http://raxnet.net/products/cacti/ RRDtool: a reimplementation of MRTGs graphing and logging features http://www.rrdtool.org/ System Requirements: Cacti Server Linux with Apache, MySQL 3.23+ and PHP 4.1+ RRDtool Net-SNMP (or Ucd-SNMP on older systems) Linux Hosts SNMP support (may need to install and config Net-SNMP or Ucd-SNMP) SNMP community string / password (you must have this) Network Hosts SNMP support (most routers and managed switches support SNMP) SNMP community string / password (you must have this) Datility Networks, Inc. 1 of 9 9/7/2004

Cacti Server Installation Notes: The demonstration server is running Linux Redhat 9 with current updates. We already have a working installation of Apache, MySQL, PHP and phpmyadmin 2.5.7. # Start by creating a cacti database as well as the cacti user via phpmyadmin... http://cacti-demo.newtonlug.org/phpmyadmin/ * CREATE NEW DATABASE: "cacti" * PRIVILEGES * ADD A NEW USER * USERNAME: cacti * HOSTNAME: localhost * PASSWORD: random*cacti*sql*password * GO * DATABASE SPECIFIC PRIVILEGES: cacti * SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, DROP # We need to download and extract cacti. We ll download it to /opt/cacti/ directory. [root@cacti root]# cd /opt/ [root@cacti opt]# mkdir cacti/ [root@cacti opt]# cd cacti/ [root@cacti cacti]# wget http://www.raxnet.net/downloads/cacti/cacti-0.8.5.tar.gz [root@cacti cacti]# tar -zxvf cacti-0.8.5.tar.gz [root@cacti cacti]# mv cacti-0.8.5/ /var/www/html/cacti/ [root@cacti cacti]# cd /var/www/html/cacti/ # We need to populate our new cacti database with SQL information [root@cacti cacti]# mysql u root -p cacti < cacti.sql # We need to update the cacti configuration file to include our SQL database info [root@cacti cacti]# vi include/config.php $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cacti"; $database_password = "random*cacti*sql*password"; # We will create a cacti username and set a password on the account [root@cacti cacti]# useradd cacti [root@cacti cacti]# passwd cacti Changing password for user cacti. New UNIX password: random*cacti*user*password # We need to change ownership of the rra and log directories cacti will use. [root@cacti cacti]# chown -R cacti rra/ log/ # We need to add a line to crontab so we can collect data every 5 minutes [root@cacti cacti]# vi /etc/crontab */5 * * * * cacti php /var/www/html/cacti/cmd.php > /dev/null 2>&1 # If we run the command we just added to CRON, we should receive a message as follows. [root@cacti cacti]# php /var/www/html/cacti/cmd.php There are no items in your poller cache. Make sure you have at least one data source created. If you do, go to Utilities, and select Clear Poller Cache. time: 0 # A majority of this information is also available on the following webpage... http://www.raxnet.net/products/cacti/docs/install.htm # Cacti is now installed. We ll prepare our SNMP hosts and devices next. Datility Networks, Inc. 2 of 9 9/7/2004

Linux System - SNMP Installation and Configuration Notes: Before you can collect data from your Linux system, you must install and configure SNMP. We will demonstrate with a Linux Redhat 9 system. If you have an older linux system, you may need to substitute net-snmp with ucd-snmp. # Check to see if net-snmp (or ucd-snmp) is installed. If not, install it. [root@rh9 root]# rpm -qa grep -i snmp [root@rh9 root]# apt-get install net-snmp # Backup the SNMPd configuration and replace the config with the following... [root@rh9 root]# cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig [root@rh9 root]# vi /etc/snmp/snmpd.conf ## GENERIC SNMPD.CONF FILE ## com2sec notconfiguser default snmp*password group notconfiggroup v1 notconfiguser group notconfiggroup v2c notconfiguser view systemview included.1 access notconfiggroup "" any noauth exact systemview none none # System Location Information syslocation Unknown (edit /etc/snmp/snmpd.conf) syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf) # Check for loads: load 12 14 14 # Configure the SNMPd service to start on system boot [root@rh9 root]# chkconfig snmpd on # Start the SNMPd service immediately [root@rh9 root]# service snmpd start # Allow SNMP (161/udp) from the cacti server (192.168.111.4) and restart firewall [root@rh9 root]# vi /etc/sysconfig/iptables -A RH-Lokkit-0-50-INPUT -p udp -m udp -s 192.168.111.4 --dport 161 -d 0/0 -j ACCEPT [root@rh9 root]# service iptables restart Our Linux system is now configured to accept SNMP queries and respond to the queries if the correct community string (snmp*password) is provided. We will configure the cacti server to query SNMP on this linux system in just a moment. Disclaimer: This is only a sample configuration file that happens to allow monitoring of most available information via SNMP. If you are monitoring SNMP in a production environment, you should take time to customize the snmpd.conf file to meet your particular needs. Datility Networks, Inc. 3 of 9 9/7/2004

Hardware Device - SNMP Configuration Notes: Before you can collect data from your hardware device (ie: router or managed switch), you must enable and configure SNMP. We will demonstrate with an HP ProCurve switch. I ll connect my workstation to the switch using a console cable. Afterwards, I ll use my communication program to communicate with the switch via COM1. The port settings I used were 9600 bps, 8N1, and NO FLOW CONTROL. Next, I ll login to the switch via the console cable using my password. HP J3299A ProCurve Switch 224M Firmware revision D.05.14 Copyright (C) 1991-1998 Hewlett-Packard Co. All Rights Reserved. RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subdivision (b) (3) (ii) of the Rights in Technical Data and Computer Software clause at 52.227-7013. HEWLETT-PACKARD COMPANY, 3000 Hanover St., Palo Alto, CA 94303 Password: my*switch*password Then I choose Switch Management and IP Configuration to set the IP address. Then I choose Switch Management and SNMP Community Names to set the password. HP ProCurve Switch 224M sw-nlug-demo 1-Jan-1990 0:07:54 ==========================- CONSOLE - MANAGER MODE -============================ Switch Management Access Configuration - SNMP Communities Community Name : snmp*password MIB View : Manager Write Access : Restricted Manager Address ---------------------- 192.168.111.4 Actions-> Cancel Edit Save Help Enter Community Name - up to 16 characters, case sensitive; no spaces Use arrow keys to change field selection, <Space> to toggle field choices, and <Enter> to go to Actions. Once an IP address and an SNMP community name have been configured on the managed hardware, we should be able to query the hardware and create graphs using cacti. Datility Networks, Inc. 4 of 9 9/7/2004

Cacti Server Configuration Notes: Now that we have several SNMP-enabled systems available, we can configure cacti so that it will graph them. Visit the cacti site to begin the configuration process. http://cacti-demo.newtonlug.org/cacti/ The first time you visit the site, you are presented with an informational welcome page similar to the following. Click NEXT. You will then be asked to choose the type of installation. Choose NEW INSTALL and click NEXT. You will then be presented with a list of dependencies. If all of the RPMs you will need are installed (including net-snmp, net-snmp-utils and rrdtool), cacti should be able to locate all of the dependencies. The demo server is running Linux Redhat 9 with current updates. We already have a working install of Apache, MySQL, PHP, etc. Correct dependencies as necessary or click FINISH. Datility Networks, Inc. 5 of 9 9/7/2004

After you have clicked FINISH, you will be presented with a login page. Login to your new cacti website with username admin and password admin. You will be required to change your password upon first login. First we ll setup graphs for our managed switch. Choose Devices under Management on the left-hand menu. Then add a device by clicking the Add link on the dark blue bar above the list of devices. We will enter the following information for the device. Description: sw-nlug-demo Hostname: 192.168.111.2 Host Template: Generic SNMP-enabled Host SNMP Community: snmp*password SNMP Version: Version 2 When you click CREATE, you will be taken to the device page. The page should show some basic SNMP Information just below the description and the hostname of the device. NOTE: If the page shows SNMP error, confirm the IP, be sure SNMP is enabled on the device and check any firewall rules that may be interfering with the query. Scroll down to the Associated Data Queries section near the bottom of the page and confirm that there is the data query called SNMP Interface Statistics was successfully queried. You may see something similar to the following: Scroll back to the top of the device page and click on the large blue link that says Create Graphs for this Host. You will be taken to a new page that should list the available SNMP data queries. We want to create graphs for all of the ports so we simply click on the checkmark in the upper-right corner of the Data Query area. This will mark all available ports. Next, click CREATE at the bottom of the page. Datility Networks, Inc. 6 of 9 9/7/2004

You will be presented with a list of indexes available for the graphs. Sometimes you have more than one option in the dropdown menu. These options influence the default names Cacti will give each of your graphs. We usually choose ifindex. Click CREATE to finish creating your graphs. That s it! Now you have graphs for your managed switch or other network device. Now let s setup graphs for our Linux system. Choose Devices under Management on the left-hand menu again. Then add a device by clicking the Add link on the dark blue bar above the list of devices. We will enter the following information for the device. Description: linux-nlug-demo Hostname: 192.168.111.5 Host Template: ucd/net SNMP Host SNMP Community: snmp*password SNMP Version: Version 2 When you click CREATE, you will be taken to the device page. The page should show some basic SNMP Information just below the description and the hostname of the device. NOTE: If the page shows SNMP error, confirm the IP, be sure SNMP is enabled on the device and check any firewall rules that may be interfering with the query. Scroll down to the Associated Data Queries section near the bottom of the page. You should see something similar to the following. Notice how the second query returned no items. Remove the ucd/net Get Monitored Partitions and add SNMP Get Mounted Partitions instead. Datility Networks, Inc. 7 of 9 9/7/2004

After making these changes, you should see data queries and graph templates similar to the following. Scroll back to the top of the device page and click on the large blue link that says Create Graphs for this Host. You will be taken to a new page that should list the available SNMP data queries. We want to create graphs for all of the available quries so we simply click on the checkmark in the upper-right corner of each Graph Template or Data Query area to mark all available queries. Next, click CREATE at the bottom of the page. Datility Networks, Inc. 8 of 9 9/7/2004

You will be presented with a list of indexes available for the graphs. Sometimes you have more than one option in the dropdown menu. These options influence the default names Cacti will give each of your graphs. We usually choose ifindex for Traffic graphs and hrstoragedescr for Storage Graphs. Click CREATE to finish creating your graphs. That s it! Now you have graphs for processor, memory, disk and traffic on your Linux system. Happy graphing! NOTE: Your graphs will always appear broken until the first 5 minute polling cycle has occurred. This is because the data files that the graphs are based on are not created until the first time the device is polled. Datility Networks, Inc. 9 of 9 9/7/2004