5 Replies Latest reply on Jan 7, 2019 1:53 PM by phoffmann

    Asset Control / Data Translation Services – No cross platform central location for MAC Address - Iterating through Child Record MAC Addresses?

    JacobTucker Apprentice

      I’ve found that under Device > TCPIP > Address – There is the IP address of the device, Padded and unpadded. Very convenient. Why is there not the same for Physical Address? I’ve checked among the different manufactures of devices that we have and there simply isn’t one.

       

       

      The first and fourth child Network Adapter record does not contain and physical address field or is null. The second and third have a value, but the 2nd record’s Physical address field is all zeros. Clearly in this situation the third record would be the obvious real mac address to use. However not all are this obvious.

       

       

      So my Idea is that using some VBS and a calculation rule, I may be able to iterate through the child records and write them all to an array, then identify the best mac to grab. Then write it to the Physical address field on the MP_AP_Devices table.

       

       

       

      Calculation Rule VBS

      Dim macAddress(9)

      Dim x

       

      For x = 1 to 10

      macAddress(x-1) = !Device.Network Adapters.Network Adapter.Physical Address!

      Next

       

      RetValue = (Join(!Device.Network Adapters.Network Adapter.Physical Address!) & " ")

       

      There's a few obvious issues here:

      1. I am able to iterate through the MacAddress Array, however, not able to iterate through the variable reference to Physical Address. Not sure if that's even possible or how to try that..

      2. I decided to join all the strings together on the final line. There is no mechanism here to break down the strings and device which is most likely the MAC address.

       

       

      Any ideas?

       

      Btw, in case anyone wants to ask for some reason, were on version 18.3 about 7500 Managed and 3000 Asset Control..

        • 1. Re: Asset Control / Data Translation Services – No cross platform central location for MAC Address - Iterating through Child Record MAC Addresses?
          phoffmann SupportEmployee

          So a bit of context.

           

          • You can create you own DTS rule if you want to pad / change the format of MAC-addresses from AABBCCDDEEFF format over to AA:BB:CC:DD:EE:FF or AA-BB-CC-DD-EE-FF format.

            As a piece of advice, I would recommend / ensure that you put such a field into a SEPARATE field (and not be tempted to replace the existing one). For one, we rely on MAC-address format being the way it is for a bunch of things, for another it's ALWAYS better to have "both" formats available, as everyone I've run into who so far replaced "the existing value" (not just MAC-addresses, anything really) ended up regretting it as it's a great way to find out that "someone / some process" is making use of / relying on that piece of data being in the format it is.

           

          • The reason why some NIC's appear to be empty is a Windows "issue" / characteristic at heart. Windows keeps track of all your NICs that you ever had (in some registry location that I can dig up if absolutely needed). This also means that disabled / old NIC's are still listed (and picked up) ... but since they're not around, that's how they don't have a MAC address.

            This also "applies" to the order of NIC-s (which mirrors Windows' order) ... which CHANGES at every reboot (or used to, I believe Windows 10 + UEFI finally should put this one into more consistent behaviour).

           

          • Note that OS specific variations occur / apply to network information. Linux tends to behave somewhat differently (for instance, disconnected network cards still show as having an IP address of 0.0.0.0 )

          • What / why are you trying to achieve here. I'm not immediately clear on how / why having all valid MAC-addresses is going to help you (when a simple query of "NOT NULL" / "AND NOT all-0-s" type will help) ...?

            ... having more context around what (and why) you're trying to achieve would help potentially identifying something that'd satisfy a solution for you (could be as simple as a real-time rule that trawls through the MAC-address entries & adds a "valid = yes / no" or some such field) ?
          • 2. Re: Asset Control / Data Translation Services – No cross platform central location for MAC Address - Iterating through Child Record MAC Addresses?
            JacobTucker Apprentice

            Hey Phoffman,

             

            Thanks for the reply.

             

            The destination field for the DTS rule I chose is "Device.Address" aka "MP_AC_Devices.NetwareAddr" which is simply because I verified in the db that this field is always null. So, I'm really just borrowing the value and sending it to what seems like an unused or legacy field.

             

            I understand that some OS's and manufacturers provide wildly different values and results, and LANDesk attempts to normalize all of that, but up / active / used MAC address I would think would be placed in its own unique area similarly to that of the IP Address. Which is why I mentioned it.

             

            The reason I am trying to isolate a single place where the accurate MAC Address is located (Without dealing with Child records) is for integration with ivanti Service Manager(ITSM). We are importing and all the child records get pulled in if there are more than one. Depending on the manufacturer usually the first child record is the correct MAC address and on top of that, the following child records are empty, so it doesn't hurt anything. However in the case of certain Zebra printers like the one in my original example, there are 4 children. Sometimes there are more, sometimes the accurate one is seemingly randomly found within the 4.

             

            As far as I can tell there isnt a way to iterate through the child records and join them to a single string so I can manipulate that string and determine the best MAC address to use.

             

            perhaps there is a simpler way of doing this.

             

            I've tried making a DTS rule that ignores null or 0 value MAC addresses, but it only evaluates the first of the child records in the Network Adapter table

            • 3. Re: Asset Control / Data Translation Services – No cross platform central location for MAC Address - Iterating through Child Record MAC Addresses?
              phoffmann SupportEmployee

              Hehe - "not really" (re "active" MAC-addresses), since this too varies between systems. Even a disconnected NIC on a Linux system will still have an IP of 0.0.0.0 (in the actual OS) so "just because it has an IP" doesn't mean it's active / connected up properly for instance.

               

              So those are printers eh ... fair enough. OK - that'd explain the "weird" inventory section (I would've expected to see "Network - Bound Adapter...") ... ok so we're talking about an SNMP type scan here (should've realised earlier... duh ). Was wondering why it didn't look more like this ...

               

              Hmm - so in that case ... maybe a "Calulate" rule with a more "complex" VB-script (referencing inventory data) may be of use? So to make sure that you're hitting up your printers "only" (rather than EVERY device out there if you don't need to, for instance).

               

              Remember, you can reference inventory items in the VB-script using the "Inventory location" with !-s on either side (as you already seem to have done). So you could do something along the following pseudo code ...

              IF ( !Device.Type! = 'Printer' ) && ( !Device.Scan Type! = 'SNMP' )

              THEN (Do MAC Stuff)

              ELSE (Skip / exit)

               

              >> Small side-comment / question ... any particular reason your FOR... loop doesn't begin with 0 (since most Computer Sciences iterations usually begin wtih 0, including our NIC counters)? Hardly a big thing, just surprised is all .

               

              OK - so since we're talking printers ... I can't look at that data (don't have a bunch of such SNMP scans to compare) so can't really help much here beyond suggesting approaches.

               

              You COULD do a loop of the "IF EXISTS..." type to iterate through the first 10 (or 20) entries if you want. Though (I'm not quite awake) I'm pretty sure you can actually run SQL statements and just do something like (would need to look into it a bit more, but pretty sure I've seen templates for it around somewhere...)

              select MAX(Adapterno) from BoundAdapter where COMPUTER_IDN = !DEVICE.ID!
              

               

              ... which obviously only works for "Bound Adapters" - so you'd need to check where your data is written to.

               

              Easiest way to do that?

              • Create a LDMS QUERY checking for your attribute -- so "Computer.Network Adapters.Network Adapters.NUMBER EXISTS" ...
              • ... INSPECT the Query ...
              • Note down / Copy & Paste the SQL...
              • ... and check the WHERE condition for the table / column you're looking for.

              Does that help ?

               

              ALTERNATIVELY - you could script / create miniscan files (for instance) that'd query the data for each device you care about & enter the data via a miniscan file (a scan file is just a text file) ... using something like the MBSDK (Getting Started with the MBSDK (Example Scripts Included) ) to dynamically query items, for instance (yep, that's an example I go over) .

              • 4. Re: Asset Control / Data Translation Services – No cross platform central location for MAC Address - Iterating through Child Record MAC Addresses?
                JacobTucker Apprentice

                Thanks for the response! This all awesome! This is great information. Perhaps we should schedule up a meeting to talk? I'd love to work this out. It would solve a large integration hurdle we've got.

                 

                >> about the loop starting at 1 - Lol yea, I'm not really a VBS guy so I copy and pasted that and edited where I saw fit. I didnt catch that.

                • 5. Re: Asset Control / Data Translation Services – No cross platform central location for MAC Address - Iterating through Child Record MAC Addresses?
                  phoffmann SupportEmployee

                  Not terribly easy sadly, as it appears you're in the US and I'm a TRM on EMEA time. Can bounce the occasional thing here back & forth (or other folks who do stuff eith LDDA can pipe in) ... .

                   

                  Now the good news is that most TRM's and or Ivanti folks should be able to help you (though this kind of stuff DOES go outside of regular support stuff usually ... but you could ask how you can get a few things done from folks who are a bit more specialised) - such as the thing about whether or not DA can access the DB-field (I *think* it can, to get the counter, but I'm shot after a super long day).

                   

                  ===

                   

                  No problem about the "starting at 1" - I just usually notice those things & make sure to check whether that's intentional (sometimes it is). Wasn't a dig - just a habit I developed in asking about suspicious things I notice .