Categories
cacti Cacti Examples CactiEZ Linux SSH Ubuntu

Install CactiEZ on Windows 2008 Hyper-V

CactiEZ (Cacti Made Easy) is a self installing Linux Distribution based off CentOS that sets up and configures a customized Cacti install. Everything is designed to be completely automated and working directly out of the box. This compact distro is loaded with extra features such as Syslog and Netflow data collection, Weathermaps, Reports, Auto Discovery, Router Config backup, Nagios, and much more!

This guide provides instructions for installing CactiEZ as a VM on Windows 2008 Hyper-V.

This contains some fairly detailed instructions so someone new to this setup should have enough info to get completely running.  However, since I know some of you out there are in a hurry here’s the Cliff Notes version:
  1. Don’t use the default network adapter – DELETE it!
  2. Add a legacy network adapter.
  3. Install CactiEZ.
Full Instructions for Installing CactiEZ on Windows 2008 Hyper-V
Download the CactiEZ ISO – get this started now so it will be done by the time your’re ready for it.  By default the CactiEZ ISO is a tarred file so you will have to untar (unzip) it before you can use it.  If you don’t already have a Windows-based program that can handle tarred files 7-zip is a great, FREE, utility.  NOTE: in Windows you may have to unzip twice; CactiEZ-v0.6.tar.gz will unzip to CactiEZ-v0.6.tar from which you can extract CactiEZ-v0.6.iso.
Step One: Create the VM on Hyper-V
  • Launch the Windows Hyper-V Manager (Start, All Programs, Administrative Tools, Hyper-V Manager).
  • Select NewVirtual Machine.  Give it a name.  Click Next.
  • Specify memory (RAM).  In this example I’m using 1024 MB.
  • On the “Configure Networking” screen just click Next – we will delete this later anyway.
  • Create a new virtual hard disk using the name, location and size of your choosing.  I created a 10GB virtual HD which should be more than enough for CactiEZ.
  • On the “Installation Options” screen make sure to choose “Install and operating system later.”
  • Click Next, uncheck “Start the virtual machine after it is created” and verify your settings, then click Finish.
    At this point if your VM started you will receive a boot failure message.  Don’t worry, you can safely ignore this and Turn Off the VM.
    Step Two: Customize VM Settings
    • From Hyper-V Manager right-click your new VM, then select Settings.
    • Remove the current Network Adapter.
    • Click Add Hardware and select Legacy Network Adapter, then Add.
    • On the Legacy Network Adapter select the correct adapter from the Network drop-down list
    • Click OK to save settings.
    Step Three: Install CactiEZ
    • Double-click your VM to open the Virtual Machine Connection window.
    • Click Media, DVD Drive, Insert Disk and browse to your (extracted/unzipped) CactiEZ ISO.
    • Start (Power On) the VM & it will begin the CactiEZ server installation.
    • Select whether to install the 32 or 64-bit version and let her rip.  The CactiEZ installation is almost completely automated so just let it run.  When prompted reboot the VM.
    After the system reboots its IP address will be displayed (assuming you have a DHCP server available on the network).  You can certainly change the IP address to a static one if you’d like (instructions below).
    Step Four: Logon to Your CactiEZ Server
    Now that your server is installed logon through the Virtual Machine Connection window.  The default username and password are root, CactiEZ.

    Once logged on the first thing I did was set a static IP address using:

    netconfig

    With the IP address and related settings set appropriately restart the network using:

    service network restart

    You may also want to synchronize your time using:

    ntpdate -u 0.pool.ntp.org

    And set your timezone with:

    yum install system-config-date
    system-config-date

    See more CactiEZ tips and hints here.

    NOTE: By default CactiEZ installs SSH so you can connect remotely with something like PuTTY.
    Step Five: Connect to and Configure Cacti

    Using a browser connect to your new installation of Cacti using http://<IP Address>.  The default user is ‘admin’ and the default password is ‘admin’ as well.  You will be prompted to change the password.

    Now you can knock yourself out configuring and using Cacti.  Here’s more logon information from CactiEZ.

    See also

    Categories
    Apple Linux SSH Ubuntu

    Ubuntu VM on Windows 2008 Hyper-V

    How the Hell do I get networking to work on a Ubuntu VM on Hyper-V in Windows 2008?

    This is a question I have personally grappled with a few times.  Although I was able to successfully install a Ubuntu 8.10 server on Hyper-V with networking over a year ago I forgot how it was done and pulled my hair out trying to figure it out again the other day.  So I thought I’d jot down a few notes to help me remember.  If this  helps anyone else, that will be great too.

    These instructions are for Ubuntu 9.10 server on Windows 2008 Hyper-V.  As mentioned above this works for Ubuntu 8.10 server as well; and presumably other versions although I haven’t verified.

    This contains some fairly detailed instructions so someone new to this setup should have enough info to get completely running.  However, since I know some of you out there are in a hurry here’s the Cliff Notes version:

    1. Don’t use the default network adapter – DELETE it!
    2. Add a legacy network adapter.
    3. Install Ubuntu.
    Full Instructions for Installing Ubuntu 9.10 Server on Windows 2008 Hyper-V

    Download the Ubuntu 9.10 server ISO – get this started now so it will be done by the time your’re ready for it.

    Step One: Create the VM on Hyper-V
    • Launch the Windows Hyper-V Manager (Start, All Programs, Administrative Tools, Hyper-V Manager).
    • Select New, Virtual Machine.  Give it a name.  Click Next.
    • Specify memory (RAM).  In this example I’m using 1024 MB.
    • On the “Configure Networking” screen just click Next – we will delete this later anyway.
    • Create a new virtual hard disk using the name, location and size of your choosing.
    • On the “Installation Options” screen make sure to choose “Install and operating system later.”
    • Click Next, verify your settings, then click Finish.
      At this point if your VM started you will receive a boot failure message.  Don’t worry, you can safely ignore this and Turn Off the VM.

      Step Two: Customize VM Settings

      • From the VM Window click File, Settings.
      • Remove the current Network Adapter.
      • Click Add Hardware and select Legacy Network Adapter, then Add.
      • On the Legacy Network Adapter select the correct adapter from the Network drop-down list
      • Click OK to save settings.
      Step Three: Install Ubuntu
      • Click Media, DVD Drive, Insert Disk and browse to your Ubuntu ISO.
      • Start (Power On) the VM & it will begin the Ubuntu Server installation.
      • Select your Language, then “Install Ubuntu Server.”
      • Select your desired Country and keyboard layout.
      • Enter your desired hostname, then continue.
      • Select your timezone.
      • Partition your disk using the default, “Guided – use entire disk and set up LVM.”
        • Select your disk to partition – if you followed these instructions you will only have one.
        • Select YES to write the changes to disks and configure LVM.
      • Follow the prompts to setup users and passwords, creating at lease one user.
      • Select whether or not to encrypt your home directory.
      • If you have a DHCP server on your network your adapter should retrieve and IP address and associated info from that server.  If not, you will be prompted for IP address settings.
      • Choose how to manage upgrades on your system.
      • Choose which software to install (note, depending on which option(s) you select additional questions will be asked during install which aren’t covered in this tutorial):
        • Cloud computing cluster
        • Cloud computing node
        • DNS server
        • LAMP server
        • Mail server
        • OpenSSH server – You may want to install this to connect via SSH later.
        • PostgreSQL database
        • Print server
        • Samba file server
        • Tomcat Java server
        • Virtual Machine host
        • Manual package selection
      • At the “Finishing Installation” screen select Continue.

      Step Four: Logon to Your Ubuntu Server

      Now that your server is installed logon through the Virtual Machine Connection window to verify network settings and connectivity.  Type ifconfig to view your network settings.  You should have an interface, eth0, with either a DHCP-assigned address or the one you manually entered during installation.

      You could verify correct network operation by pinging a know good host on your local network and/or a host on the Internet.  In my case I pinged my default gateway and powercram.com.  Both responded with replies.

      Finally, now that my Ubuntu Server is setup and networking is configured properly I will probably never (hopefully) use the Virtual Machine Connection window again, rather I will use my favorite remote connection client, PuTTY.

      Since I neglected to install Open-SSH Server during the Ubuntu installation I had to install it before I could use PuTTY using:

      sudo apt-get install openssh-server


      Categories
      Linux Ubuntu

      Recover Root Password In Ubuntu – HowTo

      You can recover/reset/change your root password on Ubuntu if you have physical access to the machine following these simple steps.

      1. Reboot Ubuntu.
      2. At the GRUB menu press ‘e’ (with quotes), which will let you edit GRUB.
      3. Edit the line with your boot command.
      4. Add this command to the very end of the line with the boot command:
        rw init=/bin/bash
      5. Press enter and boot your system, the command, “rw init=/bin/bash” will make your Ubuntu boot with passwordless root shell.
      6. Once you’re logged on just change your password with the passwd <username> command. If it is root just type: passswd root.
      7. Reboot your system.
      Categories
      Linux Ubuntu

      Change Ubuntu IP Address from DHCP to Static or Vice Versa – HowTo

      The default network setting in Ubuntu (or Debian) is to use DHCP.  Often, however, it is desirable to use a static IP address and settings.  To change your network configuration from DHCP to static follow these steps.

      Open a terminal session and enter:

      sudo nano /etc/network/interfaces

      Two network interfaces should be listed, lo and eth0:

      # This file describes the network interfaces available on your system
      # and how to activate them. For more information, see interfaces(5).

      # The loopback network interface
      auto lo
      iface lo inet loopback

      # The primary network interface
      auto eth0
      iface eth0 inet dhcp

      Change eth0 to your desired settings, such as:

      auto eth0
      iface eth0 inet static
      address 192.168.1.10
      netmask 255.255.255.0
      network 192.168.1.0
      broadcast 192.168.1.255
      gateway 192.168.1.1

      Save the file and close using Ctl+X, Y, Enter.

      Restart the network to apply the new setting, with this command:

      sudo /etc/init.d/networking restart

      Verify your network settings with:

      ifconfig

      See also

      Categories
      Iperf iperf examples Linux Ubuntu Windows

      Use Iperf to Measure Network Throughput (Bandwidth) on Windows or Linux

      Iperf was developed by NLANR/DAST as a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.

      • Install iperf on Windows – just download, unzip and run iperf.exe.
      • Install iperf on Ubuntu:
          sudo apt-get install iperf
      Iperf supports several options, but generally you would run it on one device as a “server” and another as a “client.”
      To launch iperf in server mode just enter iperf -s at the terminal.  It will report, “Server listening on TCP port 5001. . .”

      From another system launch iperf in client mode with iperf -c <server IP>. By default Iperf will run a 10 second test and report amount of data transferred and bandwidth speed.

      Note: Iperf can be used to test LAN speeds as well as over the Internet.

      Download Iperf and get more information from SourceForge.

      Categories
      cacti Cacti Examples Iperf Linux Ubuntu WGET

      Bandwidth Monitoring Tools for Ubuntu

      • bmon – Bandwidth monitor and rate estimator
      • bwm-ng – Bandwidth Monitor NG (Next Generation), a live bandwidth
        monitor for network and disk IO
      • cbm – displays the current traffic on all network devices
      • iftop – Real-time bandwidth usage information on a specified interface
      • iperf – Tool for measuring maximum TCP and UDP bandwidth performance
      • ibmonitor – interactive bandwidth monitor
      • pktstat – shows the bandwidth being consumed by packets of various kinds in realtime
      • tcptrack – sniffer which displays information about TCP connections
      • MRTG – see traffic load on a network over time in graphical form
      • Cacti – network graphing solution

      Details on each tool.

      bmon
      bmon is a portable bandwidth monitor and rate estimator. It supports various input methods for different architectures. Various output modes exist, including an interactive curses interface, lightweight HTML output, and simple ASCII output. Statistics may be distributed over a network using multicast or unicast and collected at some point to generate a summary of statistics for a set of nodes.

      Install bmon on Ubuntu:

      sudo apt-get install bmon

      To launch bmon just enter bmon at the terminal.

      You can select a specific interface to view traffic details. In the screen shot below I selected eth0, ‘g’ for graphical statistics and ‘d’ for detailed statistics.

      bwm-ng
      bwm-ng can be used to monitor the current bandwidth of all or some specific network interfaces or disks (or partitions). It shows total of in and out as well as total of all interfaces/devices.

      Install bwm-ng on Ubuntu:

      sudo apt-get install bwm-ng

      To launch bwm-ng just enter bwm-ng at the terminal.

      cbm

      cbm (Color Bandwidth Meter) displays the current traffic on all network devices.
      Install cbm on Ubuntu:
      sudo apt-get install cbm
      To launch cbm just enter sudo cbm at the terminal.

      iftop

      iftop provides real-time bandwidth usage information on a specified interface, listed by host pairs.

      Install iftop on Ubuntu:

      sudo apt-get install iftop

      To launch iftop just enter iftop at the terminal.

      Iperf
      Iperf was developed by NLANR/DAST as a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.

      Install iperf on Ubuntu:
      sudo apt-get install iperf
      Iperf supports several options, but generally you would run it on one device as a “server” and another as a “client.”
      To launch iperf in server mode just enter iperf -s at the terminal.  It will report, “Server listening on TCP port 5001. . .”

      From another system launch iperf in client mode with iperf -c <server IP>. By default Iperf will run a 10 second test and report amount of data transferred and bandwidth speed.

      Note: Iperf can be used to test LAN speeds as well as over the Internet.

      ibmonitor
      ibmonitor is an interactive linux console application which shows bandwidth consumed and total data transferred on all interfaces.

      Its main features are:

      • Shows received, transmitted and total bandwidth of each interface
      • Calculates and displays the combined value of all interfaces
      • Displays total data transferred per interface in KB/MB/GB
      • Values can be displayed in Kbits/sec(Kbps) and/or KBytes/sec(KBps)
      • Can show maximum bandwidth consumed on each interface since start of utility
      • Can show average bandwidth consumption on each interface since start of utility
      • The output with all features (max, avg and display in Kbps and KBps) easily fits on a 80×24 console or xterm
      • Can interactively change its output display format depending on key pressed by user.

      Install ibmonitor on Ubuntu”

      First you need to download the latest version:

      wget http://ovh.dl.sourceforge.net/sourceforge/ibmonitor/ibmonitor-1.4.tar.gz

      Extract this file using the following commands

      tar xvfz ibmonitor-1.4.tar.gz

      cd ibmonitor

      If you want to run the application use the following command

      Once you are in ibmonitor folder use

      ./ibmonitor

      pktstat
      pktstat listens to the network and shows the bandwidth being consumed by packets of various kinds in realtime. It understands some protocols (including FTP, HTTP, and X11) and adds a descriptive name next to the entry (e.g., ‘RETR cd8.iso’, ‘GET http://slashdot.org/’ or ‘xclock -fg blue’).

      Install pktstat on Ubuntu:

      sudo apt-get install pktstat

      To launch pktstat just enter pktstat at the terminal.

      tcptrack
      tcptrack is a sniffer which displays information about TCP connections it sees on a network interface. It passively watches for connections on the network interface, keeps track of their state and displays a list of connections in a manner similar to the unix ‘top’ command. It displays source and destination addresses and ports, connection state, idle time, and bandwidth usage.

      Install tcptrack on Ubuntu:

      sudo apt-get install tcptrack

      To launch tcptrack just enter sudo tcptrack -i eth0 at the terminal.

      tcptrack can also take a pcap filter expression as an argument. The format of this filter expression is the same as that of tcpdump and other libpcap-based sniffers. The following example will only show connections from host 10.1.1.2

      tcptrack -i eth0 src or dst 10.1.1.2

      The next example will only show web traffic (ie, traffic on port 80)

      tcptrack -i eth0 port 80

      MRTG
      MRTG (Multi Router Traffic Grapher) is free software for monitoring the traffic load on network links. It allows the user to see traffic load on a network over time in graphical form.  MRTG is used by programs like Cacti to gather and graph stats over time.

      Cacti
      Cacti is a complete network graphing solution designed to harness the power of RRDTool’s data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive,easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.

      Cacti is great for gathering stats over time (using both MRTG and RRDTool) and creating hourly, daily, weekly, monthly and yearly graphs.  These graphs can be invaluable in identifying trends and potential problems.  In fact, just today I used the following graphs to identify a problem on my corporate network:

      Here’s another one showing network utilization over time.

      See also Multi-CPU Utilization Graphing in Cacti.
      Categories
      Linux Ubuntu

      How To Edit Linux DNS Configuration Files

      Edit /etc/resolv.conf using a text editor such as nano, vi or gedit:

      nano /etc/resolv.conf

      Or, for Ubuntu:

      sudo nano /etc/resolv.conf

      Add namesevers as necessary:

      nameserver <ip address>
      nameserver <ip address>
      nameserver <ip address>

      Save and close the config file.

      See also Change Ubuntu IP Address from DHCP to Static

      Categories
      Linux Ubuntu

      Find the top 10 largest files and directories on Ubuntu

      Unfortunately there is not a simple command in Linux to find the largest files and/or directories. However, combining the following three commands (using pipes) can help you locate the largest files/directories on your file system:

      • du – Estimate file space usage
      • sort – Sort lines of text files or given input data
      • head – Output the first part of files i.e. to display the n largest files/directories

      In Terminal (command prompt) enter the following to list the top 10 largest files/directories:

      sudo du -a / | sort -n -r | head -n 10

      Of course this can be used on various directories as well, like usr or var:

      sudo du -a /usr | sort -n -r | head -n 10
      sudo du -a /var | sort -n -r | head -n 10

      NOTE: This works on all flavors or Linux, UNIX and BSD as well – just drop sudo.

      Categories
      Linux SSH Ubuntu

      Upgrade Ubuntu Server From 8.10 to 9.10 – How To

      You can use the following steps to easily upgrade Ubuntu Linux server (or workstation) 8.x to 9.10 (latest version as of this posting), either locally or remotely over ssh from a terminal command line.

      Note: Backup important data and configuration files first.

      First, apply latest updates to Ubuntu 8.x using:

      sudo apt-get update
      sudo apt-get upgrade

      Next, install update-manager-core (if it is not already installed):

      sudo apt-get install update-manager-core

      Finally, start the upgrade:

      sudo do-release-upgrade

      And just follow the on-screen instructions to complete the Ubuntu 9.10 upgrade.

      Categories
      Linux Ubuntu

      How to update software on Ubuntu / Debian Linux

      Ubuntu (and Debian) software can easily be updated using the apt-get command line tool.

      apt-get can be used from a terminal window as follows:

      • apt-get update: Update is used to resynchronize the package index files from their sources over the Internet.
        To retrieve updated software list, enter:
        sudo apt-get update
      • apt-get upgrade: Upgrade is used to install the newest versions of all packages currently installed on the system.
        Update software, i.e. apply updates:
        sudo apt-get upgrade
      • apt-get install <package-name>: apt-get install can be followed by one or more packages desired for installation. If package is already installed it will try to update to the latest version.
        To upgrade individual software enter apt-get install followed by the software name, as follows:
        sudo apt-get install <package-name>

      apt-get update, apt-get upgrade and apt-get install will all retrieve files over the Internet. The location of update pages is specified in /etc/apt/sources.list (repositories). Unless you need extra repositories for your setup there is no need to modify this file.

      Using Ubuntu Update Manager Tool (GUI)
      The Ubuntu Update Manager Tools works like the Microsoft and Red Hat update manager tools.  In the Ubuntu GUI you will see a little icon in the task bar when updates are available. Just click on it and follow the online instructions.

      You can also start the Update Manager GUI tool by clicking System | Administration | Update Manager.