Parallel opReports Solution: New platform opReports 3.5.2 running in parallel with old platform OMK Apps including opReports 3.2.0

Introduction

Opmantek applications' released on or after 30 Sept 2020 will work on Opmantek's latest and fastest platform, however, earlier installed products are incompatible with this new platform.

This solution was needed as NMIS 8.6.7G1, opReports 3.2.0 and other Opmantek applications released prior to 30 September were installed on server(s).
However, opReports 3.5.2 was needed to improve the Node Health Report prior to opReports 3.5.2


Install parallel opReports 3.5.2 to /opt/omk/

opReports 3.2.0 and other Opmantek applications released prior to 30 September were installed on server(s) at /usr/local/omk/

opReports 3.5.2 was then installed at /opt/omk/ as follows:

  • Move the tar archive opReports-3.5.2-standalone.tar.gz, provided by Opmantek for this purpose, to /opt/ directory on server to be deployed to; 
  • Then deploy:

    /opt/

    cd /opt/
    # sudo mv /tmp/opReports-3.5.2-standalone.tar.gz /opt/
     
    # uncompress to ./omk/ and set owner and group on directory structure
    sudo tar -xzvf opReports-3.5.2-standalone.tar.gz
    sudo chown -R root:nmis /opt/omk/
     
    # verify
    cd omk/
    ls -lah
    total 52K
    drwxr-xr-x. 9 root nmis 4.0K Mar 30 00:36 .
    drwxr-xr-x. 4 root root 4.0K Mar 30 20:06 ..
    drwxrwsr-x. 3 root nmis 4.0K Mar 29 02:21 bin
    drwxr-xr-x. 3 root nmis 4.0K Mar 30 00:06 conf
    drwxr-xr-x. 4 root nmis 4.0K Mar 30 16:57 install
    -rw-r--r--. 1 root nmis  16K Mar 29 22:09 LICENSE
    drwxr-xr-x. 2 root nmis 4.0K Mar 30 00:40 log
    drwxr-xr-x. 3 root nmis 4.0K Mar 29 22:09 public
    drwxr-xr-x. 8 root nmis 4.0K Mar 29 22:42 templates
    drwxr-xr-x. 3 root nmis 4.0K Mar 30 00:40 var
     

    # Move scripts needed by opReports from the ./bin/install/ directory to the ./bin/ directory:
    sudo mv bin/install/oplicense-cli-standalone.* bin/
    sudo mv bin/install/opreports-cli-standalone.* bin/
    sudo mv bin/install/opreports-scheduler-standalone.* bin/


    # verify bin directory

    ls -lah bin/
    total 136M
    drwxrwsr-x. 3 root nmis 4.0K Mar 29 02:21 .
    drwxr-xr-x. 9 root nmis 4.0K Mar 30 00:36 ..
    drwxr-sr-x. 2 root nmis 4.0K Mar 29 02:21 install
    lrwxrwxrwx. 1 root nmis   23 Mar 30 20:06 oplicense-cli-standalone.exe -> opmantek-standalone.exe
    lrwxrwxrwx. 1 root nmis   23 Mar 30 20:06 oplicense-cli-standalone.pl -> opmantek-standalone.exe
    -rwxr-xr-x. 1 root nmis 136M Mar 26 01:53 opmantek-standalone.exe
    lrwxrwxrwx. 1 root nmis   23 Mar 30 20:06 opmantek-standalone.pl -> opmantek-standalone.exe
    lrwxrwxrwx. 1 root nmis   23 Mar 30 20:06 opreports-cli-standalone.exe -> opmantek-standalone.exe
    lrwxrwxrwx. 1 root nmis   23 Mar 30 20:06 opreports-cli-standalone.pl -> opmantek-standalone.exe
    lrwxrwxrwx. 1 root nmis   23 Mar 30 20:06 opreports-scheduler-standalone.exe -> opmantek-standalone.exe
    lrwxrwxrwx. 1 root nmis   23 Mar 30 20:06 opreports-scheduler-standalone.pl -> opmantek-standalone.exe
     
    # clean
    sudo rm ../opt/opReports-3.5.2-standalone.tar.gz
     
    # copy our proxy config into position:
    #   If Debian or Ubuntu we would now:
    #
    #       [ -d "/etc/apache2/conf.d" ] && sudo cp install/05omk-standalone-proxy.conf /etc/apache2/conf.d/
    #       OR
    #       # newer apache: different location, and use a2enmod
    #       [ -d "/etc/apache2/conf-available" ] && sudo cp install/05omk-standalone-proxy.conf /etc/apache2/conf-available/
    #       [ -d "/etc/apache2/conf-available" ] && sudo a2enmod proxy
    #       [ -d "/etc/apache2/conf-available" ] && sudo a2enmod proxy_http
    #       [ -d "/etc/apache2/conf-available" ] && sudo a2enmod headers
    #       [ -d "/etc/apache2/conf-available" ] && sudo a2enconf 05omk-standalone-proxy.conf
    #
    #       sudo service apache2 restart
    #
    #   If Centos or RHEL:
    #       sudo cp install/05omk-standalone-proxy.conf /etc/httpd/conf.d/
    #       sudo service httpd restart
     
    # set up the opReports 3.5.2 cron-jobs
    # first we verify current status:
    sudo ls -lah /etc/cron.d/
    total 36K
    drwxr-xr-x.  2 root root 4.0K Mar 30 21:04 .
    drwxr-xr-x. 75 root root 4.0K Mar 30 17:59 ..
    -rw-r--r--.  1 root root  113 Aug 23  2016 0hourly
    -rw-r--r--.  1 root root 1.6K Mar 29 00:24 nmis
    -rw-r--r--.  1 root root  168 Mar 29 00:55 oplicense
    -rw-r--r--.  1 root root  164 Mar 29 00:55 opreports
    -rw-------.  1 root root  108 Jan 26  2017 raid-check
    -rw-------.  1 root root  235 Jun 26  2018 sysstat
     
    # oplicense-standalone cron file
    sudo cp install/cron.d/oplicense-standalone /etc/cron.d/
     
    # we replace the opReports 3.2.0 cron file with the opReports 3.5.2 copy - that executes opReports 3.5.2 executable:
    sudo mv -f /etc/cron.d/opreports /usr/local/omk/install/cron.d/opreports_WAS_ACTIVE
    sudo cp -f install/cron.d/opreports /etc/cron.d/opreports
    # verify:
    sudo cat /etc/cron.d/opreports
    # this cron schedule runs the opReports scheduler every 5 minutes
    #
    # m h dom month dow user command
    */5 * * * *   root /opt/omk/bin/opreports-scheduler-standalone.exe
     
    # cleanup by disabling opReports 3.2.0 cli executable
    sudo mv /usr/local/omk/bin/opreports-cli.exe /usr/local/omk/bin/opreports-cli.exe.DISABLED
    sudo rm /usr/local/omk/bin/opreports-cli.pl
     
    # cleanup by disabling opReports 3.2.0 scheduler executable
    sudo mv /usr/local/omk/bin/opreports-scheduler.exe /usr/local/omk/bin/opreports-scheduler.exe.DISABLED
    sudo rm /usr/local/omk/bin/opreports-scheduler.pl


    # activate license at /opt/omk/conf/opLicense.nmis


    # run the opreports 3.5.2 scheduler manually to verify all ok

    sudo /opt/omk/bin/opreports-scheduler-standalone.exe --debug=1
     
    # run the opreports 3.5.2 cli manually to verify all ok - note we are generating report at opReports 3.2.0 directory /usr/local/omk/var/reports/on-demand/
    sudo ./bin/opreports-cli-standalone.exe type=config start_date="now - 7 days" end_date="now" node_regex=.* format=html format=csv format=xlsx output_dir=/usr/local/omk/var/reports/on-demand/ debug=1



