Skip to main content
Jamf Nation, hosted by Jamf, is the largest Apple IT management community in the world. Dialog with your fellow IT professionals, gain insight about Apple device deployments, share best practices and bounce ideas off each other. Join the conversation.

Using the JSS Subnet Importer

Overview

This article explains how to use the JSS Subnet Importer to import network segment information into the JSS.

Requirements

To use the JSS Subnet Importer, you need:

  • The Casper Suite v8.0 or later
  • A JSS user account with privileges to read, create, and update network segments Note: If you are using the JSS v8.x, these privileges are API privileges.

Procedure

  1. Download the JSS Subnet Importer ZIP file from https://jamfnation.jamfsoftware.com/viewProduct.html?id=181.
  2. Extract the JSS Subnet Importer ZIP file. The extracted folder contains the JSS Conduit (JSSConduit.jar), a Resources folder, and a sample .csv file.
  3. Create a .csv file containing the network segment information you want to import. Use the sample .csv file and the following guidelines to format your .csv file:

  4. When entering distribution points, NetBoot servers, software update servers, buildings, and departments, use the display names specified in the JSS.

  5. Enter "true" or "false" in the columns labeled override_buildings and override_departments.
  6. The URL column can be left blank.

  7. Open the JSS Conduit (JSSConduit.jar).

  8. If prompted, enter credentials for a local administrator account, and then click OK.
  9. Click Add (+) and choose "Text Subnet Importer" from the Plug-in pop-up menu.
  10. Click Choose and select the .csv file you created in step 1.
  11. Enter the URL of the JSS you want to use to import the network segment information. The URL must include the correct protocol, domain, and port. It cannot end in a backslash (/). For example: https://jss.mycompany.corp:8443
  12. Enter credentials for a JSS user account. The account must have API privileges to read, create, and update network segments.
  13. Click Save.
  14. Enable the JSS Subnet Importer by selecting the checkbox next to it.
  15. Click the Export Now button to manually import the network segment information into the JSS, or configure the scheduling options to import the information automatically. Note: If you plan to export data automatically, it is recommended that you export data manually before creating an automated schedule.

Additional Information

The JSS Subnet Importer is a plug-in for the JSS Conduit. For more information about the JSS Conduit, see the JSS Conduit User Guide, available at:

http://www.jamfsoftware.com/product-documentation

Like Comment
Order by:
SOLVED Posted: by andrewseago

Nice! Can't wait to try this out!

Like
SOLVED Posted: by donmontalvo

Can we update the KB with formatting info for the CSV?

<drooling>

Don

Like
JAMFBadge
SOLVED Posted: by jake

Don \-

We can look at getting this into the KB. For reference, we did place a sample CSV at the root of the download to show the format the importer is looking for.

Thanks!

Like
SOLVED Posted: by donmontalvo

Hi Jake,

Tested out fine in our Dev LAB environment. We broke the subnets down into separate CSV files, to make it easier to manage. Import worked like a charm.

We had someone convert the CIDR formatted ranges (xxx.xxx.xxx.xxx/xxx) to IP Ranges (Starting IP xxx.xxx.xxx.xxx to Ending IP xxx.xxx.xxx.xxx). Hoping the import tool can some day support CIDR, since that's the format the network folks give us when we request a report in most environments.

During testing we invested a whopping 99 cents on a cool CIDR Calculator application...

http://itunes.apple.com/us/app/cidr-calculator/id498069012?mt=12

During testing we discovered that it is possible to import a CSV twice resulting in duplicates...easily fixed by deleting, but just an FYI (the GUI warns you if you try to enter a duplicate).

Thanks JAMF, you just gave us an untold number of man hours back!!!

Don

Like
SOLVED Posted: by jwojda

I'm giving this a shot, and I see the sample CSV \- but how do I enter the data for the DP / NB/SWU etc...

