SNMP Management Pack Example: NetApp Management Pack for SCOM 2007 R2 part 2

In the first part of the NetApp Management Pack basically was all about the design. The result was defining the classes and relationships:

Classes
NetApp.Management.Pack.Class.NetApp.Filer
NetApp.Management.Pack.Class.NetApp.Aggregate
NetApp.Management.Pack.Class.NetApp.Volume
NetApp.Management.Pack.Class.NetApp.Lun
 
Relationships
NetApp.Management.Pack.Relationship.Filer.Hosts.Aggregate
NetApp.Management.Pack.Relationship.Aggregate.Hosts.Volume
NetApp.Management.Pack.Relationship.Aggregate.Hosts.Volume
 
Key Properties
Filer / NetworkDevice – IPAddress – Ip Address
Aggregate Class – AggrName – Aggregate Name
Volume Class – VolName – Volume Name
Lun Class – LunName – Lun Name
 
image

With this information you should be able to create the classes and relationships we are going to use in this MP. The result should be something similar to the screen shots below.

classes

relationships

We have now setup the classes and relationships it is time to start designing the discoveries. I will tell step by step how to design the discovery for each class.

A handy tool at this time besides the authoring console is a SNMP walking tool this way you can send a SNMP GET or even a WALK to the SNMP device to query the data.

In part one there are linked tools.

During this tutorial I assume you have been able to collect a copy of the NetApp simulator tool or have NetApp filers running in your organization. Even without a NetApp Filer I think the tutorial is detailed enough to understand the steps and use these steps in your own SNMP management pack!!!

SNMP Setup

First you need to make sure SNMP is setup correctly on both the management server and the NetApp filer(s). Without the correct setup we are not going to discover anything 😉

SNMP setup basically involves 2 parts the first part will be the Ops Mgr Server and the second part the device you want to monitor in our example the NetApp Filer. The second part of the procedure is the same for every SNMP device you want to monitor. Although the commands may differ the basics are the same.

  1. Setup SNMP on your Ops Mgr Server.

Navigate to your services MMC (Run Command “Services.msc”) now find the SNMP Service, if not available install the SNMP Service.

Control Panel –> Add/Remove Programs –> Add/Remove Windows Components. Now select  Management and Monitoring tools click details and select  Simple Management Network Protocol (or SNMP).

After installation you will have two services SNMP Service and SNMP Trap Service. The configuration needs to be done at the SNMP Service. Now open SNMP Service and navigate to security tab. Default setting is to only receive SNMP from the local host so we need to add the IP Address of the Device we want to discover / Monitor with Ops Mgr. Adding the device by Host Name, IP Address or IPX Address will allow communication from the SNMP device to Ops Mgr Server.

image

  1. If you have setup SNMP on the Management server you need to make sure SNMP is set on the NetApp side as well by adding the Ops Mgr server as a SNMP trap receiving server. Logon as root on your NetApp Simulator and run the command SNMP this should give you the current settings. SNMP ? will list you all command parameters. Below is a screen from adding the Ops Mgr server 192.168.112.12 and add a community name test.

image

Now your environment should consist of at least one NetApp Filer and your Ops Mgr environment with both the ability to send and receive SNMP traffic.

Now with this setup you should be able to install a SNMP tool on your management server. After the setup Import the NETWORK-APPLICANCE-MIB into your SNMP tool to be able to query the NetApp filer and be able to make up something of the OID’s and values. I used Ireasoning tool

image

When you have added the NETWORK-APPLICANCE-MIB  make sure you fill in the IP of your filer and the community name

Discovery

I will walk you through setting up the discoveries in a logical manner and in detail.

NetApp Filer

First we start with discovering the NetApp Filer which is the “easiest” one since we simply run the discovery on the class Microsoft.SystemCenter.NetworkDevice.

 image

Datasource

Let’s start with developing the DataSource for this discovery:

Simply go to Type Library in your authoring console and create a new datasource; NetApp.Management.Pack.DataSource.Discovery.Filer

Now give it a logical name like “Datasource to discover NetApp Filers

Next go to the Configuration Schema tab.