Food for thought: Experimental (untested) suggestions

  1. Implement the omkd-standalone service on port 8043:

    # set up init.d service (opReports-3.5.2-standalone.tar.gz was built on a VM with systemd
    # - hence the '.bak' in filename at this stage: install/omkd-standalone.init.d.bak)
    # - we copy to /etc/init.d and rename file to omkd-standalone
    sudo cp install/omkd-standalone.init.d.bak /etc/init.d/omkd-standalone
    # on Debian or Ubuntu we would now:
    #       sudo update-rc.d omkd-standalone defaults
    # but we are on Centos, so:
    sudo chkconfig --add omkd-standalone
    sudo chkconfig omkd-standalone on
     
    sudo service omkd-standalone start

  2. This suggestion requires implementation of omkd-standalone service on port 8043 as per Point 1. immediately above.
    This suggestion should integrate omkd.service and omkd-standalone service better - with opReports 3.5.2 seamlessly replacing opReports 3.2 in the GUI.
    Replaces /etc/apache2/conf.d/05omk-standalone-proxy.conf with this /etc/apache2/conf.d/03omk-standalone-proxy.conf

    sudo rm /etc/apache2/conf.d/05omk-standalone-proxy.conf
     
    # this is one copy and paste command - up to 'EOF' about 3 lines from the end of this code block:
    #
    sudo cat > /etc/httpd/conf.d/03omk-standalone-proxy.conf <<EOF
    ## For more information on the listed Apache features please consult:
    ## http://httpd.apache.org/docs/
     
    # Don't forget to restart the daemon if you make changes to this configuration file1
    # apachectl restart
     
    <IfModule mod_proxy.c>
    ProxyRequests off
     
    <IfModule mod_headers.c>
    # if you are using the Opmantek applications behind an ssl-terminating apache vhost,
    # then you should adjust the vhost configuration to add this header but with
    # protocol "https".
    # The Opmantek applications are location- and protocol-independent in almost all cases.
    RequestHeader set X-Forwarded-Proto "http"
    </IfModule>
     
    <Location "/omk/opReports">
        ProxyPass http://localhost:8043/omk/opReports retry=5
        ProxyPassReverse http://localhost:8043/omk/opReports
                    ErrorDocument 503 '<html><head><meta http-equiv="refresh" content="60"></head><body><h1>Temporary Service Interruption</h1>The requested OMK page should be back soon. This page will automaticall$
    </Location>
     
    <Location "/omk">
        ProxyPass http://localhost:8042/omk retry=5
        ProxyPassReverse http://localhost:8042/omk
                   ErrorDocument 503 '<html><head><meta http-equiv="refresh" content="60"></head><body><h1>Temporary Service Interruption</h1>The requested OMK page should be back soon. This page will automaticall$
    </Location>
     
    # the first location directive only covers /omk and /omk/something,
    # not /omk.json
    <Location "/omk.json">
        ProxyPass http://localhost:8043/omk.json retry=5
        ProxyPassReverse http://localhost:8043/omk.json
    </Location>
     
     
    <Location "/es/omk/opReports">
        ProxyPass http://localhost:8043/es/omk/opReports retry=5
        ProxyPassReverse http://localhost:8043/es/omk/opReports
            ErrorDocument 503 '<html><head><meta http-equiv="refresh" content="60"></head><body><h1>Temporary Service Interruption</h1>The requested OMK page should be back soon. This page will automatically reload in 60 seconds.</body></html>'
    </Location>
     
    <Location "/en/omk/opReports">
        ProxyPass http://localhost:8043/en/omk/opReports retry=5
        ProxyPassReverse http://localhost:8043/en/omk/opReports
            ErrorDocument 503 '<html><head><meta http-equiv="refresh" content="60"></head><body><h1>Temporary Service Interruption</h1>The requested OMK page should be back soon. This page will automatically reload in 60 seconds.</body></html>'
    </Location>
     
    <Location "/pt/omk/opReports">
        ProxyPass http://localhost:8043/pt/omk/opReports retry=5
        ProxyPassReverse http://localhost:8043/pt/omk/opReports
            ErrorDocument 503 '<html><head><meta http-equiv="refresh" content="60"></head><body><h1>Temporary Service Interruption</h1>The requested OMK page should be back soon. This page will automatically reload in 60 seconds.</body></html>'
    </Location>
     
     
    <Location "/es">
        ProxyPass http://localhost:8042/es retry=5
        ProxyPassReverse http://localhost:8042/es
            ErrorDocument 503 '<html><head><meta http-equiv="refresh" content="60"></head><body><h1>Temporary Service Interruption</h1>The requested OMK page should be back soon. This page will automatically reload in 60 seconds.</body></html>'
    </Location>
     
    <Location "/en">
        ProxyPass http://localhost:8042/en retry=5
        ProxyPassReverse http://localhost:8042/en
            ErrorDocument 503 '<html><head><meta http-equiv="refresh" content="60"></head><body><h1>Temporary Service Interruption</h1>The requested OMK page should be back soon. This page will automatically reload in 60 seconds.</body></html>'
    </Location>
     
    <Location "/pt">
        ProxyPass http://localhost:8042/pt retry=5
        ProxyPassReverse http://localhost:8042/pt
            ErrorDocument 503 '<html><head><meta http-equiv="refresh" content="60"></head><body><h1>Temporary Service Interruption</h1>The requested OMK page should be back soon. This page will automatically reload in 60 seconds.</body></html>'
    </Location>
     
    </IfModule>
     
    EOF
    #
    # this is the end of the above copy and paste command - which starts with 'sudo cat > /etc/httpd/conf.d/03omk-standalone-proxy.conf <<EOF'
     
    # restart Apache
    sudo service httpd restart


