snmp management software LoriotProsnmp management software LoriotPro

Administrator Handbook
www.loriotpro.com

TOC

ODBC Server parameters tool

Introduction

LoriotPro allows you to store information (for example the received or sent events) in any ODBC compliant Database. LoriotPro do not provide a Database service but will support ODBC drivers provided with your preferred Database Engine.

Open Database Connectivity (ODBC) is a widely accepted application programming interface (API) for database access. It is based on the Call-Level Interface (CLI) specifications from X/Open and ISO/IEC for database APIs and uses Structured Query Language (SQL) as its database access language.

Warning : This support has been tested with a MySQL Database. Normally other database engine should work but we will not provide support on them.

Only the MYSQL 3.23.40-max version and its associated ODBC drivers will be supported.

Creating a Database

If you do not have a Database or if you want to use a dedicated Database, you have to create a new one . The following example will show you how to create a MYSQL Database.

Form he /bin directory of the MYSQL software type :

Mysql/bin>Mysqladmin create loriotpro

You could also use a third party tool like PhpMyAdmin to help you to create it.

Creating the LoriotPro Database with the PhpMyAdmin tool

Remark : We won’t approach in this chapter the settings of Database access rights.  For more information on the subject  and on MYSQL Database consult the WEB site http://www.mysql.com.

Installing the ODBC driver for MySQL

You should install the ODBC driver MyODBC 2.5 that fits with your Microsoft operating system. You will find all last version drivers and the documentation on the Web: http://www.mysql.com

DSN setting

To be able to use the LoriotPro ODBC functions you should have write access to a Database. This Database should contain the table with the right format. A file loriotpro_mysql_tables.sql located in the /bin directory of LoriotPro jelps you to create them.

To set the ODBC parameter, select from the main menu:

Configure> ODBC Server parameters…


Setting of ODBC Server parameters

The first time that you will be using this option, you will have to select an ODBC DSN linked to your Database.

What is a DSN: (Short for Data Source Name). Data Source Name provides connectivity to a database through an ODBC driver. The DSN contains database name, directory, database driver, UserID, password, and other information. Once you create a DSN for a particular database, you can use the DSN in an application to call information from the database.

There are three types of DSNs:

  1. System DSN -- can be used by anyone who has access to the machine. DSN info is stored in the registry.
  2. User DSN -- created for a specific user. Also stored in the registry.
  3. File DSN -- DSN info is stored in a text file with .DSN extension.

When the ‘ODBC Parameters  Server ’ is displayed, click ‘Select ODBC DSN’ button.


L’outil ODBC Server Parameters

A window appears with the list of available DSN. It is possible that you have no DSN predefined; in this case, you should create a new one. Otherwise, select the right one and perform the table creation procedure.


Sélection du DSN

Creating an ODBC DSN for a MySQL Database access

If your LoriotPro system does not yet have the ODBC manager installed you should beforehand install it. This program called ‘Microsoft Data Access Components’ is freely available on the Microsoft WEB site http://www.microsoft.com/data .

Warning : Regarding of your version of Operating system the configuration window could be different.

If the window is similar to this one, click on the NEW button


Creation of a new DSN

Select Next.

In the list, select the My SQL ODBC driver.

Select next.

Select Finish

Provide the specific information for ODBC MySQL drivers from TDX. Refer to the driver documentation and to http://www.mysql.com .

Select OK.

Your new DNS  is available in the list.

Select OK.

Back to our selection window, use the option refresh and select the MyLoriotPro DSN previously created.

Select OK.

If everything goes right, LoriotPro is now able to communicate with your Database using the ODBC driver. Communication data are displayed in this window.

If you do not have created the Database tables necessary for LoriotPro, you should click on ‘Generate Tables’. Anyway, a popup proposes you to do it by default.

Select Yes.

A file selection window appears, select the file that fits with your Database type, MYSQL  in our example.

If the button ‘Stop ODBC’ is displayed the DSN setting is finished. If you want to start the  ODBC support each time you start LoriotPro, check the option ‘Run ODBC at Startup’ and click ‘Save Options’.

If you answer NO the database access password will be asked each time that

you will start LoriotPro.

The file loriot.ini located in the /bin has been updated.

File : Loriot.ini

[ODBC]
ODBC on
ODBC_startup on
ODBC_source ODBC; DSN=MyLoriotPro; DB=LoriotPro; SERVER=127.0.0.1 ;UID=user ;PWD=user; PORT=; OPTION=2; STMT=;

Back to the LoriotPro main window, the status of your Database connection is displayed in the status bar, DB ON or DB OFF

Events are sent to the Event manager and inform you of the Database connection.

     Event number 9 notify a Database closing connection

    Event number 10 notify a Database opening connection

A Database could be shared by several LoriotPro distributed all over your Network.

Each LoriotPro system should be registered in the Database to allow a later Data sorting, based on the LoriotPro source address.

The creation of the entry is performed when you restart the LoriotPro.

Select Yes.

Warning : It is not possible to have in the Database two Loriotpro installed on different sites and having the same license. If you change the IP address of the system where your LoriotPro is installed, the Database entries corresponding to your License number will be modified.

