SNMP Booster: Install and setup

SnmpBooster Download Install and Configure

  • [[SnmpBooster_how_it_works| What is the SnmpBooster module]]
  • [[Setup SNMP booster module| Install and configure the SNMP acquisition module.]] [You are here]
  • [[snmpbooster_troubleshooting|Reference - SnmpBooster troubleshooting]]
  • [[snmpbooster_design_specification|Reference - SnmpBooster design specification]]
  • [[snmpbooster_dictionary|Reference - SnmpBooster configuration dictionnary]]

Downloads

The SnmpBooster module and genDevConfig are currently in public beta prior to integration within Shinken. You can consult the design specification to see the [[SnmpBooster design specification | current development status]].

Requirements

The SnmpBooster module requires:

The genDevConfig profile generator depends on:

  • Perl 5.004+
  • 4 perl modules available from CPAN and network repositories. genDevConfig/INSTALL has the installation details.

STRONGLY RECOMMENDED: Use the same version of Python and Pyro on all hosts running Shinken processes.

Installation

SnmpBooster:

  • Install the dependencies
  • Copy the file snmp_poller.py from the git repository to your shinken/modules directory.
  • Configuration steps are listed in the present web page.

genDevConfig:

  • Download and extract the archive to your server.
  • See genDevConfig/INSTALL on how to install and configure it.

Configuration

How to define the SnmpBooster module in the Shinken daemons

You need to modify shinken-specific.cfg, which is located in $shinken/etc/shinken-specific.cfg

Arbiter daemon configuration

Simply declare the module:

modules SnmpBoosterArbiter

Scheduler daemon configuration

Simply declare the module:

modules SnmpBoosterScheduler

Poller daemon configuration

Simply declare the module:

modules SnmpBoosterPoller

SnmpBooster Module declaration

You have to declare all least 3 modules.

One for the Arbiter:

define module {
    module_name          SnmpBoosterArbiter
    module_type          snmp_booster
    datasource           /etc/shinken/snmpbooster_datasource/   ; SET THE DIRECTORY FOR YOUR Defaults*.ini FILES
    memcached_host       192.168.1.2   ; SET THE IP ADDRESS OF YOUR memcached SERVER
    memcached_port       21201   ; default port for a memcached process
    loaded_by            arbiter
    show_from_cache      False
}

One for the Scheduler:

define module {
    module_name          SnmpBoosterScheduler
    module_type          snmp_booster
    datasource           /etc/shinken/snmpbooster_datasource/   ; SET THE DIRECTORY FOR YOUR Defaults*.ini FILES
    memcached_host       192.168.1.2   ; SET THE IP ADDRESS OF YOUR memcached SERVER
    memcached_port       21201   ; default port for a memcached process
    loaded_by            scheduler
    show_from_cache      False
}

One for the Poller:

define module {
    module_name          SnmpBoosterPoller
    module_type          snmp_booster
    datasource           /etc/shinken/snmpbooster_datasource/   ; SET THE DIRECTORY FOR YOUR Defaults*.ini FILES
    memcached_host       192.168.1.2   ; SET THE IP ADDRESS OF YOUR memcached SERVER
    memcached_port       21201   ; default port for a memcached process
    loaded_by            poller
    show_from_cache      False
    life_time            1000 ; Nb of checks done before kill the worker (and restart an other one)
}

If you do not know the IP adress on which your memcache is listening, check under /etc/memcached.conf. Or do a:

netstat -a | grep memcached

If you are running a test on the local machine you can leave memcached on 127.0.0.1 (localhost), but if your poller, scheduler or arbiter is on a different machine, set the memcached to listen on a real IP address.

Parameters
module_name:Module Name. Example: SnmpBoosterPoller
module_type:Module type. Must be: snmp_booster
datasource:Datasource folder. Where all your Defaults*.ini are. Example: /etc/shinken/snmpbooster_datasource/
memcached_host:Memcached host IP. Example: 192.168.1.2
memcached_port:Memcached host port. Example: 21201
loaded_by:Which part of Shinken load this module. Must be: poller, arbiter or scheduler. Example: arbiter
show_from_cache:
 Prefix output by FROM CACHE string when datas come from memcached. Usefull for debugging. Default: False

