...
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/ # 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 daemon
Code Block service omkd stop ps aux | grep opman # make sure it's not running service omkd start # verify the SQL database credentials by visiting http://your.MYSQL.SERVER.NAME.or.ip:3000/omk/opExport/database_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 |
---|
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:
Code Block |
---|
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:
Code Block |
---|
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.
Code Block |
---|
http://your.MySQL.server.name.or.ip:3000/omk/opExport/database_test_connect |
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 (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:
Code Block |
---|
#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:
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&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:
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. 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!