just type them in manually? forinstance our default DP is fqdnservername (afp://fqdn/caspershare)

do I type the whole thing or is the fqdn of the servername enough?

if I want to override the buildings in inventory, do I just place an X in that cell?

Finally, what's the URL field? I don't see that on the JSS's network segments page.

Like
SOLVED Posted: by jwojda

another odd thing, under resources, I found a log folder \- I openend the log and has the follow (paraphrased since I'm retyping)

Exporting Text Subnet Importer
After building document object
Text Subnet IMporter: Could not find specified file.
CSV parser object created
Checking CSV file.
Text Subnet Importer finished exporting (succeeded)..

but there's no new segments in the JSS.

Like
SOLVED Posted: by erin.miska

Hi John,

Good questions. We've updated this article with some more specific guidelines for formatting the .csv file. Hope this helps.

-Erin

Like
SOLVED Posted: by jwojda

it makes more sense now, but it's still not showing in the JSS. I got rid of the error: Text Subnet IMporter: Could not find specified file from the logs by doing a get info on the file and unchecking Hide Extension.

Now the log is showingExporting to TSI
After building doc object
CSV parser object created
Checking CSV file
Parsing CSV file and submitting to JSS
POST to JSS
TSI finished exporting. (Succeeded).

I've tried while the account was signed into the JSS, while out of the JSS, refreshing, changing pages and going back in... with teh CSV file open, with the CSV file closed, in the same directory as the JSSConduit.jar, in different directory as the JSSConduit.jar, moving the whole folder to a different location...

Like
SOLVED Posted: by donmontalvo

@jwojda, make sure the JSS account you are using has API enabled for Segments. Go to the user account and check under API Privileges (step 9).

Don

Like
SOLVED Posted: by jwojda

i tried my account that has full access, and a local account with full access.

also tried revoking all, saving, and granting all (and saving).

Like
SOLVED Posted: by donmontalvo

When we first tested we discovered we had the wrong usename/password in the JSS Segment Importer tool. Found out only after creating a "segments" account with "segments" password. Circled back, corrected the password, then things worked.

Like
JAMFBadge
SOLVED Posted: by jake

Hey John \-

Let's move this over to the Discussions as more people are following those a bit closer and may be able to provide some feedback as well.

Can you do me a favor and post what your CSV looks like over there and we'll take a look to see what might be going on?

Thanks!

Like
SOLVED Posted: by lg-jbarclay

Hey Don,

I wrote a Python script to convert CIDR networks to ranges. You just pass it the path to a CSV file containing the CIDR notation and it outputs the ranges to stdout. This might be faster than having someone do the conversion one at a time. When I needed to do this for \~250 VLANs in CIDR notation I just modified the script to only output the beginning or ending address, (and then I just copied/pasted into a new CSV).

The script can be found at:

https://github.com/futureimperfect/futureimperfect_scripts/tree/master/cidr_to_range

Also, here it is in plain text:

#!/usr/bin/env python

import csv 
import pprint
import sys 

from netaddr import *

csv_file = sys.argv[1]

def cidrToRange(csv_file):
    with open(csv_file, 'rU') as csvfile:
        cidrNetworks = csv.reader(csvfile, delimiter=' ', quotechar='|', dialect=csv.excel_tab)
        for address in cidrNetworks:
            addressStrings = '\n'.join(address)
            ip = IPNetwork(addressStrings)
            ip_list = list(ip)

            beginningAddress = ip_list[0]
            endingAddress = ip_list[-1]

            print '%s - %s' % (beginningAddress, endingAddress)

        csvfile.close()

cidrToRange(csv_file)

Hope this helps!

Like
SOLVED Posted: by donmontalvo

Thanks, but this was something we wrestled with almost two years ago. :)

Like
SOLVED Posted: by lg-jbarclay

I figured as much. :)

I just thought I'd post it here because I dealt with it recently.

Like
SOLVED Posted: by sumit.batra

I tried using the JSS Subnet Importer tool, but unfortunately nothing shows up in network segments. The log file says:
POST to JSS...
Text Subnet Importer finished exporting ( succeeded).

Using JSS Subnet Importer & JSS 9.2.2. The account has full access & is administrator. Any suggestions would be highly appreciated.

Like
SOLVED Posted: by benducklow

I am looking to utilize this tool as well with no luck. I have Casper v9.72, JSS Conduit v2.32 and this JSS Subnet Importer v1.02. I'm also using an account with full access and is an administrator. My log file just says:

Jun 15, 2015 2:39:47 PM - Running Text Subnet Importer...
Jun 15, 2015 2:39:47 PM - Checking CSV file...
Jun 15, 2015 2:39:47 PM - Parsing CSV file and submitting to JSS...
Jun 15, 2015 2:39:47 PM - Adding TEST network segment...
Jun 15, 2015 2:39:47 PM - Text Subnet Importer finished running.  (Succeeded)

Yet nothing actually shows up under Network Segments... Has anyone had any success using these tools/utilities lately?

Like
SOLVED Posted: by 5kinner

