/build/static/layout/Breadcrumb_cap_w.png

K1000 - IP Based Smart Labels using REGEX

The most consistent way to label your machines by IP ranges is to use the KACE smart labeling tool and REGEX (Regular Expressions).  A regular expression (REGEX for short) is a special text string for describing a search pattern. You can think of regular expressions as wildcards on steroids. 

In this guide we will be using a Google Analytics tool to assist us in creating our REGEX search string.  The tool can be found here:  http://support.google.com/analytics/bin/answer.py?hl=en&answer=1034771

Now lets create a smart label using this tool.  Start by going to your computer inventory on the K1000.  Then click on Create Smart Label on the right hand side of your screen. 

You should now see the Smart Labeling Wizard.  Choose "IP Address" from the first drop down box.  Choose "matches REGEX" from the second.  The third box is where we will paste the REGEX from the Google Analytics tool.  It should look like the diagram below.

In another tab or window, pull up the Google Analytics tool.  Enter the start and end of your IP range in the boxes provided.   Click "Generate REGEX" when done.  This will populate 3rd box on the Google tool.  It should look similar to the diagram below.

Copy the contents of the 3rd box and paste it in to the third box that says PASTE REGEX HERE.  It should look similar to the diagram below.

Now click the "Test Smart Label" button.  You should see a list of all machines in that IP range.  Give your label a name in the "Choose label:" box and click save.  Now as your machines check in the label will be validated and applied to  any machine in the IP range. 

***TROUBLESHOOTING*** 

The third field of the smart label creator has a character limit.  If you have a large IP range that doesn’t seem to be working correctly when you test it in the wizard you can create the smart label by putting "REPLACEME" in the third field. 

Create the label and then go to Home > Labels  > Smart Labels.  Find your smart label and click on it.   You will now see the SQL query that the label is using.  Take the output REGEX from the Google Analytics tool and replace the REPLACEME with the REGEX.  Make sure to keep the single quotes around the string.

Save the smart label and it will start applying as machines check in.


Comments

  • Great tip on the Google Analytics tool to create REGEX statements!

    John - jverbosk 11 years ago
  • Any Idea why this wouldn't work in reverse? 'Does not match REGEX' - erik.bradbury 10 years ago
This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