Prerequisites

A working copy of NMIS that opExport can read and export the data from, and a running MySQL server.

Please note that there are some interoperability limitations present in opExport 1.6.7 and 1.6.8:

MySQL Database / User

To create a new mysql database you will need to run a command like this 

mysqladmin create opexport -u root -p

After creating a new database you will want to create a new user and grant them access to the new database:

mysql -u root -p
mysql> CREATE USER 'opexport'@'localhost' IDENTIFIED BY '42opexport42';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL ON opexport.* to 'opexport'@'localhost';
Query OK, 0 rows affected (0.01 sec) 

Installation Steps

NMIS server

Additional Steps for the MySQL Database server

Push the schema to all NMIS opExport Daemons

The server that holds the MySQL Database holds the master copy of the schema, in order for an NMIS server to export it's daemon requires a schema to be pushed to it.  NOTE: in this case the schema referred to is in opExport, not MySQL.  opExport will use it's schema to create the MySQL tables for you.

Each NMIS server that will export it's data must be able to access the MySQL server with a simple host name (no dots), so you may need to edit /etc/hosts and add entries to allow this.

Additionally, the MySQL server requires the same for all the NMIS servers that will push to it, so again you may need to add them to it's /etc/hosts file.

Next, check that the MySQL server has a schema configured.  From the dashboard loaded previously:

Or you can go directly to:

http://your.MySQL.server.name.or.ip:3000/omk/opExport/schemas?opexport_connection_key=key123

For each NMIS server you wish to have export you need to push the schema, in a web browser load the dashboard again:

http://your.MySQL.server.name.or.ip:3000/omk/opExport/?opexport_connection_key=key123

From here you can push the schema to each of your NMIS servers (which are running opExport).  To push the schema fill out the form and submit it:

You can now verify that each of the NMIS servers have the schema:

http://your.NMIS.server.name1.or.ip:3000/omk/opExport/schemas?opexport_connection_key=key123

 

Test SQL Server Connection

The daemon on the SQL server can be tested to ensure it can connect to the database.  

http://your.MySQL.server.name.or.ip:3000/omk/opExport/database_test_connect 

This should return a message that looks like this: 

{ 'message' => 'count of information_schema.tables: $VAR1 = [ [ \'32\' ] ]; ', 'success' => 'true' }

If it cannot connect you might see an error like this 

'Connection to database not found, database handle is null
Access denied for user \'opexport\'@\'localhost\' (using password: YES)'

Transferring Data

There are two ways to transfer, the MySQL server can "pull" the data, or the NMIS server can "push" the data.  You can load the dashboard from before (http://your.MySQL.server.name.or.ip:3000/omk/opExport/) to help you push/pull the data (the dashboard can also be loaded from the NMIS server) 

Data to be pushed is available from these schemas:

diskIOTable
ciscoConfig
interface
interfaceStatus
nmisConfig
nodeStatus
services
storage
system

interfacePerformance
ipslaPerformance 
systemPerformance
cbqosPerformance
upsPerformance 

The drop-down on in the dashboard should allow you to choose which schema you would like to pull.  If it is empty you the server does not have any schemas and requires them to be pushed to it from the opExport daemon on the MySQL server (see the installation instructions above for this). 

To transfer data we ask the MySQL server to get the data from NMIS and save it:

#with curl
curl -s "http://localhost:3000/omk/opExport/request/pull/?data_source=schema&node_source=NMIS_SERVER&data_source_name=system&opexport_connection_key=key123" &> /dev/null

 # or with wget:
/usr/bin/wget -qO- "http://localhost:3000/omk/opExport/request/pull/?data_source=schema&node_source=NMIS_SERVER&data_source_name=interfaceStatus&opexport_connection_key=key123" &> /dev/null

In CRON that might look something like this:

 

# On the MySQL Server: (so pulling, system data in this case)
*/5 * * * * /usr/bin/wget -qO- "http://localhost:3000/omk/opExport/request/pull/?data_source=schema&node_source=NMIS_SERVER&data_source_name=system&opexport_connection_key=key123" &> /dev/null

NOTE: This is an example, you will want to think about which data you want and how often you want to update it. Several wget lines will likely be required.

Monitoring opExport Activity

Tailing the logs:

# on NMIS server
tail -f /usr/local/omk/log/opExport.log

# on MySQL you can also watch the helper daemon
tail -f /usr/local/omk/log/helper_daemon.log    

 

Error checking

Logs are located in /usr/local/omk/log.  All logs are helpful in finding errors. opDaemon.log will show when there has been a 500 error.

Also make sure that you have accepted the EULA on the machine, that the opexport_connection_key has been set correctly and that the daemon has been restarted after any config changes!