ZenPack:OpenvSwitch

From Zenoss Wiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search
Organization
Zenoss, Inc.
License
GNU General Public License, Version 2, or later
ZenPack name
ZenPacks.zenoss.OpenvSwitch
More Information
GitHub page/HomePage
Git sources (for cloning)
Link


Applications Monitored: 



OpenvSwitch ZenPack

This ZenPack provides support for monitoring OpenvSwitch http://openvswitch.org

Warning

The ZenPack Catalog has moved to its new home at https://www.zenoss.com/product/zenpacks as of January 17, 2017. The following information may be out of date, and this page will eventually be removed.

Support

This is an Open Source ZenPack developed by Zenoss, Inc. Enterprise support for this ZenPack is available to commercial customers with an active subscription.

Releases

Version 1.1.1- Download
Summary of changes: Maintenance release
Released on 2017/04/20
Compatible with Zenoss Core 4.2.x, Zenoss Core 5.0.x, Zenoss Resource Manager 4.2.x, Zenoss Resource Manager 5.0.x
Version 1.1.0- Download
Summary of changes: Initial Version
Released on 2015/06/01
Compatible with Zenoss Core 4.2.x, Zenoss Core 5.0.x, Zenoss Resource Manager 4.2.x, Zenoss Resource Manager 5.0.x

Background

This ZenPack provides support for monitoring OpenvSwitch.

Gallery

Features

The features added by this ZenPack can be summarized as follows. They are each detailed further below.

  • Discovery of relevant components.
  • Performance monitoring.
  • Service impact and root cause analysis. (Requires Zenoss Service Dynamics)
  • Reporting
Model Diagram

Discovery

The following components will be automatically discovered through the Open vSwitch host, username and password you provide.

  • Open-vSwitch
  • Bridge
  • Port
  • Flow
  • Interface

Performance Monitoring

The following metrics will be collected every 5 minutes by default.

Bridge
  • Total number of ports
  • Total number of flows
  • Total number of interfaces
Interface
  • Number of incoming bytes
  • Number of outgoing bytes
  • Number of incoming packets
  • Number of outgoing packets
  • Number of packet collisions
  • Number of incoming packet dropped
  • Number of outgoing packet dropped
  • Numbef of CRC errors
  • Numbef of incoming packet errors
  • Numbef of outgoing packet errors
  • Numbef of incoming frame errors
  • Numbef of incoming buffer overrun errors


Usage

Adding Open vSwitch Endpoint

Use the following steps to start monitoring Open vSwitch using the Zenoss web interface.

  1. Navigate to the Infrastructure page.
    Add Menu Item
  2. Choose Add a Single Device... from the add device button.
  3. Fill out the form.
    Add Dialog
    • Name or IP must be either the IP address for the Open vSwitch host, or a FQDN that can be resolved to the host IP address.
    • Title can be any unique Zenoss device name. See note below.
  4. Select /Network/OpenvSwitch from the dropdown list for Device Class
  5. Click ADD.

Bulbgraph.png Note: The Title field should not be empty; it should be a unique device name within the Zenoss environment. The device's IP address or device's hostname should not be used as the title either. This is especially important if you are adding another device that share the same IP address or hostname that already exist on another device. Not doing this may result in devices with the same name conflicting with each other. (e.g. attempting to model device would show modeling results that belong to another device OR device would show relations that do not belong to that device)

Adding an Open vSwitch Endpoint with Zenbatchload

You can add an OVS endpoint by using the zenbatchload command:

batchload <filename>

where the file <filename> should have the format:

/Devices/Network/OpenvSwitch
<device name> setManageIp='<ip address>', zCommandUsername='<username>', zCommandPassword='<password>'

For example:

/Devices/Network/OpenvSwitch
net.ovs setManageIp='10.4.1.21', zCommandUsername='zenoss', zCommandPassword='secret_pass'

Installed Items

Installing this ZenPack will add the following items to your Zenoss system.

Configuration Properties
  • zPythonClass
Device Classes
  • /Network/OpenvSwitch
Modeler Plugins
  • zenoss.ssh.OpenvSwitch
Monitoring Templates (all in /Network/OpenvSwitch)
  • Bridge
  • Interface
Command Parsers
  • ZenPacks.zenoss.OpenvSwitch.parsers.BridgeStatistics
  • ZenPacks.zenoss.OpenvSwitch.parsers.InterfaceStatistics

To start monitoring your Open vSwitch server you will need to setup SSH access so that your Zenoss collector server will be able to SSH into your Open vSwitch server(s) as a user who has permission to run the ovs-vsctl command, and /var/run/openvswitch/db.sock without TTY. This almost always means the root user. In addition, TTY must not be required for the user. See the Using a Root User section below for instructions on relieving root users from having to use TYY. See the Using a Non-Root User section below for instructions on allowing non-root users to run Open vSwitch.

zProperties
  • zCommandUsername
  • zCommandPassword
  • zKeyPath

The zCommandUsername property must be set. To use public key authentication you must verify that the public portion of the key referenced in zKeyPath is installed in the `~/.ssh/authorized_keys` file for the appropriate user on the Open vSwitch server. If this key has a passphrase you should set it in the zCommandPassword property. If you'd rather use password authentication than setup keys, simply put the user's password in the zCommandPassword property. You should then add the zenoss.ssh.OpenvSwitch modeler plugin to the device, or device class containing your Open vSwitch servers and remodel the device(s).

Using a Root User

