Skip navigation
All Places > Licensing and Installation > Blog > 2014 > November
2014

Most of you reading this already know that opening a DOS command shell and entering the command 'ipconfig /all' will return a lot of useful information, including the MAC address. If you use the MAC address as the hostid for mobile compute licenses you have done this many times I suspect. Nothing wrong with doing that, it works. But if you'd like a way of doing it that returns a lot less data you don't need, can be executed remotely, and could be used to obtain this information programmatically for your entire user base- read on.

 

Such a command exists, and it's been there the whole time: getmac

 

getmac has some useful options which you can read about by running the command 'getmac /?'. Here are the ones I find most useful:

 

This one returns the MAC address for each network device without any header information.

C:\> getmac /nh

00-26-B9-xx-xx-xx   \Device\Tcpip_{66A49F71-AB71-42BE-99D0-71027A377490}

00-50-56-C0-00-01   \Device\Tcpip_{9A9C7A14-6867-4877-8DFD-E1DA5378ADDF}

00-50-56-C0-00-08   \Device\Tcpip_{7CABA731-102F-4BB1-A4DA-D054804F6E31}

 

It is easy to identify my wired device in this case, because I know anything that has 00-50-56-C0 at the beginning is a VMware virtual adapter. But let's pretend I had a wireless adapter in my machine also, and I got 2 addresses that were not virtual adapters. How would I know which of them was the one I wanted?

 

I'd use the /v (verbose) option:

 

C:\> getmac /nh /v

Local Area Conn Broadcom NetXtr 00-26-B9-xx-xx-xx   \Device\Tcpip_{66A49F71-AB71-42BE-99D0-71027A377490}

VMware Network  VMware Virtual  00-50-56-C0-00-01   \Device\Tcpip_{9A9C7A14-6867-4877-8DFD-E1DA5378ADDF}

VMware Network  VMware Virtual  00-50-56-C0-00-08   \Device\Tcpip_{7CABA731-102F-4BB1-A4DA-D054804F6E31}

 

If I'd had another hardware NIC, I could tell by the description which was which.

 

So far, all the information has come from my local machine. If I want to know the MAC addresses on a different machine, I'll use the /s option:

 

C:\>getmac /s orw-kfost-t5610

 

Physical Address    Transport Name

=================== ==========================================================

34-17-EB-xx-xx-xx   \Device\Tcpip_{EC36C646-EB29-4E80-92AC-3D3F91293B22}

00-50-56-C0-00-01   \Device\Tcpip_{9D1AE766-04FB-4E67-BE2E-FD6A64BDF54A}

00-50-56-C0-00-08   \Device\Tcpip_{E3C15C4F-DE49-4E01-8EA1-928704365A9A}

 

Note that this time I omitted the /nh option so I could see the header.

 

With a little elbow grease, you could wrap a script around getmac to gather the MAC addresses for your entire site in one go, and then parse that data into a useful report you can use for license ordering or renewal.

 

Thanks for reading!

 

-K

 

Microsoft will end support for Windows Server
2003/R2 next summer on July 14, 2015.
End of support for Windows Server 2003/R2 means
that no more updates or patches will ship from Microsoft.

 

Microsoft
will no longer develop or release any updates after ending support. If you are
staying the Server OS, upgrade to either Windows Server 2008 or 2012.

Be sure to
check the approved platforms for your Mentor application before making any
platform changes.

If you ever need to figure out what the command line is for a sub-invoked or child process, here are some tips:

 

1). Enable the "Command Line" column in Task Manager

 

This is a simple and effective way to grab the command line if, A) you know the process name you're looking for, and B) the process sticks around long enough for you to capture the command line info. Unfortunately, no Copy and Paste is available, and the parent->child hierarchy is not shown.

TOTW_TaskManager.jpg

 

2). Process Explorer - A great freeware tool from Microsoft. It's Task Manager on steroids!

 

Process Explorer includes a command line field similar to Task Manager, but adds the process hierarchy so you can quickly identify a parent process and one or more of its children. Right-click (or double-click) on the desired process and select "Properties", and the command line information (can be copied!) is available from the "Image" tab.

 

One drawback with Process Explorer, is when a sub-invoked (child) process only runs for a short while. If you're not quick enough you won't be able to grab the process info! For these cases consider Process Monitor (#3 below).

TOTW_ProcessExplorer.jpg

 

3). Process Monitor - Another great freeware tool from Microsoft. It's Process Explorer plus a whole lot more!

 

Process Monitor is a utility that logs process, file system, registry, and network activity. It's not for the faint of heart, but can be extremely useful in troubleshooting very difficult application problems or crashes. When it comes to capturing the command line of a sub-invoked process, it's a champ! Not only can you capture the process hierarchy, but since it's a logging tool you can grab (and copy) the command line info even if the process runs for only a split-second.

 

Follow the screen-shots with directions below:

TOTW_ProcessMonitor.jpg

 

After clicking the "Show Process Tree" icon:

TOTW_ProcessMonitor2.jpg

The lmstat command will report the quantity of a particular feature with the -f option. However, if you have multiple versions of a license feature, they're rolled up into a single count by default. For example:

 

Z:\>lmutil lmstat -c 1717@lic_server -f qhsimvl

lmutil - Copyright (c) 1989-2011 Flexera Software, Inc. All Rights Reserved.

Flexible License Manager status on Fri 10/31/2014 14:09

 

[Detecting lmgrd processes...]

License server status: 1717@lic_server

    License file(s) on lic_server: C:\MentorGraphics\License_Files\lmstat_test.txt:

 

lic_server: license server UP (MASTER) v11.11

 

Vendor daemon status (on lic_server):

 

     mgcld: UP v11.11

Feature usage info:

 

Users of qhsimvl:  (Total of 10 licenses issued;  Total of 0 licenses in use)

 

 

This might leave you with the impression that you have more features available for the version of the application you're running than you really do.

 

Note: Every Mentor Graphics application requires a minimum version of a license feature, usually tied to the build or release date of the application.

 

Fortunately, adding the -i option to your lmstat command will break down the overall count of a feature into separate counts for each version of that feature. For example:

 

Z:\>lmutil lmstat -c 1717@lic_server -f qhsimvl -i

lmutil - Copyright (c) 1989-2011 Flexera Software, Inc. All Rights Reserved.

Flexible License Manager status on Fri 10/31/2014 14:09

 

[Detecting lmgrd processes...]

License server status: 1717@lic_server

    License file(s) on lic_server: C:\MentorGraphics\License_Files\lmstat_test.txt:

 

lic_server: license server UP (MASTER) v11.11

 

Vendor daemon status (on lic_server):

 

     mgcld: UP v11.11

Feature usage info:

 

Users of qhsimvl:  (Total of 10 licenses issued;  Total of 0 licenses in use)

 

 

NOTE: lmstat -i does not give information from the server,

      but only reads the license file.  For this reason,

      lmstat -a is recommended instead.

 

Feature                 Version   # licenses    Expires         Vendor

_______                 _______   __________    _______         ______

qhsimvl                 2014.030              5         10-nov-2014     mgcld

qhsimvl                 2015.100              5         10-nov-2014     mgcld

 

 

In this example, I could run up to 10 simultaneous Verilog simulations using a version of Modelsim that requires a qhsimvl with a minimum version of 2014.030 or older (2013.110 for example). However, I could only run 5 simultaneous simulations using a version of Modelsim that requires 2014.040 or newer.

 

Keep the -i option in mind if you ever suspect you're not able to use the full count of a particular feature.