Versions Compared

Key

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


tocPlease note that as at Open-AudIT 4.2.0, this page is no longer relevant. Please see the Integrations page.


...


Introduction

So you want to integrate the devices discovered in Open-AudIT with NMIS for network monitoring. But you don't want every device, and you don't want to have to manually flag devices for monitoring - you know you want every Juniper switch in Open-AudIT being monitored by NMIS. How can we do that without the painful effort of flagging individual devices with nmis_manage = y (even using Bulk Edit)?

...

Well, I'm glad you asked, read on (smile)

Selecting Devices

Integrations work by selecting a list of devices to be integrated. That list of devices is provided by a Query inside Open-AudIT. Our default query simply retrieves any devices with nmis_manage = y. But what if we create a new query to select any devices manufactured by Accedian? Well, go to menu → Queries → List Queries and select the query named "Integration Default for NMIS". You will see the SQL used. It is below.

Code Block
languagesql
SELECT system.id AS `system.id`, system.name AS `system.name`, system.hostname AS `system.hostname`, system.dns_hostname AS `system.dns_hostname`, system.fqdn AS `system.fqdn`, system.dns_fqdn AS `system.dns_fqdn`, system.ip AS `system.ip`, system.type AS `system.type`, system.credentials AS `system.credentials`, system.nmis_group AS `system.nmis_group`, system.nmis_name AS `system.nmis_name`, system.nmis_role AS `system.nmis_role`, system.nmis_manage AS `system.nmis_manage`, system.nmis_business_service AS `system.nmis_business_service`, system.nmis_customer AS `system.nmis_customer`, system.nmis_poller AS `system.nmis_poller`, system.snmp_version AS `system.snmp_version`, system.omk_uuid AS `system.omk_uuid`, locations.name AS `locations.name`, IF(system.snmp_version != '', 'true', 'false') AS `system.collect_snmp`, IF(system.os_group LIKE '%windows%', 'true', 'false') AS `system.collect_wmi` FROM `system` LEFT JOIN `locations` ON system.location_id = locations.id WHERE @filter AND system.nmis_manage = 'y'

It's a simple matter of replacing the AND system.nmis_manage = 'y' with another condition. Our new query to select devices made by Accedian is below.

Code Block
languagesqlcollapsetrue
SELECT system.id AS `system.id`, system.name AS `system.name`, system.hostname AS `system.hostname`, system.dns_hostname AS `system.dns_hostname`, system.fqdn AS `system.fqdn`, system.dns_fqdn AS `system.dns_fqdn`, system.ip AS `system.ip`, system.type AS `system.type`, system.credentials AS `system.credentials`, system.nmis_group AS `system.nmis_group`, system.nmis_name AS `system.nmis_name`, system.nmis_role AS `system.nmis_role`, system.nmis_manage AS `system.nmis_manage`, system.nmis_business_service AS `system.nmis_business_service`, system.nmis_customer AS `system.nmis_customer`, system.nmis_poller AS `system.nmis_poller`, system.snmp_version AS `system.snmp_version`, system.omk_uuid AS `system.omk_uuid`, locations.name AS `locations.name`, IF(system.snmp_version != '', 'true', 'false') AS `system.collect_snmp`, IF(system.os_group LIKE '%windows%', 'true', 'false') AS `system.collect_wmi` FROM `system` LEFT JOIN `locations` ON system.location_id = locations.id WHERE @filter AND system.manufacturer LIKE 'Accedian%'

...

Done? Great. Now make a note of the ID of each of these queries. You can see the ID on the queries read page (or in the URL when you execute the query).

Making the Integration

