Prerequisites

  • The individual performing this installation has a bit of Linux experience.
  • Root access is available.

  • A working copy of NMIS (starting from an NMIS VM is a good idea, if you prefer to install it yourself see the NMIS 8 Installation Guide) on the same server that opTrend is being installed on.
  • An (evaluation) license for opTrend
NOTE: opTrend is currently in alpha.

Upgrade Steps

  • Download opTrend from the Opmantek website.
    Copy the opTrend tarball to the server in question, using scp or sftp or similar. Make a record of where you put the tarball (likely root's home directory).
  • Become root and unpack the tarball:

    # become root
    sudo sh
    # if the tarball was saved in a different location, adjust the following command 
    cd /tmp
    ./opTrend-Linux-x86_64-1.6.2.run
  • Start the interactive installer and follow its instructions

  • The installer will interactively guide you through the steps of installing opTrend. Please make sure to read the on-screen prompts carefully.
  • When the installer finishes, opTrend is installed into /usr/local/omk, and the default configuration files are in /usr/local/omk/conf, ready for your initial config adjustments.
  • A detailed log of the installation process is saved as /usr/local/omk/install.log, and subsequent upgrades or installations of other Opmantek products will add to that logfile.
  • For detailed information about the interactive installer please check the Opmantek Installer page.

Post Installation Steps

  1. Stop all optrend cron jobs by commenting them out

    vi /etc/cron.d/optrend
    ####
    # opTrend "collect" and "update"
    #*/5 * * * * root sleep 65; /usr/local/omk/bin/optrend.pl act=collect
    #0 0 * * 0   root /usr/local/omk/bin/optrend.pl act=update
  2. If the seds collection is capped it will need to be "uncapped" which is not a simple task.  Note, that if it has been capped for a while (and running WiredTiger) it will not have been working so your server will not have been working and the history is useless.  Note: the history can be recreated, 3 weeks worth is no problem.

    # first get into the mongo shell
    mongo -u opUserRW -p op42flow42 optrend
    
    
    // in the shell check if capped:
    db.seds.stats().capped
    true
    1. If you can handle losing the data take that path, it is possible to bring back old data, to drop the database the command is db.dropDatabase(), use this command very carefully, verify what you are dropping with the command db.getCollectionNames(), the result should be like below.

      OR use 

      db.seds.drop()

      db.ev_billboard.drop()

      db.seds_ev.drop()

      > db.getCollectionNames()
      [ "ev_billboard", "seds", "seds_ev" ]
    2. If not, use mongodump to dump just the seds collection, then drop the seds collection, then re-import the data to the seds collection which should bring it back un-capped
  3. Collections in opTrend are no longer capped, each entry is set to expire after 21 days.  This value is configurable, adjust opCommon: 'optrend_seds_expire_after_seconds'

  4. Set expire_at value on existing documents, if you have not existing documents skip this step, be sure to change the date to a date that makes sense for you

    # first get into the mongo shell
    mongo -u opUserRW -p op42flow42 optrend
     
    // then run these to commands to update, CHANGE THE DATE IN THEM FIRST!!!
    db.getCollection('seds').update(
        { expire_at: {$exists: false}}, 
        { $set: { expire_at: Date("2017-06-20T01:01:01")}},
        { multi: true }
     );
    db.getCollection('seds_ev').update(
        { expire_at: {$exists: false}}, 
        { $set: { expire_at: Date("2017-06-20T01:01:01")}},
        { multi: true }
     );
  5. opTrend documents for the current week need to be replaced with the newer format, to do this force an update which will replace them:

    /usr/local/omk/bin/optrend.pl act=update force=1
  6. If you have dropped/removed old data you can re-create it by running these commands: 

    /usr/local/omk/bin/optrend.pl act=update date="now - 3 week" force_end_of_week=1 force=1
    /usr/local/omk/bin/optrend.pl act=billboards date="now - 3 week" force_end_of_week=1 force=1
    /usr/local/omk/bin/optrend.pl act=update date="now - 2 week" force_end_of_week=1 force=1
    /usr/local/omk/bin/optrend.pl act=billboards date="now - 2 week" force_end_of_week=1 force=1
    /usr/local/omk/bin/optrend.pl act=update date="now - 1 week" force_end_of_week=1 force=1
    /usr/local/omk/bin/optrend.pl act=billboards date="now - 1 week" force_end_of_week=1 force=1
  7. Enable all optrend cron jobs by removing comments added in the first step: 

    vi /etc/cron.d/optrend
    ####
    # opTrend "collect" and "update"
    */5 * * * * root sleep 65; /usr/local/omk/bin/optrend.pl act=collect
    0 0 * * 0   root /usr/local/omk/bin/optrend.pl act=update
  • No labels