Hey Ben, did you manage to find a solution, I've had the exact same issue as you?

Like
SOLVED Posted: by benducklow

@5kinner No I have not. But based on the fact that my TAM came back to me with a custom bash script (that is supposed to do the same thing, however did not work either) means the issue is more than just a few of us. I'll keep this thread posted if (and when) I come up with a fix.

Like
SOLVED Posted: by 5kinner

@benducklow Just managed to do it, only importing Display Name, Starting IP and Ending IP. Just having this data in worked straight away.

Like
SOLVED Posted: by benducklow
@benducklow Just managed to do it, only importing Display Name, Starting IP and Ending IP. Just having this data in worked straight away.

Can you post the contents of your subnets.csv file here? Did you use Excel or some text editor to change the file? Also any special permissions on the file? Any special location of the file? I just tried with the following in my subnets.csv file (based on your last reply) and even though it said it was successful in the log, it didn't actually import:

VPN,192.168.1.1,192.168.1.254
Like
SOLVED Posted: by 5kinner

I can't post my actual subnets.csv however I copied the original included in the download. Opened in Excel (on a Mac) and copied my subnets and starting address and ending address exactly like the sample. That's it, I didn't do anything else. I used a full access administrator user to import.

Have you tried uploading the sample csv?

Like
SOLVED Posted: by benducklow

@5kinner Finally! I was able to import the included sample file into my DEV JSS without issue. Once I did that, I went back and took baby steps by simply editing one row with just the name, starting_address, ending_address (then manually deleted each other cell that the sample file had populated, except the header row). I was successfully able to import after that as well.

I ultimately was able to get an import of the name, starting_address, ending_address, distribution_point, netboot_server, building, override_building and override_departments**!

In hindsight I was doing a few things wrong: a.) I deleted the header row b.) I was adding in data in the other columns that did not exist on my DEV server (ex: distribution_point, netboot_server). Thanks @5kinner for helping me through this. Much appreciated!

Like
SOLVED Posted: by 5kinner

Great news! We got there in the end. It usually ends up being the simple things!

Like
SOLVED Posted: by joecurrin

After tackling this as well, I noticed one minor addition. Import was failing for us as well, because it couldn't find the file. Make sure your file is titled with .csv visible. If the .csv extension isn't visible, the importer will fail because its looking for "filename" not "filename.csv"

Like
SOLVED Posted: by tep

Has anyone used this import tool recently (JSS 9.81)? Would it be more efficient to import using the API?

Like
SOLVED Posted: by bradtchapman

Hi @tep , I just used it today.

The subnet names must be unique, and processing will stop on the first duplicate. Ask me how I know.

JAMF needs to update this article to include this caveat, and the plugin should be updated to alert the administrator if a duplicate entry exists in the CSV before exporting to the JSS. Currently there is NO error to indicate that the CSV did not get fully imported; I had to manually count the entries to find it, and as you know IP addresses don't sort numerically the way that regular numbers do.

Like
SOLVED Posted: by bradtchapman

@PCalomeni - the TextImporter zip file included an .svn folder (not sure if that was intentional). The 'entries' file includes useful data about where the project is stored; @michael.deeb's name is mentioned in there, too.

https://clare.jamfsw.corp/customdev/

Like
SOLVED Posted: by ddcdennisb

link in step 1 no longer exist or at least is not redirecting correctly for new jamf nation page

Like
SOLVED Posted: by benducklow

@ddcdennisb Looks like its now [https://www.jamf.com/jamf-nation/third-party-products/181/jss-subnet-importer?view=info](link URL) Look under the menu bar for More > Third Party Products > J > JSS Subnet Importer

Like
SOLVED Posted: by jwojda

I tried @lg-jbarclay 's script but couldn't get it to run, any other thoughts for a cidr list of ip's to convert for this?

Like
SOLVED Posted: by thetfordb

I'm unable to get the plugin to load. The JSSConduitGUI.log show:
Sep 5, 2018, 11:10:27 AM - Error: Unable to load plugins.
Sep 5, 2018, 11:10:27 AM - [Ljava.lang.StackTraceElement;@2aa5fe93

Is there a specific java version I need?

Like
SOLVED Posted: by donmontalvo

@thetfordb opened a ticket with Jamf to see if this tool supports Jamf Pro 10.7.1, 10.9.0, and 10.10.0 (once released).

Like

Jamf wants to hear your feedback around Jamf Pro: LDAP Servers and Reports!