Now we need to go to the Pollers (assuming they're not on the same machine), and setup the individual integrations. They will work exactly the same, the only exception being the queries each runs (using the query IDs from above).

...

  1. Create the required configuration files.
  2. Retrieve devices from Open-AudIT.
  3. Create a node file suitable for passing into node_admin.pl.exe
  4. Create a new node if one does not exist, or update an existing node if it does.
  5. Update the mapping of Open-AudIT devices to NMIS nodes.
  6. Update the device on the Open-AudIT server if necessary.

Configuration

The following is a sample configuration file for the integration. The configuration is written in the .nmis format common to other Opmantek products and is placed in, /usr/local/omk/conf/nmisIntegration.nmis

Details of the below fields can be found on the page linked above. Obviously you will need to use your own host, password and user values. You'll need to use one of the query IDs from your newly created queries, above (replace 60 36 with it).

%hash = (

'integration_rules_path' => 'conf/integration_rules.nmis',
  'log_path' => 'log/nmisintegration.log',
  'node_admin_path' => '/usr/local/nmis9/admin/node_admin.pl',
  'node_file_path' => '/usr/local/nmis9/conf/Nodes.nmis',
  'open_audit_details' => {
    'host' => 'http://YOUR_SERVER',
    'log_path' => 'log/openauditapi.log',
    'password' => 'YOUR_OA_PASSWORD',
    'user' => 'YOUR_OA_USER'
  },
  'open_audit_lookup_path' => 'conf/oa_nmis_lookup.nmis',
  'open_audit_query_ids' => [6036]
);

Integration Rules

The default integration rules can be left as is, and are below. These should be placed in the file /usr/local/omk/conf/integration_rules.nmis.

%hash = (
  'nmis' => {
    'create' => {
      'active' => ['true'],
      'authkey' => [],
      'authpassword' => ['$DEVICE.credentials.snmp_v3.authentication_passphrase'],
      'authprotocol' => ['$DEVICE.credentials.snmp_v3.authentication_protocol'],
      'businessService' => ['$DEVICE.system.nmis_business_service'],
      'collect' => ['$DEVICE.system.collect'],
      'collect_snmp' => ['$DEVICE.system.collect_snmp'],
      'collect_wmi' => ['$DEVICE.system.collect_wmi'],
      'community' => ['$DEVICE.credentials.snmp.community'],
      'customer' => ['$DEVICE.system.nmis_customer'],
      'display_name' => ['$DEVICE.system.name'],
      'group' => ['$DEVICE.system.nmis_group','Open-AudIT'],
      'host' => ['$DEVICE.system.ip','$DEVICE.system.dns_fqdn'],
      'location' => ['$DEVICE.locations.name'],
      'model' => ['automatic'],
      'name' => ['$DEVICE.system.name'],
      'netType' => ['wan'],
      'notes' => [],
      'ping' => ['true'],
      'port' => [161],
      'privkey' => [],
      'privpassword' => ['$DEVICE.credentials.snmp_v3.privacy_passphrase'],
      'privprotocol' => ['$DEVICE.credentials.snmp_v3.privacy_protocol'],
      'roleType' => ['$DEVICE.system.nmis_role','core'],
      'threshold' => [],
      'username' => ['$DEVICE.credentials.snmp_v3.security_name'],
      'uuid' => ['$DEVICE.system.omk_uuid'],
      'version' => ['$DEVICE.system.snmp_version'],
      'wmipassword' => ['$DEVICE.credentials.windows.password'],
      'wmiusername' => ['$DEVICE.credentials.windows.username']
    },
    'update' => {
      'active' => ['true'],
      'authpassword' => ['$DEVICE.credentials.snmp_v3.authentication_passphrase'],
      'authprotocol' => ['$DEVICE.credentials.snmp_v3.authentication_protocol'],
      'businessService' => ['$DEVICE.system.nmis_business_service'],
      'collect' => ['$DEVICE.system.collect'],
      'collect_snmp' => ['$DEVICE.system.collect_snmp'],
      'collect_wmi' => ['$DEVICE.system.collect_wmi'],
      'community' => ['$DEVICE.credentials.snmp.community'],
      'customer' => ['$DEVICE.system.nmis_customer'],
      'display_name' => ['$DEVICE.system.name'],
      'group' => ['$DEVICE.system.nmis_group','Open-AudIT'],
      'host' => ['$DEVICE.system.ip','$DEVICE.system.dns_fqdn'],
      'location' => ['$DEVICE.locations.name'],
      'model' => ['automatic'],
      'name' => ['$DEVICE.system.name'],
      'netType' => ['wan'],
      'ping' => ['true'],
      'port' => [161],
      'privpassword' => ['$DEVICE.credentials.snmp_v3.privacy_passphrase'],
      'privprotocol' => ['$DEVICE.credentials.snmp_v3.privacy_protocol'],
      'roleType' => ['$DEVICE.system.nmis_role','core'],
      'username' => ['$DEVICE.credentials.snmp_v3.security_name'],
      'version' => ['$DEVICE.system.snmp_version'],
      'wmipassword' => ['$DEVICE.credentials.windows.password'],
      'wmiusername' => ['$DEVICE.credentials.windows.username']
    }
  }
);

OA_NMIS_Lookup

You will need a blank file credted in /usr/local/omk/conf/oa_nmis_lookup.json

Usage

To run the integration, simply invoke the executable and pass it a configuration file as described in the previous section. You can also invoke the tool by itself, which will look for a configuration file at /usr/local/omk/conf/nmisIntegration.nmis by default.

...

5 11 * * * /usr/local/omk/bin/oa-nmis-integration.plexe conf=/usr/local/omk/conf/my_custom_config.nmis

...