Defining tables

By default, a table definition file is provided in a SQL format. However, it is possible to create these tables by using the following information. Consult the DB Administrator of your site to prepare and implement these tables in your existing Database server. Consult the www.loriotpro.com site where you will find complementary information.

Table of MySQL database tables

Table name

Definitions

Remarks

Loriot_managers

CREATE loriot_managers (

  l_id int(4) unsigned NOT NULL DEFAULT '0' ,

  l_name char(50) NOT NULL DEFAULT '' ,

  l_loriotkey char(32) NOT NULL DEFAULT '' ,

 l_ip int(4) unsigned NOT NULL DEFAULT '0' ,

  l_ip_addr char(15) NOT NULL DEFAULT '' ,

  l_version int(4) unsigned NOT NULL DEFAULT '0' ,

 l_http int(2) unsigned DEFAULT '0' ,

  PRIMARY KEY (l_id)

);

This table allows the differentiation of installed LoriotPro system that could access the database.

Loriot_host

CREATE TABLE loriot_hosts (

  l_host_id int(4) unsigned NOT NULL DEFAULT '0' ,

  l_ip_addr char(15) ,

  l_name char(100) NOT NULL DEFAULT '' ,

  l_mac char(18) NOT NULL DEFAULT '' ,

  l_groupref int(4) unsigned ,

  l_manager_id int(4) unsigned NOT NULL DEFAULT '0' ,

  l_polltimeout int(4) unsigned ,

  l_lastsnmppoll int(4) unsigned DEFAULT '0' ,

 l_lasticmppoll int(4) unsigned DEFAULT '0' ,

  PRIMARY KEY (l_host_id)

);

This table contains all the hosts exported from Loriotpro to the Database

loriot_networks

CREATE TABLE loriot_networks (

  l_network_id int(4) unsigned NOT NULL DEFAULT '0' ,

  l_mask int(4) unsigned NOT NULL DEFAULT '0' ,

  l_name char(100) NOT NULL DEFAULT '' ,

  l_ifdesc char(100) ,

  l_iftype char(100) ,

  l_speed int(8) unsigned ,

  l_manager_id int(4) unsigned NOT NULL DEFAULT '0' ,

  PRIMARY KEY (l_network_id)

);

This table contains all the hosts exported from Loriotpro to the Database

loriot_event

CREATE TABLE loriot_events (

  l_timestamp int(4) ,

  l_manager_id int(4) unsigned DEFAULT '0' ,

  l_reference int(4) unsigned DEFAULT '0' ,

  l_level int(4) unsigned DEFAULT '0' ,

  l_string char(255) DEFAULT '0' ,

  l_ip_agent_add char(15) NOT NULL DEFAULT '' ,

  l_ip_source_add char(15) NOT NULL DEFAULT '' ,

  l_number int(4) unsigned NOT NULL auto_increment,

  PRIMARY KEY (l_number),

  INDEX ref (l_manager_ l_id, l_reference, l_level, l_number, l_ip_agent_add)

);

This table contains all the Events stored by the Event manager in the Database

     

Loriot_netflow

CREATE TABLE loriot_netflow (

  l_number int(4) unsigned NOT NULL auto_increment,

  l_timestamp int(4) unsigned NOT NULL DEFAULT '0' ,

  l_sysuptime int(4) unsigned ,

  l_version int(1) unsigned ,

  l_host_id int(4) unsigned NOT NULL DEFAULT '0' ,

  l_engine_type int(1) unsigned ,

  l_engine_id int(1) unsigned ,

  l_ip_src char(15) ,

  l_ip_dst char(15) ,

  l_srcaddr int(4) unsigned ,

  l_dstaddr int(4) unsigned ,

  l_nexthop int(4) unsigned ,

  l_input int(2) unsigned ,

  l_output int(2) unsigned ,

  l_dPkts int(4) unsigned ,

  l_dOctets int(4) unsigned ,

  l_first int(4) unsigned ,

  l_last int(4) unsigned ,

  l_srcport int(2) unsigned ,

  l_dstport int(2) unsigned ,

  l_tcp_flags int(1) unsigned ,

  l_prot int(1) unsigned ,

  l_tos int(1) unsigned ,

  l_dst_as int(2) unsigned ,

  l_src_as int(2) unsigned ,

  l_dst_mask int(1) unsigned ,

  l_src_mask int(1) unsigned ,

  l_flow_sequence int(4) unsigned ,

  UNIQUE number (l_number, l_host_id, l_srcaddr, l_dstaddr, l_nexthop)

);

This table is used by the Service Plugin LoriotNetFlowCollectorService.sp.

This Plugin is an example provided with the SDK that demonstrate the use of ODBC functions and their implementation.

This Plugin works as a collector and gathers Netflow information from Cisco devices.


www.loriotpro.com
Copyright © 2004 LUTEUS SARL. All rights reserved. This documentation is copyrighted by LUTEUS SARL. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying or otherwise, without the prior express written permission of LUTEUS SARL