Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Installation Prerequisites

...

Server names need to be lower case with no spaces, e.g. NMIS_Server24 is bad, nmis_server24 is good.

Server names need to be names not IP addresses, and should be the hostname not a FQDN, e.g. server NOT server.domain.com

Now set the server name in Config.nmis, search for server_name: 

...

Code Block
themeEmacs
 'group_list' => 'NMIS8,DataCenter,Branches,Sales,Campus,HeadOffice,HQ,HQDev',

...


You can also use the admin script /usr/local/nmis8/admin/grouplist.pl on the master to find and patch all groups used by all devices imported from the pollers, it can even be added to cron to automate group updates.

Once opHA has succesfully pulled/pushed the devices from poller to master you can analyse and patch the groups list by using the following.

Code Block
languagebash
themeEmacs
languagebash
titlegrouplist.pl usage
# Simply list all found groups so you can add them to 'group_list' => '...'   as above
[root@opmantek ~]# /usr/local/nmis8/admin/grouplist.pl 
Branches
DataCenter
IOSXR
NMIS8
The following is the list of groups for the NMIS Config file Config.nmis
'group_list' => 'Branches,DataCenter,NMIS8,IOSXR',
## You can then simply copy this last line to replace the curren line in Config.nmis 

### Alternatively the script can automatically update the Config.nmis file's 'group_list' entry for you using the patch=true argument as follows:
/usr/local/nmis8/admin/grouplist.pl patch=true

...


Limiting Master Group Collection

...

  • use the GUI to do a pull or push (http://server_name:8042/omk/opHA/), select the server you want to push to or pull from (or select all to test them all) and press the appropriate button
    • the output will be a JSON document, with a hash entry for each successful file transfer: 

      Code Block
      {
        source: "vali",
        success: "Transfer complete",
        file_name: "nmis-summary8h",
        destination: "localhost"
      },


    • On error there will be a hash entry with an error key along with information to help you solve the problem 

      Code Block
      {
        url: "http://vali:443/login",
        error: "Error signing in",
        server_signin_url: "http://localhost:8042/omk/opHA/servers/vali/signin",
        message: "Transaction was not a success.",
        server_name: "vali"
      },


  • check the logs and watch the transfers happen
  • view the list of configured servers and check the "Last Update" column

Running a Master Collection

There are two options to run opHA, using Cron or a as a post process after a NMIS does a collect.  Pushes and pulls can be requested from anywhere, if they are requested from the localhost no authentication is required, if they are requested from elsewhere authentication is required.

Before you start make sure you have this in Config.nmis

Code Block
'nmis_master_poll_cycle' => 'false',

To run from cron add this to an appropriate file in your /etc/cron.d/ directory (you could create a new one or re-use your nmis file). This line will push or pull (depending on which one you pick) to a server, for example to server "demo":

Code Block
#### an EXAMPLE to push to a server called demo:
*/2 * * * * root wget -q http://localhost:8042/omk/opHA/servers/demo/push -O/dev/null   
#### an EXAMPLE with Pull for one server called Vali
*/2 * * * * root wget -q http://localhost:8042/omk/opHA/servers/vali/pull -O/dev/null 

This will get your collections running every 2 minutes regardless of any other polling operations.

If you want to run the opHA transfers immediately after an NMIS collect, we recommend that you add the wget line to your NMIS cron schedule, for example like this:

Push/Pull Configurations

opHA allows to change some default connection settings to influence in the connection with the peer.  

Code Block
titleFile <omk>/omk/opCommon.nmis
  'opha' => {
    ...
    'opha_connect_status_expiry_time' => 5,
    'opha_connect_timeout' => 3,
    'opha_inactivity_timeout' => 5,
    'opha_remote_endpoints' => [],
    'opha_request_timeout' => 9,
    'opha_websocket_reconnect_time' => 3
}

opHA also allow to control the data that we are going to pull/push:

Code Block
titleFile <omk>/omk/opCommon.nmis
  'opha' => {
    ...
    'opha_transfer_files' => [
      {
        'destination_dir' => 'var',
        'destination_file_name' => '',
        'source_dir' => 'conf',
        'source_file_name' => 'Nodes'
      },
      {
        'destination_dir' => 'var',
        'destination_file_name' => '',
        'source_dir' => 'var',
        'source_file_name' => 'nmis-nodesum'
      },
      {
        'destination_dir' => 'var',
        'destination_file_name' => '',
        'source_dir' => 'var',
        'source_file_name' => 'nmis-summary8h'
      },
      {
        'destination_dir' => 'var',
        'destination_file_name' => '',
        'source_dir' => 'var',
        'source_file_name' => 'nmis-summary16h'
      },
      {
       	'destination_dir' => 'var',
        'destination_file_name' => '',
        'source_dir' => 'var',
        'source_file_name' => 'nmis-event'
      }
    ],
}


Running a Master Collection

There are two options to run opHA, using Cron or a as a post process after a NMIS does a collect.  Pushes and pulls can be requested from anywhere, if they are requested from the localhost no authentication is required, if they are requested from elsewhere authentication is required.

Before you start make sure you have this in Config.nmis

Code Block
'nmis_master_poll_cycle' => 'false',

To run from cron add this to an appropriate file in your /etc/cron.d/ directory (you could create a new one or re-use your nmis file). This line will push or pull (depending on which one you pick) to a server, for example to server "demo":

Code Block
#### an EXAMPLE to push to a server called demo:
*/2 * * * * root 
Code Block
######################################################
# NMIS8 Config
######################################################
# Run Statistics Collection 
*/5 * * * * /usr/local/nmis8/bin/nmis.pl type=collect mthread=true maxthreads=10; wget -q http://localhost:8042/omk/opHA/servers/alldemo/push -O/dev/null
# so add   ;/dev/null   
#### an EXAMPLE with Pull for one server called Vali
*/2 * * * * root wget -q http://localhost:8042/omk/opHA/servers/allvali/pushpull -O/dev/null 

This will get your collections running every 2 minutes regardless of any other polling operations.

If you want to run the opHA transfers immediately after an NMIS collect, we recommend that you use the Alternatively, if you use NMIS 8.5.6G or newer you can use its plugin system to hook into the post-collect phase and execute Perl code of your choice then. 


Logs

Logs can be found in /usr/local/omk/log or also viewed from the GUI at http://server_name:8042/omk/opHA/logs

...