How to define a Host and Service

Step 1

Create a template for your SNMP enabled devices.

Sample template:

cd shinken/etc/packs/network/
mkdir SnmpBooster

vi shinken/etc/packs/network/SnmpBooster/templates.cfg

To edit the file

define command {
  command_name    check_snmp_booster
  command_line    check_snmp_booster -H $HOSTNAME$ -C $SNMPCOMMUNITYREAD$ -V 2c -t $ARG1$ -i $_SERVICEINST$ -T $_SERVICETRIGGERGROUP$
  module_type     snmp_booster
}
define service {
  name                    default-snmp-template
  check_command           check_snmp_booster!$_SERVICEDSTEMPLATE$!$_SERVICEINST$!$_SERVICETRIGGERGROUP
  _inst                   None
  _triggergroup           None
  max_check_attempts      3
  check_interval          1
  retry_interval          1
  register                0
}
host{
  name                    SnmpBooster-host
  alias                   SnmpBooster-host template
  check_command               check_host_alive
  max_check_attempts      3
  check_interval          1
  retry_interval          1
  use                     generic-host
  register                0
}

Step 2

Define some hosts and services. You would typically use genDevConfig or another configuration generator to create these for you.

Mandatory service arguments related to SNMP polling:

::
_dstemplate Cisco-Generic-Router ; Name of a DSTEMPLATE defined in the SnmpBooster config.ini file snmpcommunityread which is set in your resource.cfg file

Optional service arguments related to SNMP polling with default values:

_inst                   None   ; Could be numeric: 0, None or an instance mapping function like: map(interface-name,FastEthernet0_1)
_triggergroup           None   ; Name of the triggergroup defined in the SnmpBooster config.ini file to use for setting warning and critical thresholds

Sample Shinken host and service configuration:

# Generated by genDevConfig 3.0.0
# Args: --showunused -c publicstring 192.168.2.63
# Date: Thu Aug 30 17:47:59 2012

#######################################################################
# Description: Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(50)SE4, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2010 by Cisco Systems, Inc. Compiled Fri 26-Mar-10 09:14 by prod_rel_team
#     Contact:
# System Name: SITE1-ASW-Lab04
#    Location:
#######################################################################

define host {
   host_name          192.168.2.63
   display_name               192.168.2.63
   _sys_location
   address            192.168.2.63
   hostgroups
   notes
   parents
   use                        default-snmp-host-template
   register           1
}

define service {
   host_name          192.168.2.63
   service_description        chassis
   display_name               C2960 class chassis
   _dstemplate                Cisco-Generic-Router
   _inst              0
   use                        default-snmp-template
   register           1
}

define service {
   host_name          192.168.2.63
   service_description        chassis.device-traffic
   display_name               Switch fabric statistics - Packets per Second
   _dstemplate                Device-Traffic
   use                        default-snmp-template
   register           1
}

define service {
   host_name          192.168.2.63
   service_description        if.FastEthernet0_1
   display_name               FastEthernet0_1 Description: Link to Router-1 100.0 MBits/s ethernetCsmacd
   _dstemplate                standard-interface
   _inst              map(interface-name,FastEthernet0_1)
   use                        default-snmp-template
   register           1
}

Here is an example configuration of the config.ini file

[DATASOURCE]
    OidmyOidDefinition = .1.3.6.1.45.0
    [myOidDefinition] ; Use the same name as the myOidDeiniftion, but omit the leading "Oid"
        ds_type = DERIVE
        ds_calc = 8,*  ; RPN expression : Oid, 8, *  Which means Oid * 8 = ds_calc
        ds_oid = $OidmyOidDefinition
[DSTEMPLATE]
    [myCiscoRouter]
        ds = myOidDefinition
[TRIGGER]
    [trigger1]
        warning = RPN expression
        critical = RPN expression
    [trigger2]
        warning = RPN expression
        critical = RPN expression
[TRIGGERGROUP]
    [CiscoRouterTriggers]
        triggers = trigger1, trigger2</code>