Installing NMIS9 Compatible OMK Applications in a Disconnected (Air-Gapped) Environment

Installing NMIS9 Compatible OMK Applications in a Disconnected (Air-Gapped) Environment

Note:

The software has a version checker to let you know if there are any updates to your installed modules. This version check utilizes the clients browser to run, to disable this go to /usr/local/omk/templates/opmantek/welcome.html.ep and remove the block of code that starts with "// Used to make the version badge green or red based on the users installed version", around line 276. After removing do not forget to restart daemons.

Requirements

This method works best with a connected computer with same OS and Version.
This enables one to ascertain the dependent packages that need to be downloaded by the Package Manager for the disconnected (air-gapped) computer.

Strategy will be to only install packages if absolutely necessary to minimise need to vet new packages. 
Root privileges will only be used when absolutely  necessary.

Principle of Least Privilege

When run with 'Dependency Check Mode' enabled '-D', the Opmantek Installer cannot be run as root.

Should you want to run the Opmantek Installer with least privileges you may need to create a user with least privileges.
The Opmantek Installer does not take least privileges to extremes and leaves it in the hands of the person installing to run the Installer with least privileges.

This is important as, for example, by default the nmis user has 0770 permissions on the nmis directory, and a user in the nmis directory will have write and execute permissions on the nmis directory.

Run the following one-liner bash script to check your permissions on the nmis and omk directories if they exists, were you to run the installer as yourself - outputs only when write and execute permissions are detected:

NMIS=/usr/local/nmis9;OMK=/usr/local/omk;[ -x "$NMIS" ] && echo "Has execute permissions: $NMIS";[ -w "$NMIS" ] && echo "Has write permissions: $NMIS";[ -w "$OMK" ] && echo "Has write permissions: $OMK"

Dependency Check Mode

NMIS9 Compatible OMK Application Installers created on or after 2020-08-18 will include a new option '-D': Dependency Check Mode.
When run with  Dependency Check Mode  enabled '-D', the Opmantek Installer cannot be run as root.

When run with  Dependency Check Mode  enabled the installer will not perform an install, but write a file containing a list of dependencies to the /tmp/ directory.
For example, sh ./opCharts-4.1.1.run -- -D  run as a normal user, would start the installer in Dependency Check Mode (-D) and only create a list of dependencies at /tmp/omk_dependency_check_opcharts upon completion.

Below is a Centos 7 Example and Debian 9 Example illustrating how to get dependencies installed on the disconnected (air-gapped) computer.

These examples are focused on dependencies needed to unpack the installer during execution.
However, the same strategy can be adopted to install dependencies, other than NMIS9, listed during the Dependency Check.

Centos 7 Example

On Redhat and Centos OS, tar and libnsl may need to be installed as they are needed to unpack the installer runfile.

  1. On the disconnected (air-gapped) computer we will firstly determine which pre-installation required packages need to be downloaded:




  2. Using the connected computer with same OS and Version we will now fetch the pre-installation required packages:




  3. On the disconnected (air-gapped) computer we will now install the downloaded required packages:

Debian 9 Example

On Debian and Ubuntu OS, tar, which is normally installed by default, may need to be installed as it is needed to unpack the installer runfile.

  1. On the disconnected (air-gapped) computer we will firstly determine which pre-installation required packages need to be downloaded:

  2. Using the connected computer with same OS and Version we would now fetch the pre-installation required packages:

  3. On the disconnected (air-gapped) computer we will now install the downloaded required packages:

Related Topics