Index of /~romeo/lvs-snmp/ucd-snmp-lvs-module-0.0.1

      Name                    Last modified       Size  Description

[DIR] Parent Directory 03-Nov-2001 00:08 - [TXT] LICENSE 02-Nov-2001 23:14 18k [TXT] LVS-MIB.txt 02-Nov-2001 23:09 5k [TXT] Makefile 02-Nov-2001 23:15 1k [TXT] OC-MIB.txt 18-Okt-2001 00:55 1k [   ] ipvs-0.9.4.diff 02-Nov-2001 00:37 3k [TXT] lvs.c 01-Nov-2001 21:55 10k [TXT] lvs.h 02-Nov-2001 23:15 1k

GENERAL

ucd-snmpd-lvs-module 2th November 2001

This is free software.  See below for details.


WHAT IS IT ?

ucd-snmpd-lvs-module is a dynamicaly loadable shared object for the ucd-snmpd 
to get the configuration and some statistical information from the IP virtual
server services offered by the Linux kernel with IP virtual server support.
It's far from complete (only statistics on a per VIP basis, but not per 
realserver) but anyway have look at it and send me your suggestions or patches. 


INSTALL

Requirements:

1. KERNEL

To make, make sure your Linux kernel is already patched with IPVS and 
"make menuconfig" or "make xconfig" to setup the right compiling options, 
see the README of the virtual server patch for detail.


2. UCD-SNMP

install ucd-snmp (aka. net-snmpd) 4.2.2 with shared library support. 
I also recommend to have openssl so you can do snmp v3 with encryption

cd <ucd-source>
./configure --enable-shared
make
make install

http://net-snmp.sourceforge.net/



Installation steps:


1. correct verion of libipvs

This version of net-snmpd-lvs-module is developed with a enhanced version of
libipvs taken from the IPVS module package v0.9.4 for kernel 2.4. 
changes are trivial and can easily be ported to new versions of libipvs, it's 
just one method added to refresh a static variable. Have a look at the diff for 
details


get ipvs-0.9.4 (http://www.linux-vs.org/software/kernel-2.4/ipvs-0.9.4.tar.gz)


patch -p0 <ipvs-0.9.4.diff
cd <ipvs-0.9.4-patched>/ipvs/ipvsadm
make libs
make libs-install (if you do this by hand and move libs and headers to other 
			places you have to change include statements etc.)


2. install of ucd-snmpd-lvs-module

cd <ucd-snmp-lvs-module>
cp OC-MIB.txt and LVS-MIB.txt to your mibdir (/usr/local/share/snmp/mibs)

(I've taken oids from the private.enterprises subtree; openconnect is a company 
I work for, but the linux-vs could easily get its own oid subtree from iana.org 
and then reasign the oids)

make 
make install 	(if you do this by hand you have to change the place for the 
			lvs.so in snmpd.conf)

add the following line in your snmpd.conf (/usr/local/share/snmp/snmpd.conf)
dlmod lvs /usr/local/share/snmp/dlmodules/lvs.so  

add the following line in your snmp.conf (/usr/local/share/snmp/snmp.conf)
mibs +OC-MIB:LVS-MIB  



3. test your config


add some VIP and realserver with ipvsadm
(at least do a "insmod ip_vs")


start the snmpd:
/usr/local/sbin/snmpd  -f -V -L -Dlvs 

have a look for the following line in the output:
lvs: init lvs done

if this comes up everthing should be configured fine :-)


do an snmpwalk:
/usr/local/bin/snmpwalk -v 2c localhost public enterprises.opencon.lvs 

you should get something like this (if you loaded only the module but not 
defined any services you will get the first 3 line only) :

enterprises.opencon.lvs.lvsVersion.0 = "0.9.4"
enterprises.opencon.lvs.lvsNumServices.0 = 1
enterprises.opencon.lvs.lvsHashTableSize.0 = 4096
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceNumber.1 = 1
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceSchedType.1 = "wrr"
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceProto.1 = tcp(6)
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceAddr.1 = IpAddress: 192.168.123.191
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServicePort.1 = 22
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceFWMark.1 = undefined(0)
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServicePersistTimeout.1 = 0
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServicePersistNetmask.1 = IpAddress: 255.255.255.255
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceNumDests.1 = 1
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceStatsConns.1 = 1
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceStatsInPkts.1 = Counter32: 13
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceStatsOutPkts.1 = Counter32: 0
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceStatsInBytes.1 = Counter64: 912
enterprises.opencon.lvs.lvsServiceTable.lvsServiceEntry.lvsServiceStatsOutBytes.1 = Counter64: 0




Romeo Benzoni <rb@ssn.tp>


--------------------------------------------------------------------------

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

--------------------------------------------------------------------