This ZenPack requires the ability to run the ovs-vsctl command, ovs-ofctl command, and ovsdb-tool command remotely on your Open vSwitch server(s) using SSH. By default, these commands are only allowed to be run locally. To remotely run theses commands, the root use must not be required to use TTY.

  1. Install the sudo package on your server.
  2. Allow root user to execute commands via ssh without a TTY.
    1. Run visudo as root.
    2. Find the line containing root ALL=(ALL) ALL.
    3. Add this line underneath it:
      Defaults:root  !requiretty
    4. Type ESC then :wq to save the sudo configuration.


Using a Non-Root User

This ZenPack requires the ability to run the ovs-vsctl command, ovs-ofctl command, and ovsdb-tool command remotely on your Open vSwitch server(s) using SSH. By default, these commands are only allowed to be run by the root user. Furthermore, this ZenPack expects these commands be in the user's path. Normally this is only true for the root user.

Assuming that you've created a user named zenmonitor on your Open vSwitch servers for monitoring purposes, you can follow these steps to allow the zenmonitor user to run ovs-vsctl command, ovs-ofctl command, and ovsdb-tool command.

  1. Install the sudo package on your server.
  2. Allow the *zenmonitor* user to run ovs-vsctl, ovs-ofctl.
    1. Run visudo as root.
    2. Add the following line to the bottom of the file.
      zenmonitor ALL=(ALL) NOPASSWD: /usr/sbin/ovs-vsctl, /usr/sbin/ovs-ofctl
    3. Type ESC then :wq to save the sudo configuration.
  3. Allow *zenmonitor* to execute commands via ssh without a TTY.
    1. Run visudo as root.
    2. Find the line containing zenmonitor ALL=(ALL) NOPASSWD: /usr/sbin/ovs-vsctl, /usr/sbin/ovs-ofctl.
    3. Add this line underneath it:
      Defaults:zenmonitor  !requiretty
    4. Type ESC then :wq to save the sudo configuration.


Zenoss Analytics

This ZenPack provides additional support for Zenoss Analytics. Perform the following steps to install extra reporting resources into Zenoss Analytics after installing the ZenPack.

  1. Copy analytics-bundle.zip from $ZENHOME/ZenPacks/ZenPacks.zenoss.OpenvSwitch/analytics/ on your Zenoss server.
  2. Navigate to Zenoss Analytics in your browser.
  3. Login as superuser.
  4. Remove any existing OpenvSwitch ZenPack folder.
    1. Choose Repository from the View menu at the top of the page.
    2. Expand Public in the list of folders.
    3. Right-click on OpenvSwitch ZenPack folder and choose Delete.
    4. Confirm deletion by clicking OK.
  5. Add the new OpenvSwitch ZenPack folder.
    1. Choose Server Settings from the Manage' menu at the top of the page.
    2. Choose Import in the left page.
    3. Remove checks from all check boxes.
    4. Click Choose File to import a data file.
    5. Choose the analytics-bundle.zip file copied from your Zenoss server.
    6. Click Import.
    7. Click Close to close Import page

You can now navigate back to the OpenvSwitch ZenPack folder in the repository to see the following resources added by the bundle.

Domains
  • OpenvSwitch Domain

Domains can be used to create ad hoc views using the following steps.

  1. Choose Ad Hoc View from the Create menu.
  2. Click Domains at the top of the data chooser dialog.
  3. Expand Public then OpenvSwitch ZenPack.
  4. Choose the OpenvSwitch Domain domain.

Service Impact and Root Cause Analysis

When combined with the Zenoss Service Dynamics product, this ZenPack adds built-in service impact and root cause analysis capabilities. The service impact relationships are automatically added. These will be included in any services that contain one or more of the explicitly mentioned components.

Since the class structure of Open vSwitch is simple, its Impact structure is nearly identical to the class structure shown above.

Recommended Impact Setup

Since most components will be related to Interfaces we recommend:

  • Navigate to Services (Impact)
  • Add a Dynamic Service to your Services tab
  • Add all Interfaces to the Dynamic Service
  • Optionally add all Flows to the Dynamic Service

Impact Relations

Component failures will affect Impact as follows:

  • OpenvSwitch endpoint impacts associated Bridges
  • Bridge impacts associated Ports and Flows
  • Port impacts associated Interfaces

Changes

1.1.1
  • Upgrade ZenPackLib to 1.2.0
  • Change over to new ZenPackLib format for zenpack.yaml
  • Add OpenStack Integration (OSI 2.1.1)
  • Add configuration check for openstack_neutron_integration (OSI 2.1.1)
  • Fix compatibility with Layer2 1.1.0 and later (ZEN-22790, ZPS-871)
1.1.0
  • Initial Release

Installation

Normal Installation (packaged egg)

  1. Download the appropriate egg file for the version of Zenoss you are running.
  2. Ensure you are logged in as the zenoss user:
    $ sudo su - zenoss
  3. Install the ZenPack:
    $ zenpack --install ZenPacks.zenoss.OpenvSwitch-*.egg
  4. Restart these services:
    $ zenoss restart

Developer Mode Installation

In order to do a development mode installation you will want to clone the existing git repository, and then use the --link flag with the zenpack command:

  1. Ensure you are logged in as the zenoss user:
    $ sudo su - zenoss
  2. Start by cloning the upstream repository:
    $ git clone https://github.com/zenoss/ZenPacks.zenoss.OpenvSwitch.git
  3. Next, perform the installation:
    $ zenpack --link --install ZenPacks.zenoss.OpenvSwitch
  4. Finally, restart these serivices:
    $ zenoss restart

Discuss

Purplemarker.png New: Don't forget to add yourself to the Zenoss User Map!

blog comments powered by Disqus