Welcome to docs.opsview.com

Initial configuration database

There are two types of data that is imported at database configuration time:

  • Application specific tables
  • Configuration tables

Application specific information is imported as part of db_opsview.

Initial configuration information is done from import/initial_opsview.sql.

There is one problematic table - servicegroups - because it has foreign keys for embeddedservicechecks which is definitely an application table. You must ensure that servicegroups.id = 1 is “Opsview” and servicegroups.id=2 is “Network SNMP”. There is a test to ensure that is correct.

Limitations

If a plugin does not exist for a servicecheck, then the import process will fail.

Process for adding new plugins

  • Put file in opsview-core/nagios-plugins. Confirm that -h returns help page
  • svn add new plugin
  • Update opsview-core/nagios-plugins/filelist to include file
  • Run perl opsview-core/t/002filelist.t to confirm no missing files from filelist
  • Run cd opsview-core/nagios-plugins && make install to install plugins into libexec/ to test
  • Update CHANGES file to list new plugins
  • Commit changes

Process for updating the initial database

On an Opsview server, create a fresh install:

bin/db_opsview db_install

Make your changes. Reload (to check is okay and reset any uncommitted flags).

Save a new copy of the install script:

bin/db_opsview db_export_initial > import/initial_opsview.sql

Run an svn diff and make sure only the changes you expect have been altered:

svn diff import/initial_opsview.sql

Recreate the fresh install:

bin/db_opsview db_install

Check that the db has the changes you made. You can only do this on a development instance. Run the test script:

perl t/000setupdb.t

Update the CHANGES file.

Commit the changes.

Update the following pages if necessary

Troubleshooting

If your changes do not “stick”, the table maybe missing. See the list of configuration tables in the function db_export_initial in db_opsview.

If there are conflicting db schema changes, you may need to update the initial db file:

cd opsview-core
svn update -r {oldversion} bin/db_opsview
bin/db_opsview db_install
installer/upgradedb_opsview.pl
bin/db_opsview db_export_initial > import/initial_opsview.sql
bin/db_opsview db_install
prove t/000setupdb.t

Then commit the changed to import/initial_opsview.sql if everything is okay.

Reports database

This is mainly data. Update db_reports with the initial data.

Ensure you update installer/upgradedb_reports.pl with any data changes required. You may need to do conditional application of data, depending if values already set.