Here you can declare the parameters used to pass to the datasource.

The ones we are going to use are:

image

These will be the parameters that needed to be provided in the discovery rule in order for the datasource to run. All these parameters are referred to by $Config\

(We we are designing the discovery rule later on the reason will become more clear.)

Datasource part 1 Scheduler

 First the scheduler create a new Member module by Add.. and navigate to System.Discovery.Scheduler, give it a name like “Scheduler” leave the default settings and click OK.

imageimageimage

Now most of the times when using the authoring console it is much easier to edit the XML. Therefore open the just created scheduler by selecting it and click Edit.

Now these are the default settings for the scheduler:

image

We are going replace these settings with our newly created Parameter form the Configuration Schema Tab $Config/Interval$ (remember when there are $ signs used Ops Mgr will interpret the string as a parameter)

image

  <Interval Unit=”Seconds”>$Config/Interval$</Interval> <—————————-This is the Interval Parameter declared in the Configuration Schema Tab.

The scheduler will tell how often the discovery should run by configuring a parameter we will be able to change this when using overrides. This will make the MP much more flexible in terms of running discoveries.\

Datasource part 2 Filter

 This filter is used to check if we have the correct device OID. For NetApp Devices the OID always starts with .1.3.6.1.4.1.789

Add a new module and now select System.Expressionfilter

The default values are

image 

We are going to change the expression to a regex expression and filter the OID value on .1.3.6.1.4.1.789

In order to do this we need to change/ add the following:

image

 

<Value>$Config/SystemOID$</Value> <————————————————-This is the SystemOID Parameter we declared in the configuration schema tab.

<Pattern>1.3.6.1.4.1.789</Pattern> <——————————————————–The Enterprise OID for NetApp Appliances

 If A network device doesn’t contain this OID then it is not a NetApp device and therefore the datasource is stopped and the device is not discovered.

If it contains the OID we can go on with the next module the Probe itself.

 Datasource part 3 SNMP Probe

 Again follow the procedure to add a Module System.SnmpProbe and edit the module in xml.

The default values:

image

Now this is where we are going to declare which OID’s we want to discover form the device.

This is the moment we are going to use our SNMP browser to connect to the NetApp Filer and use net MIB to analyze which properties we want to discover of a NetApp Filer.

image image image

Above screenshots are the parts of the MIB we are going to use. (You are free to select any other property /OID you want)

First of all the first part should be familiar since these are the values you used in setting up SNMP on your NetApp Filer.

<IsWriteAction>false</IsWriteAction> <——————————————————-Needs to be false otherwise you are telling it to write instead of collect!

<IP>$Config/IP$</IP> <—————————————————————————-This is the IP address parameter declared in the Configuration Schema Tab.

<CommunityString>$Config/CommunityString$</CommunityString> <——————This is the Community name parameter we declared in the Configuration Schema Tab.

 image

OID MIB
.1.3.6.1.4.1.789.1.6.4.1.0 NetApp MIB OID for diskTotalCount
.1.3.6.1.4.1.789.1.5.9.0 NetApp MIB OID for volNumber
.1.3.6.1.4.1.789.1.5.12.0 NetApp MIB OID for aggrNumber
.1.3.6.1.4.1.789.1.1.7.0 NetApp MIB OID for ProductGuiUrl
.1.3.6.1.4.1.789.1.1.5.0 NetApp MIB OID for ProductModel

 Datasource part 4 Mapper

 Add a new module System.Discovery.FilteredClassSnapshotDataMapper. The default values for this mapper are:

image

Let’s change the default value’s to the value’s we are going to use:

 

image

The first part of the XML is the filter to be sure correct data is collected.

The Second part is the class we going to map the discovered properties to.

The Third part are all settings collected by the SNMP probe are mapped to the actual properties. (notice also the IPAddress is mapped since this is the key property of the Network Device.)

Rollup.

Now we have created our own datasource which we can use in the actual discovery rule. Creating a datasource is a very valuable way of authoring your own rules. It’s very flexible and you can manipulate the data the way you want. (Although there are some pointers regarding SNMP walk which we get into later)

The datasource contains of the following components

