If you do not have a MongoDB installation yet, please follow the instructions in the MongoDB Installation Guide.
opConfig does not require any specific MongoDB setup, but you will have to provide opEvents with the correct MongoDB server information, database name and user name/password (if you use authentication). opConfig works best with the default database name "nmis
", and with MongoDB authentication enabled.
Transfer the opConfig tarball onto the server in question, either by direct download from the Opmantek website, or from your desktop with scp
or sftp
or a similar file transfer tool.
Make a record of where you put the tarball (root's home directory or /tmp
are good locations).
Become root
and unpack the tarball:
# become root sudo sh # if the tarball was saved in a different location, adjust the following command cd tar xzf opConfig-Linux-x86_64-2.0.0.tgz |
Start the interactive installer and follow its instructions:
sudo sh cd opConfig-2.0.0/ ./installer ++++++++++++++++++++++++++++++++++++++++++++++++++++++ opConfig (2.0.0) Installation script ++++++++++++++++++++++++++++++++++++++++++++++++++++++ This installer will install opConfig into /usr/local/omk. To select a different installation location please rerun the installer with the -t option. ... |
conf/opCommon.nmis
in an editor, go to the database section and change the server, username and password to reflect your MongoDB installation.'database' => { 'db_server' => 'localhost', 'db_port' => '27017', 'db_name' => 'nmis', 'db_username' => 'opUserRW', 'db_password' => 'op42flow42', }, |
http://<yourservername or ip address>/omk/opConfig/
, and until you have entered a valid license neither the opConfig GUI nor the CLI tools will operate.Setup Cron to perform the desired opConfig data collection periodically
opConfig's CLI tool opconfig-cli.pl
is responsible for performing such operations, and you should familiarize yourself with its capabilities: simply start it without any arguments, like this:
# you should generally run opconfig-cli.pl as root sudo /usr/local/omk/bin/opconfig-cli.pl opconfig-cli.pl Version 1.2.4 ... usage: opconfig-cli.pl act={discover|test_connect} node=nodeX opconfig-cli.pl act=import_from_nmis [nodes=nodeA,nodeB... opconfig-cli.pl act=run_command_sets [nodes=nodeA,nodeB...] [tags=tagA,tagB...] ... |
To perform periodic config collections, you should run opconfig-cli.pl act=run_command_sets
from cron. You can set this up either using crontab -e
(as root), or by creating a cron 'snippet file' in /etc/cron.d/
- Check your cron documentation for details about system-wide cron files.
Here is an example cron snippet called /etc/cron.d/opConfig:
# opConfig: hourly command set running 1 * * * * root /usr/local/omk/bin/opconfig-cli.pl quiet=1 act=run_command_sets tags=HOURLY >/dev/null # and the daily ones 7 7 * * * * root /usr/local/omk/bin/opconfig-cli.pl quiet=1 act=run_command_sets tags=DAILY >/dev/null # and a daily import from open-audit enterprise 21 4 * * * root /usr/local/opmojo/bin/opconfig-cli.pl quiet=1 act=import_audit |
Please feel free to leave comments and suggestions below!