How opReports-3.5.2-standalone.tar.gz was built

opReports-3.5.2-standalone.tar.gz was created as follows:

  • Install NMIS8 at /usr/local/nmis8 on a new VM with desired operating system created for the purpose of assembling opReports-3.5.2-standalone.tar.gz

  • Install the needed version of opReports at the default install directory /usr/local/omk
    • In this case we checked out git tag opReports-3.5.2 and built standalone opReports:

      sudo ./build/make_opreports_standalone_release 3.5.2 2
    • The above command generates both the normal opReports installer runfile and leaves a directory on snotra3 /usr/local/opmojo_abi3/standalone_bin/ which contains the standalone binary and symbolic links in the snotra3 /usr/local/opmojo_abi3/standalone_bin/install/ directory that represent the standalone scripts that replace the /usr/local/opmojo_abi3/bin/ scripts in a standalone installation as set out in the next code box.

  • Create our custom install of opReports at /opt/omk


    /opt/

    cd /opt
    sudo cp -rf /usr/local/omk /opt
    sudo chown -R root:nmis /opt/omk
     
    cd /opt/omk/
    # make sure we are in /opt/omk/
    pwd
    /opt/omk
     
    # clean up
    sudo rm -rf ./{log/*,var/*,bin,lib/,script/,manifest,install.log}
     
    # fetch specially built standalone binaries and uncompress to /opt/omk/bin-standalone/ directory - which we then rename to ./bin/ directory:
    sudo tar -xzvf opReports-3.5.2-standalone_bin.tar.gz
    sudo rm opReports-3.5.2-standalone_bin.tar.gz
    sudo mv standalone_bin bin
     
    # verify the files we are going to edit (change directory from /usr/local/omk to /opt/omk)
    sudo grep -arRnF "/usr/local/omk" "/opt/omk" 2>&1|grep -v /opt/omk/bin/install/
    /opt/omk/install/opconfigd.service.bak:20:ExecStart=/usr/local/omk/bin/opconfigd.pl
    /opt/omk/install/cron.d/opreports:4:*/5 * * * *   root /usr/local/omk/bin/opreports-scheduler.exe
    /opt/omk/install/cron.d/oplicense:4:8 5 * * *   root    /usr/local/omk/bin/oplicense-cli.pl act=refresh_bundle_licenses quiet=1
    /opt/omk/install/opeventsd.service.bak:20:ExecStart=/usr/local/omk/bin/opeventsd.pl
    /opt/omk/install/opCommon.nmis:27:    '<omk_base>' => '/usr/local/omk',
    /opt/omk/install/omkd.init.d.bak:26:DAEMON=/usr/local/omk/script/opmantek.pl
    /opt/omk/install/omkd.service:20:ExecStart=/usr/local/omk/script/opmantek.pl -f -p /var/run/opmantek.exe.pid -r
    /opt/omk/install/omk-rotate.conf:8:/usr/local/omk/log/*.log
    /opt/omk/install/omk-rotate.conf:27:/usr/local/omk/log/snow_api.log
    /opt/omk/install/opflowd.service.bak:20:ExecStart=/usr/local/omk/bin/opflowd.pl
    /opt/omk/install/opchartsd.service.bak:20:ExecStart=/usr/local/omk/bin/opchartsd.pl
    /opt/omk/install/schedule/example_snapshot.json:6:  "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/install/schedule/health-businesshours.json:10:  "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/install/schedule/monthly_qos.json:11:  "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/install/schedule/weekend.json:11:  "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/install/schedule/daily.json:16:  "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/install/schedule/util_oneoff.json:12:  "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/conf/opeventsd.service:20:ExecStart=/usr/local/omk/bin/opeventsd.pl
    /opt/omk/conf/opconfigd.service:20:ExecStart=/usr/local/omk/bin/opconfigd.pl
    /opt/omk/conf/opCommon.nmis:35:    '<omk_base>' => '/usr/local/omk',
    /opt/omk/conf/opflowd.service:20:ExecStart=/usr/local/omk/bin/opflowd.pl
    /opt/omk/conf/opCommon.nmis.prepatch:27:    '<omk_base>' => '/usr/local/omk',
    /opt/omk/conf/omkd.service:20:ExecStart=/usr/local/omk/script/opmantek.pl -f -p /var/run/opmantek.exe.pid -r
    /opt/omk/conf/omk-rotate.conf:8:/usr/local/omk/log/*.log
    /opt/omk/conf/omk-rotate.conf:27:/usr/local/omk/log/snow_api.log
    /opt/omk/conf/opchartsd.service:20:ExecStart=/usr/local/omk/bin/opchartsd.pl
    /opt/omk/conf/omkd.init.d:26:DAEMON=/usr/local/omk/script/opmantek.pl
    /opt/omk/conf/schedule/example_snapshot.json:84:   "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/conf/schedule/health-businesshours.json:13:   "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/conf/schedule/monthly_qos.json:2:   "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/conf/schedule/weekend.json:25:   "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/conf/schedule/daily.json:28:   "outputdir" : "/usr/local/omk/var/reports"
    /opt/omk/conf/schedule/util_oneoff.json:10:   "outputdir" : "/usr/local/omk/var/reports",
    /opt/omk/templates/unauthorised.html.ep:37:% my $log_dir = $self->config->{'<omk_logs>'} || "/usr/local/omk/logs/";
    /opt/omk/templates/unauthorised.html.ep:38:% my $conf_dir = $self->config->{'<omk_conf>'} || "/usr/local/omk/conf";
    /opt/omk/templates/unauthorised.html.ep:39:% my $base_dir = $self->config->{'<omk_base>'} || "/usr/local/omk/";
    /opt/omk/templates/exception.html.ep:38:% my $log_dir = $self->config->{'<omk_logs>'} || "/usr/local/omk/logs/";
    /opt/omk/templates/exception.html.ep:39:% my $conf_dir = $self->config->{'<omk_conf>'} || "/usr/local/omk/conf";
    /opt/omk/templates/exception.html.ep:40:% my $base_dir = $self->config->{'<omk_base>'} || "/usr/local/omk/";
    /opt/omk/templates/not_found.production.html.ep:38:% my $log_dir = $self->config->{'<omk_logs>'} || "/usr/local/omk/logs/";
    /opt/omk/templates/not_found.production.html.ep:39:% my $conf_dir = $self->config->{'<omk_conf>'} || "/usr/local/omk/conf";
    /opt/omk/templates/not_found.production.html.ep:40:% my $base_dir = $self->config->{'<omk_base>'} || "/usr/local/omk/";
     
    # edit the above files:
    sudo sh -c 'grep -arRnFl "/usr/local/omk" "/opt/omk/" 2>&1|grep -v /opt/omk/bin/install/|while read LINE; do sed -i "s!/usr/local/omk!/opt/omk!g" "${LINE}";done;'
     
    # verify all files have been edited - returns nothing if all references to /usr/local/omk have been corrected to /opt/omk
    sudo grep -arRnF "/usr/local/omk" "/opt/omk" 2>&1|grep -v /opt/omk/bin/install/
     
    # edit executable names in /opt/omk/install directory - our executables are all changed from old.pl to old-standalone.pl and old.exe to old-standalone.exe:
    # verify the files that may need editing:

    sudo grep -arRnF "/opt/omk" /opt/omk/install/
    /opt/omk/install/opconfigd.service.bak:20:ExecStart=/opt/omk/bin/opconfigd.pl
    /opt/omk/install/cron.d/opreports:4:*/5 * * * *   root /opt/omk/bin/opreports-scheduler.exe
    /opt/omk/install/cron.d/oplicense:4:8 5 * * *   root    /opt/omk/bin/oplicense-cli.pl act=refresh_bundle_licenses quiet=1
    /opt/omk/install/opeventsd.service.bak:20:ExecStart=/opt/omk/bin/opeventsd.pl
    /opt/omk/install/opCommon.nmis:27:    '<omk_base>' => '/opt/omk/',
    /opt/omk/install/omkd.init.d.bak:26:DAEMON=/opt/omk/script/opmantek.pl
    /opt/omk/install/omkd.service:20:ExecStart=/opt/omk/script/opmantek.pl -f -p /var/run/opmantek.exe.pid -r
    /opt/omk/install/omk-rotate.conf:8:/opt/omk/log/*.log
    /opt/omk/install/omk-rotate.conf:27:/opt/omk/log/snow_api.log
    /opt/omk/install/opflowd.service.bak:20:ExecStart=/opt/omk/bin/opflowd.pl
    /opt/omk/install/opchartsd.service.bak:20:ExecStart=/opt/omk/bin/opchartsd.pl
    /opt/omk/install/schedule/example_snapshot.json:6:  "outputdir" : "/opt/omk/var/reports",
    /opt/omk/install/schedule/health-businesshours.json:10:  "outputdir" : "/opt/omk/var/reports",
    /opt/omk/install/schedule/monthly_qos.json:11:  "outputdir" : "/opt/omk/var/reports",
    /opt/omk/install/schedule/weekend.json:11:  "outputdir" : "/opt/omk/var/reports",
    /opt/omk/install/schedule/daily.json:16:  "outputdir" : "/opt/omk/var/reports",
    /opt/omk/install/schedule/util_oneoff.json:12:  "outputdir" : "/opt/omk/var/reports",
     
    # edit the daemons at /opt/omk/install/*.service*
    sudo sh -c "echo \"$(for DAEMON in 'opchartsd' 'opconfigd' 'opeventsd' 'opflowd'; do sudo sed -i 's!/'"${DAEMON}"'\.!/'"${DAEMON}"'-standalone.!g' "/opt/omk/install/${DAEMON}.service"*;done;)\";"

    # edit /opt/omk/install/omkd.service
    sudo sed -i -e 's!/script/!/bin/!g' -e 's!opmantek\.pl!opmantek-standalone.pl!g' -e 's!opmantek\.exe!opmantek-standalone.exe!g' /opt/omk/install/omkd.service;
    sudo sed -i -e 's!/script/!/bin/!g' -e 's!opmantek\.pl!opmantek-standalone.pl!g' -e 's!opmantek\.exe!opmantek-standalone.exe!g' /opt/omk/install/omkd.init*;
     
    # edit cronjobs
    sudo sed -i -e 's!/opt/omk/bin/opreports-scheduler.pl!/opt/omk/bin/opreports-scheduler-standalone.pl!g' -e 's!/opt/omk/bin/opreports-scheduler.exe!/opt/omk/bin/opreports-scheduler-standalone.exe!g' /opt/omk/install/cron.d/opreports;
    sudo sed -i -e 's!/opt/omk/bin/oplicense-cli.pl!/opt/omk/bin/oplicense-cli-standalone.pl!g' -e 's!/opt/omk/bin/oplicense-cli.exe!/opt/omk/bin/oplicense-cli-standalone.exe!g' /opt/omk/install/cron.d/oplicense;
     
    # prevent a clash on filenames where we can have two systemd services:
    sudo mv /opt/omk/install/omkd.service /opt/omk/install/omkd-standalone.service
     
    # prevent a clash on filenames where we can have two initd services:
    sudo mv /opt/omk/install/omkd.init.d.bak /opt/omk/install/omkd-standalone.init.d.bak
     
    # prevent a clash on filenames where we can have two cron files:
    sudo mv /opt/omk/install/cron.d/oplicense /opt/omk/install/cron.d/oplicense-standalone
     
    # verify our edits are complete:
    sudo grep -arRnF "/opt/omk" /opt/omk/install/
    /opt/omk/install/opconfigd.service.bak:20:ExecStart=/opt/omk/bin/opconfigd-standalone.pl
    /opt/omk/install/cron.d/opreports:4:*/5 * * * *   root /opt/omk/bin/opreports-scheduler-standalone.exe
    /opt/omk/install/cron.d/oplicense-standalone:4:8 5 * * *    root    /opt/omk/bin/oplicense-cli-standalone.pl act=refresh_bundle_licenses quiet=1
    /opt/omk/install/opeventsd.service.bak:20:ExecStart=/opt/omk/bin/opeventsd-standalone.pl
    /opt/omk/install/opCommon.nmis:27:    '<omk_base>' => '/opt/omk/',
    /opt/omk/install/omkd-standalone.service:20:ExecStart=/opt/omk/bin/opmantek-standalone.pl -f -p /var/run/opmantek-standalone.exe.pid -r
    /opt/omk/install/omk-rotate.conf:8:/opt/omk/log/*.log
    /opt/omk/install/omk-rotate.conf:27:/opt/omk/log/snow_api.log
    /opt/omk/install/opflowd.service.bak:20:ExecStart=/opt/omk/bin/opflowd-standalone.pl
    /opt/omk/install/opchartsd.service.bak:20:ExecStart=/opt/omk/bin/opchartsd-standalone.pl
    /opt/omk/install/omkd-standalone.init.d.bak:26:DAEMON=/opt/omk/bin/opmantek-standalone.pl
    /opt/omk/install/schedule/example_snapshot.json:6:  "outputdir" : "/opt/omk/var/reports",
    /opt/omk/install/schedule/health-businesshours.json:10:  "outputdir" : "/opt/omk/var/reports",
    /opt/omk/install/schedule/monthly_qos.json:11:  "outputdir" : "/opt/omk/var/reports",
    /opt/omk/install/schedule/weekend.json:11:  "outputdir" : "/opt/omk/var/reports",
    /opt/omk/install/schedule/daily.json:16:  "outputdir" : "/opt/omk/var/reports",
    /opt/omk/install/schedule/util_oneoff.json:12:  "outputdir" : "/opt/omk/var/reports",
     
    # yes, they are
     
    # now some final fine tuning
     
    # we want opCommon.nmis configurations to point at '/usr/local/omk/var/reports'
    # so that opreports-cli-standalone.exe and opreports-scheduler-standalone.exe generated reports are placed at this location:
     
    sudo /usr/local/omk/bin/patch_config.exe -f /opt/omk/install/opCommon.nmis /directories/'<omk_reports>'='/usr/local/omk/var/reports'
    Operating on config file: /opt/omk/install/opCommon.nmis
    Patching values for keys /directories/<omk_reports>
    Patching element /directories/<omk_reports>, patch /directories/<omk_reports>
     
    sudo /usr/local/omk/bin/patch_config.exe -f /opt/omk/conf/opCommon.nmis /directories/'<omk_reports>'='/usr/local/omk/var/reports'
    Operating on config file: /opt/omk/conf/opCommon.nmis
    Patching values for keys /directories/<omk_reports>
    Patching element /directories/<omk_reports>, patch /directories/<omk_reports>
     
    sudo /usr/local/omk/bin/patch_config.exe -f /opt/omk/install/opCommon.nmis /directories/'<omk_reports_ondemand>'='/usr/local/omk/var/reports/on-demand'
    Operating on config file: /opt/omk/install/opCommon.nmis
    Patching values for keys /directories/<omk_reports_ondemand>
    Patching element /directories/<omk_reports_ondemand>, patch /directories/<omk_reports_ondemand>
     
    sudo /usr/local/omk/bin/patch_config.exe -f /opt/omk/conf/opCommon.nmis /directories/'<omk_reports_ondemand>'='/usr/local/omk/var/reports/on-demand'
    Operating on config file: /opt/omk/conf/opCommon.nmis
    Patching values for keys /directories/<omk_reports_ondemand>
    Patching element /directories/<omk_reports_ondemand>, patch /directories/<omk_reports_ondemand>
     
    # verify these changes to opCommon.nmis:
    sudo grep -arRnF "/var/reports" /opt/omk/{install,conf}/opCommon.nmis
    /opt/omk/install/opCommon.nmis:48:    '<omk_reports>' => '/usr/local/omk/var/reports',
    /opt/omk/install/opCommon.nmis:49:    '<omk_reports_ondemand>' => '/usr/local/omk/var/reports/on-demand',
    /opt/omk/conf/opCommon.nmis:48:    '<omk_reports>' => '/usr/local/omk/var/reports',
    /opt/omk/conf/opCommon.nmis:49:    '<omk_reports_ondemand>' => '/usr/local/omk/var/reports/on-demand',
     
    # we want opCommon.nmis configurations to point at '/usr/local/omk/var/reports'
    sudo /usr/local/omk/bin/patch_config.exe -f /opt/omk/install/opCommon.nmis /directories/'<omk_schedule>'='/usr/local/omk/conf/schedule'
    Operating on config file: /opt/omk/install/opCommon.nmis
    Patching values for keys /directories/<omk_schedule>
    Patching element /directories/<omk_schedule>, patch /directories/<omk_schedule>
     
    sudo /usr/local/omk/bin/patch_config.exe -f /opt/omk/conf/opCommon.nmis /directories/'<omk_schedule>'='/usr/local/omk/conf/schedule'
    Operating on config file: /opt/omk/conf/opCommon.nmis
    Patching values for keys /directories/<omk_schedule>
    Patching element /directories/<omk_schedule>, patch /directories/<omk_schedule>
     
    # verify this change to opCommon.nmis:
    sudo grep -arRnF "/conf/schedule" /opt/omk/{install,conf}/opCommon.nmis
    /opt/omk/install/opCommon.nmis:50:    '<omk_schedule>' => '/usr/local/omk/conf/schedule',
    /opt/omk/conf/opCommon.nmis:50:    '<omk_schedule>' => '/usr/local/omk/conf/schedule',
     
    # finally change our listen port for the omkd-standalone service|daemon from default 8042 to another available port, here 8043:
     
    sudo /usr/local/omk/bin/patch_config.exe -f /opt/omk/install/opCommon.nmis /omkd/omkd_listen_port=8043
    Operating on config file: /opt/omk/install/opCommon.nmis
    Patching values for keys /omkd/omkd_listen_port
    Patching element /omkd/omkd_listen_port, patch /omkd/omkd_listen_port
     
    sudo /usr/local/omk/bin/patch_config.exe -f /opt/omk/conf/opCommon.nmis /omkd/omkd_listen_port=8043
    Operating on config file: /opt/omk/conf/opCommon.nmis
    Patching values for keys /omkd/omkd_listen_port
    Patching element /omkd/omkd_listen_port, patch /omkd/omkd_listen_port
     
    # verify these changes to opCommon.nmis:
    sudo grep -arRnF "omkd_listen_port" /opt/omk/{install,conf}/opCommon.nmis
    /opt/omk/install/opCommon.nmis:118:    'omkd_listen_port' => '8043',
    /opt/omk/conf/opCommon.nmis:123:    'omkd_listen_port' => '8043',
     
    # rename install/04omk-proxy.conf and change port to 8043:
    sudo mv -f install/04omk-proxy.conf install/05omk-standalone-proxy.conf
    sudo sed -i 's~localhost:8042/~localhost:8043/~g' install/05omk-standalone-proxy.conf
    # confirm:
    cat install/05omk-standalone-proxy.conf
     
    # ensure groups are still correct on omk directory structure
    cd /opt/omk/
    sudo chown -R root:nmis /opt/omk
     
    # confirm
    ls -lah .
    total 52K
    drwxr-xr-x 9 root nmis  4.0K Mar 30 07:36 .
    drwxr-xr-x 5 root staff 4.0K Mar 30 07:48 ..
    drwxrwsr-x 3 root nmis  4.0K Mar 29 09:21 bin
    drwxr-xr-x 3 root nmis  4.0K Mar 30 07:06 conf
    drwxr-xr-x 4 root nmis  4.0K Mar 30 23:57 install
    -rw-r--r-- 1 root nmis   16K Mar 30 05:09 LICENSE
    drwxr-xr-x 2 root nmis  4.0K Mar 30 07:40 log
    drwxr-xr-x 3 root nmis  4.0K Mar 30 05:09 public
    drwxr-xr-x 8 root nmis  4.0K Mar 30 05:42 templates
    drwxr-xr-x 3 root nmis  4.0K Mar 30 07:40 var
     
    # final clean:
    sudo rm -rf /opt/omk/var/reports/*
    sudo rm -rf /opt/omk/var/opreports/*
     
    # create the tar archive:
    cd /opt/
    sudo tar -czvf opReports-3.5.2-standalone.tar.gz omk
     
    # confirm
    ls -lah opReports-3.5.2-standalone.tar.gz
    -rw-r--r-- 1 root root 72M Mar 30 07:49 opReports-3.5.2-standalone.tar.gz