Table of Contents
WMI - IP Route Provider
Preface
I would like to describe the possibility to use WMI interface of MS Windows for network data collection.
It is possible to use it in the case that you are administrator of large infrastructure. In this case probably you would like to keep your data in your CMDB. Until you are managing just several servers it is possible to maintain your CMDB manually. On another hand, if you will start integrating your tools, at the time when you have had full of servers. This can provide you solid fundament for future grow of your infrastructure.
IPv6 and IPv4 Support in WMI
Win32_NetworkAdapterConfiguration
Official documentation: http://msdn.microsoft.com/en-us/library/aa822883
This class can be used for collecting of information related to configuration of all network interfaces on your MS Windows server. For more details about information that is possible to collect check the structure of the class.
Structure:
[root@Linux-WMI-Client ~]# wmic -U wmiuser%wmipasswd //wmi-server.localnet "SELECT * FROM Win32_NetworkAdapterConfiguration" | head -2 | awk -F"|" '{ for (i=1;i<=NF;i++) print $i}' CLASS: Win32_NetworkAdapterConfiguration ArpAlwaysSourceRoute ArpUseEtherSNAP Caption DatabasePath DeadGWDetectEnabled DefaultIPGateway DefaultTOS DefaultTTL Description DHCPEnabled DHCPLeaseExpires DHCPLeaseObtained DHCPServer DNSDomain DNSDomainSuffixSearchOrder DNSEnabledForWINSResolution DNSHostName DNSServerSearchOrder DomainDNSRegistrationEnabled ForwardBufferMemory FullDNSRegistrationEnabled GatewayCostMetric IGMPLevel Index InterfaceIndex IPAddress IPConnectionMetric IPEnabled IPFilterSecurityEnabled IPPortSecurityEnabled IPSecPermitIPProtocols IPSecPermitTCPPorts IPSecPermitUDPPorts IPSubnet IPUseZeroBroadcast IPXAddress IPXEnabled IPXFrameType IPXMediaType IPXNetworkNumber IPXVirtualNetNumber KeepAliveInterval KeepAliveTime MACAddress MTU NumForwardPackets PMTUBHDetectEnabled PMTUDiscoveryEnabled ServiceName SettingID TcpipNetbiosOptions TcpMaxConnectRetransmissions TcpMaxDataRetransmissions TcpNumConnections TcpUseRFC1122UrgentPointer TcpWindowSize WINSEnableLMHostsLookup WINSHostLookupFile WINSPrimaryServer WINSScopeID WINSSecondaryServer
Win32_NetworkAdapter
Official documentation: http://msdn.microsoft.com/en-us/library/aa822883
This class can be used for collecting of information related to hardware of all network interfaces on your MS Windows server. For more details about information that is possible to collect check the structure of the class.
Structure:
[root@Linux-WMI-Client ~]# wmic -U wmiuser%wmipasswd //wmi-server.localnet "SELECT * FROM Win32_NetworkAdapter" | head -2 | awk -F"|" '{ for (i=1;i<=NF;i++) print $i}' CLASS: Win32_NetworkAdapter AdapterType AdapterTypeId AutoSense Availability Caption ConfigManagerErrorCode ConfigManagerUserConfig CreationClassName Description DeviceID ErrorCleared ErrorDescription GUID Index InstallDate Installed InterfaceIndex LastErrorCode MACAddress Manufacturer MaxNumberControlled MaxSpeed Name NetConnectionID NetConnectionStatus NetEnabled NetworkAddresses PermanentAddress PhysicalAdapter PNPDeviceID PowerManagementCapabilities PowerManagementSupported ProductName ServiceName Speed Status StatusInfo SystemCreationClassName SystemName TimeOfLastReset
IP Route Provider
Official documentation: http://msdn.microsoft.com/en-us/library/aa391405
The preinstalled IP Route provider supplies IPV4 network routing information, including (but not limited to) the information available through the route print command. Provided data comes from the IP4 route tables and the persisted route table in the registry.
Win32_IP4RouteTable
Official documentation: http://msdn.microsoft.com/en-us/library/aa394162
The Win32_IP4RouteTable WMI class represents information that governs the routing of network data packets.
Structure:
[root@Linux-WMI-Client ~]# wmic -U wmiuser%wmipasswd //wmi-server.localnet "SELECT * FROM Win32_IP4RouteTable" | head -2 | awk -F"|" '{ for (i=1;i<=NF;i++) print $i}' CLASS: Win32_IP4RouteTable Age Caption Description Destination Information InstallDate InterfaceIndex Mask Metric1 Metric2 Metric3 Metric4 Metric5 Name NextHop Protocol Status Type
Win32_IP4PersistedRouteTable
Official documentation: http://msdn.microsoft.com/en-us/library/aa394161
The Win32_IP4PersistedRouteTable WMI class represents persisted IP routes. By default, the routes added to the routing table are not permanent. Rebooting the computer clears the routes from the table. However, the following command makes the route persist after the computer is restarted: route -p add.
Persistent entries are automatically inserted again in the route table each time the route table is rebuilt. The operating system stores persistent routes in the registry. An entry can be removed through the method call SWbemServices.
This class is only applicable to IPv4 and does not return IPX or IPv6 data.
Structure:
[root@Linux-WMI-Client ~]# wmic -U wmiuser%wmipasswd //wmi-server.localnet "SELECT * FROM Win32_IP4PersistedRouteTable" | head -2 | awk -F"|" '{ for (i=1;i<=NF;i++) print $i}' CLASS: Win32_IP4PersistedRouteTable Caption Description Destination InstallDate Mask Metric1 Name NextHop Status
Win32_ActiveRoute
Official documentation: http://msdn.microsoft.com/en-us/library/aa394065
The Win32_ActiveRoute association WMI class relates the current IP4 route to the persisted IP route table.
This class is only applicable to IP4 and does not return IPX or IP6 data.
Structure:
[root@Linux-WMI-Client ~]# wmic -U wmiuser%wmipasswd //wmi-server.localnet "SELECT * FROM Win32_ActiveRoute" | head -2 | awk -F"|" '{ for (i=1;i<=NF;i++) print $i}' CLASS: Win32_ActiveRoute SameElement SystemElement
URL's
WMI Providers: http://msdn.microsoft.com/en-us/library/aa394570
IPv6 and IPv4 Support in WMI: http://msdn.microsoft.com/en-us/library/aa822883
Win32_NetworkAdapter: http://msdn.microsoft.com/en-us/library/aa822883
IP Route Provider: http://msdn.microsoft.com/en-us/library/aa391405