Scheduler How often should the discovery run?
Filter Is the target a NetApp Appliance?
SnmpProbe Collect Data.
Mapper Write output data to new discovered instance.

 Now we configure the actual discovery rule with ease.

Create a new discovery rule with a name like NetApp.Management.Pack.Discovery.NetApp.Filer and target the discovery at Microsoft.SystemCenter.NetworkDevice.

Discovered Classes will of course be NetApp Filer class.

Now the configuration Tab is the place where we are going to use the newly created datasource. Click Browse for a type and search for your datasource – NetApp.Management.Pack.DataSource.Discovery.Filer

image

When the correct datasource is selected this is the place where we find the parameters from the Configuration Schema tab of the datasource again!

Interval $Config/IntervalI$
IP $Config/IP$
CommunityString $Config/CommunityString$
SystemOID $Config/SystemOID$

 You can really simply fill in the correct settings by clearing the value and click the arrow as highlighted this way you can select the properties of the target we are using Microsoft.SystemCenter.NetworkDevice.

NetApp Aggregate

Now this one is getting more complicated. We are not going to the details again of creating the datasource. Instead we dive in at the part which is different to the previous one NetAppFiler. Add a datasource called NetApp.Management.Pack.Class.NetApp.Aggregate.

image

 Now again create the following modules:

Scheduler – System.Scheduler

Filter – System.ExpressionFilter

SnmpProbe – System.SnmpProbe

Mapper – System.Discovery.FilteredClassSnapshotDataMapper

 

Filter Settings: now we are filtering on OID 1.3.6.1.4.1.789.1.5.11.1.2.

SNMP Probe

Instead of just sending one “SNMP get” to do the discovery we are now going to use the “SNMP walk” feature specific to Ops. Mgr 2007 R2.

Again we are going to use the SNMP Browser tool to be able to tell which OID’s we are intrested in.

image

We are going to do a SNMP Walk on the OID .1.3.6.1.4.1.789.1.5.11.1.2. which translates into the aggrName.

By doing a walk we tell the SNMP probe to walk the aggrName OID index this means getting

 .1.3.6.1.4.1.789.1.5.11.1.2.1

.1.3.6.1.4.1.789.1.5.11.1.2.2

.1.3.6.1.4.1.789.1.5.11.1.2.3

and so on until the end of the index.

This will collect the OID’s and their values. (In this example we have three aggregates so three oid’s and their values are collected.

OID Value
.1.3.6.1.4.1.789.1.5.11.1.2.1 Aggregate Name 1
.1.3.6.1.4.1.789.1.5.11.1.2.2 Aggregate Name 2
.1.3.6.1.4.1.789.1.5.11.1.2.3 Aggregate Name 3

 In XML this will look like below:

image

Notice the settings added telling the SNMP probe to do a walk instead of just a get.

The Mapper Module looks the same as the discovery of the netapp Filer:

image

 Notice we also need to retrieve the IPAddress property of the NetworkDevice. This is required since the NetApp Aggregate is hosted by the filer. To be able to tell which filer hosts the aggregate we need to also retrieve the key property of the hosted class. If we leave out the key property of the hosted class in the discovery it won’t be able to tell where the discovered class instance is hosted and will not discover anything!

Also notice we declared a key property for the Aggregate which is AggrName, this property needs to be

After saving the datasource we now have a datasource to discover NetApp Aggregates! We only need to create a discovery rule and use our Aggregate discovery datasource in the discovery.

The procedure for creating the discovery rule is the same as the filer with the only difference we can now target the NetApp Filer. This means the discovery will only run on NetApp Filers.

Wrap Up:

We can now discover NetApp Filers and Aggregates!

 image  image

We can discover a NetApp Filer and all of it’s properties and also NetApp Aggregates with only 2 properties which are hosted by NetApp Filers.

 

Because of the complexity of the discoveries for discovering NetApp Aggregate properties and NetApp Volumes and Luns I will cover these in part 3 of this series.

Which will follow probably next week.

0 thoughts on “SNMP Management Pack Example: NetApp Management Pack for SCOM 2007 R2 part 2

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.