Thursday Aug 22, 2013

A little sample snmp module for Oracle VM Server 3.2

I was looking at snmp for a few days and decided to put together a little snmp module (extension) that would work on Oracle VM Server (3.2 and up). In 3.2 we started to include the net-snmp rpms to allow customers to monitor any given Oracle VM server with standard SNMP tools. Whether that be cacti, snmpwalk, even Oracle Enterprise Manager (snmp fetchlets) or whatever tool. The standard net-snmp installation will expose MIBs and return data pretty much exactly the same as what you would get when installing net-snmp on Oracle Linux and monitoring an Oracle Linux server.

The little snmp module I added exposes a few extra Oracle VM specific objects. To start with I basically looked at the data you can see on the local console of the server (version, cluster state, management uuid,...). I created a custom MIB (falls in the oracle enterprise oid range ( 1.3.6.1.4.1.111.57.1.1 – 1.3.6.1.4.1.111.57.1.13 )) and packaged it all up in a little RPM (ovs-snmp.rpm) that can be installed in dom0.

ovs-snmp is an extension to net-snmp. It is a dynamically loadable module that allows extra bits to be monitored in dom0 that are specific to Oracle VM. Once the RPM is installed, snmpd.conf must be updated to load the module at start of snmpd. When you restart the snmpd service, you then have access to an extra MIB.

This extra MIB is documented in /usr/share/snmp/mibs/OVS-MIB.txt The raw oid range for the OVS extension is from 1.3.6.1.4.1.111.57.1.1 – 1.3.6.1.4.1.111.57.1.13. The module also contains a trap at 1.3.6.1.4.1.111.57.2.0. The trap is defined around ovsAgentState (Running/Stopped) and will allow an admin to monitor the state of the Oracle VM Server agent which is a critical component of every server installed and get a notification from the snmpd.

If you copy the OVS-MIB.txt file over to another regular server and put the file in the same directory (/usr/share/snmp/mibs) then you can use the text version instead of the raw oid numbers. For instance : 1.3.6.1.4.1.111.57.1.1 is the same as : ORACLE-OVS-MIB::ovsType. This is more humanly readable.

The following set of attributes are defined in the MIB :

ovsType           : Oracle VM Server
ovsVersion        : Version of Oracle VM Server installed
ovsMaster         : Master node in serverpool?
ovsClusterState   : Cluster configured / online?
ovsClusterType    : NFS or Lun based
ovsClusterStorage : the nfs mount or lun used for the server pool filesystem
ovsManagerUUID    : UUID of the Oracle VM Manager instance
ovsServerpoolName : serverpool name this server is a member of (or None)
ovsServerpoolIP   : Virtual IP address of the serverpool master
ovsAgentState     : Agent running or stopped
ovsFreeMemory     : free memory available for Virtual Machines on this server
ovsHostname       : hostname as known by the Oracle VM Manager instance

vmTable           : table with an index listing all the currently running VMs
                    columns -> vmIndex, vmType

example snmpd.conf file:

# more /etc/snmp/snmpd.conf
rocommunity public
syslocation "hq"
dlmod ovs /usr/lib64/ovs-snmp/ovs.so

Some examples :

# snmpwalk -v 1 -c public -O e localhost ORACLE-OVS-MIB::ovsAgentState
ORACLE-OVS-MIB::ovsAgentState.0 = STRING: Running
# snmpwalk -v 1 -c public -O e localhost 1.3.6.1.4.1.111.57.1.1
SNMPv2-SMI::enterprises.111.57.1.1.0 = STRING: "Oracle VM Server
"
You can download the rpm from MOS, bug number is 17344092. At this point it's provided as-is, tech preview. Once I get some feedback on it we will consider integrating this.

have fun

About

Wim Coekaerts is the Senior Vice President of Linux and Virtualization Engineering for Oracle. He is responsible for Oracle's complete desktop to data center virtualization product line and the Oracle Linux support program.

You can follow him on Twitter at @wimcoekaerts

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today