Child pages
  • opExport Installation Guide

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
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

  • copy the tarball to the server, into your users home directory
  • untar the file into a location of your choice, the default location is /usr/local/omk 

  • copy the config files 
  • Code Block
    Code Block
    # make sure the omkd daemon is not running
    ps aux | grep opman
    kill <pid_of_opmantek>
    # start the install    
    cd /usr/local 
    tar xvf ~/tmp/opExport-Linux-x86_64-LIB-1.05.016.tar.gz
    cd omk
    cp ./install/opCommon.nmis ./conf/opCommon.nmis 
    cp ./install/users.dat ./conf/
    cp ./install/omkd.init.d /etc/init.d/omkd
    chkconfig --add omkd 
    -R nmis:nmis /usr/local/omk
  • Set the key that the daemons will use to verify each other, opexport_connection_key, in opCommon.nmis. The default key is opexport_connection_key=key123.
  • make sure the os_group and os_username in conf/opCommon.nmis exist and match the username used. (default is nmis/nmis)
  • # make sure the key is correct in opCommon, default is key123
    vi ./conf/opCommon.nmis
    service omkd start  
    # check to make sure it's running
    ps aux | grep opman
    root 16116 39.0 2.2 487632 283272 pts/0 R 05:39 6:47 opmantek.exe
    root 21118 0.0 0.0 103224 844 pts/0 S+ 05:56 0:00 grep opma   
  • Now load up the GUI and enter your license key and accept the EULA:
  • default username=nmis  password=nm1888
  • Code Block
  • Now PUSH the schema to the NMIS server

Additional Steps for the MySQL Database server

  • copy the schema files to the conf directory, this should ONLY be done on the MySQL server, not on the NMIS servers

  • All of the above instructions should be done, then stop the daemon again
  • Code Block
    cd /usr/local/omk  
    cp ./install/schema_set.json ./conf/ 
    cp ./install/export-* ./conf/
    -R nmis:nmis /usr/local/omk # enable the helper daemon
    vi ./conf/opCommon.nmis
    # search for this line:
    'opexport_run_helper_daemon' => 'false', # required for MySQL servers, should be off for all others
    # change it to true!
    'opexport_run_helper_daemon' => 'true', # required for MySQL servers, should be off for all others      
  • Add the mysql connection options to conf/opCommon.nmis, the defaults are listed below, note: Do this ONLY on the server hosting the MySQL, the daemons on the NMIS servers do not use these options
  • Code Block
    'opexport' => {
     'opexport_sql_db_host' => 'localhost',
     'opexport_sql_db_port' => '3306',
     'opexport_sql_db_name' => 'opexport',
     'opexport_sql_db_user' => 'opexport',
     'opexport_sql_db_password' => '42opexport42',
  • RESTART the

opExport daemon

This will need to be done on all of the servers, e.g. the MySQL Database server as well as all the NMIS servers that will be exporting data

  • daemon 

    Code Block
    service omkd 
Check that the all the daemons are running and that you can access them with the connection key that you configured (do this for all daemons you have configured), at this point you will need to enter your license key and accept the EULA:


Code Block
  • stop
    ps aux | grep opman
    # make sure it's not running
    service omkd start
    # verify the SQL database credentials by visiting 
  • MYSQL.
  • SERVER.NAME.or.ip:3000/omk/opExport/
  • database_

This will then load the opExport dashboard.


  • test_connect
    # the output should say something like this:
    { 'message' => 'count of information_schema.tables: $VAR1 = [ [ \'47\' ] ]; ', 'success' => 'true' }   

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:

Code Block

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

Code Block

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:

Code Block


Test SQL Server Connection

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

Code Block 

This should return a message that looks like this: 

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

If it cannot connect you might see an error like this 

Code Block
'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 ( 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:




The drop-down on in the dashboard should allow you to choose which schema you would like to push/ 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 run push or pull commands on the server you can also issue them directly to the file ( be sure to change the MySQL_server_name and NMIS_server_name in the commands below): 

Code Blockcd /usr/local/omk/script; ./ get "/opExport/push/

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

Code Block
#with curl
curl -s "http://localhost:3000/omk/opExport/request/pull/?data_source=schema&node_destinationsource=MySQLNMIS_server_nameSERVER&data_source_name=system?&opexport_connection_key=key123" ./ get "/opExport/&> /dev/null

 # or with wget:
/usr/bin/wget -qO- "http://localhost:3000/omk/opExport/request/pull/?data_source=schema&node_source=NMIS_server_nameSERVER&data_source_name=system?interfaceStatus&opexport_connection_key=key12key123" cd -; 
wget or curl can also be used if you prefer.  To do this on CRON you would add an entry like
&> /dev/null

In CRON that might look something like this:


Code Block
# 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_NAME&data_source_name=system?&opexport_connection_key=key12key123" &> /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.

It is also possible to run these commands in a script after NMIS has run a collect.  To do this create a file called in nmis8/conf, make it the package pp, and define a doPP function to run what you need

Monitoring opExport Activity

Activity can be monitored by viewing the logs, to work properly you will need a browser that supports websockets (Chrome, Firefox, or IE 10).  This link can also be found by clicking the "Views" drop-down in the menu of the dashboard.x

Code Block

This page will stay connected to the server and receive info from the server as it happensTailing the logs:

Code Block
# 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.  opDaemon. All logs are helpful in finding errors. opDaemon.log will show errors that have occured, opLog_plugin.log will show timing.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!