MAC IP information

(imported topic written by anthonymap91)

Is there anyway to combine the MAC and IP address information as follows for both UNIX and WINDOWS OS?

Q: IF (name of operating system as string as lowercase contains “win”) THEN ((address of it as string, mac address of it as string) of adapters whose (address of it as string != “0.0.0.0” and exists address of it) of network) ELSE (“Non-Relevant”) ELSE (IF (name of operating system as string as lowercase does not contain “win”) THEN ((address of it as string, mac address of it as string) of ip interfaces whose (address of it as string != “0.0.0.0” and exists address of it) of network) ELSE (“Non-Relevant”)) ELSE (“Non-Relevant”)

E: This expression could not be parsed.

Thanks for the help

(imported comment written by BenKus)

Looks like you have two ‘else (“Non-Relevant”)’ clauses that are not supposed to be there… doest his work for you?

q: IF (name of operating system as string as lowercase contains “win”) THEN ((address of it as string, mac address of it as string) of adapters whose (not loopback of it AND address of it as string != “0.0.0.0” and exists address of it) of network as string) ELSE (IF (name of operating system as string as lowercase does not contain “win”) THEN ((address of it as string, mac address of it as string) of ip interfaces whose (not loopback of it AND address of it as string != “0.0.0.0” and exists address of it) of network as string) ELSE (“Non-Relevant”))
A: 192.168.105.21, 00-24-e8-ef-5b-13

Ben

(imported comment written by SystemAdmin)

Hi Ben,

You would need to exclude the loopback interface for non-windows servers as they don’t have a mac address but do have a IP address and therefore cause the relevance to fail ( “Singular expression refers to nonexistent object.” )

For my own part, I use the following for Solaris, Redhat & AIX servers:-

(name of it, address of it, mac address of it) of ip interfaces whose (name of it does not contain “lo” ) of network as string

One (interesting :s ) feature that I’ve noticed is that if an interface doesn’t have an IP address (or it’s 0.0.0.0) the ‘ip interfaces’ inspector simply ignores the interface. However, the inspector will error if the interface has an IP address but not a mac address.

edit

I’ve just noticed another thread discussing almost exactly the same thing. Because of that thread I discovered the ‘loopback’ inspector - so my example above could also be written as:-

(name of it, address of it, mac address of it) of ip interfaces whose ( loopback of it = false ) of network as string

(imported comment written by SystemAdmin)

Anyone have this fixed? or in an analysis?

Jeff

(imported comment written by BenKus)

Try the one above in my post (I modified it slightly)…

Ben