/build/static/layout/Breadcrumb_cap_w.png

K1000: Create a custom inventory rule that shows a remote PC's external IP

Support for remote PCs often requires the external IP address of a cable modem or the like.  There is no built in way in way in the K1000 or in Windows/OS X/Linux to find this.  

There is a way to use nslookup to query a website named opendns.com to get the information (source and explanation):  

nslookup myip.opendns.com resolver1.opendns.com


The command returns two IP addresses and the second is the external IP address for the client as per the screenshot below:

WY740E.png

Once the information can be made available in the command line, a custom inventory rule can be made to get the information into the K1000.  For more information on custom inventory rules, click here.

To create the custom inventory rule, do the following:

1. Navigate to Inventory>Software>Choose Action>New
2. Name and classify the rule as needed.  Typically, adding a "CIR" in front of the name makes it easier to find later.
3. Select the operating system(s) that the rule needs to run on.
4. Under "Custom Inventory Rule", enter: 
        ShellCommandTextReturn(nslookup myip.opendns.com resolver1.opendns.com)
5. Click Save.
6. As systems start to check in and update inventory, the custom inventory rule should start adding the external IP address under Software>Custom Inventory Fields. As a reminder, the second IP address is the external IP for the client.

4WORVp.png

Comments

  • Jason,

    This is excellent! - ronco 8 years ago
  • Thanks this should really help us - rcsands 8 years ago
  • I do it slightly different (and have only one result)
    1. deploy cURL to all systems (taking it from here: http://curl.haxx.se/download.html and do a file sync to c:\programdata\dell\kace\ownscripts\)
    2. use this CIR: ShellCommandTextReturn(cmd /c C:\ProgramData\Dell\KACE\ownscripts\curl.exe -s ifconfig.me/ip)

    Result is:
    4) CIR 04W - Public IP Windows: x.x.x.x
    [string] - Nico_K 8 years ago
    • That is a good method, for sure, but I chose this method since it's OS agnostic and doesn't require a software download. Mac and linux could use awk or grep to refine the answer. - jknox 8 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