- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Server Management - Systems Insight Manager
- >
- Re: IP addresses showing instead of names
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 03:31 AM
тАО12-29-2005 03:31 AM
IP addresses showing instead of names
Rather than the host name the IP address appears as the machine name in the list.
Please help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 04:07 AM
тАО12-29-2005 04:07 AM
Re: IP addresses showing instead of names
I know it used to do a reverse DNS lookup of names (in 4.2 I think) which caused problems in our environment since we do not use our SUN DNS hostnames for our Wintel servers here. But that seems to have been fixed in 5.0.
At that time I wrote a vbs script and ran it ever night that would get the SNMP name and if that failed I'd try a WMI get and rewrote the names in the database so they would show up with our servernames instead of the location-based alphanumeric hostnames.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 04:13 AM
тАО12-29-2005 04:13 AM
Re: IP addresses showing instead of names
These devices, as I stated, are not computers. They are control units that allow people to use a "debit card" to pay for copiers. They run a unix based OS. I have to manually create the DNS records but unfortunately the reverse records were not all created properly.
I am trying to figure out a way to script the process. Otherwise I have to do it manually. Eck :P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 04:20 AM
тАО12-29-2005 04:20 AM
Re: IP addresses showing instead of names
Option Explicit
Dim Conn, oRs, strComputer
Set Conn = CreateObject("ADODB.Connection")
Conn.Open "DSN=InsightDB;UID=USERIDHERE;PWD=PASSWORDHERE;DATABASE=Insight_v42_0_153223624"
Set oRs = CreateObject("ADODB.Recordset")
oRs.Open "Select Name, fullDNSName from dbo.devices", Conn
Do While Not oRs.EOF
strComputer = Trim(oRs.Fields("fullDNSName"))
' Attempt to get system name from SNMP
Call GetSNMPSystemName(strComputer)
' IF SNMP call fails to return name, attempt WMI call
If strComputer = "" then
strComputer = Trim(oRs.Fields("fullDNSName"))
Call GetWMISystemName(strComputer)
End If
If strComputer = "" Then
' SNMP & WMI calls failed, do nothing
'Debug.Print Trim(oRs.Fields("Name")), Trim(oRs.Fields("fullDNSName"))
Else
Conn.Execute ("UPDATE dbo.devices SET dbo.devices.Name = '" & strComputer & _
"' WHERE (((dbo.devices.fullDNSName)='" & Trim(oRs.Fields("fullDNSName")) & "'));")
'Debug.Print strComputer, Trim(oRs.Fields("fullDNSName"))
End If
oRs.MoveNext
Loop
oRs.Close
WSCript.Quit
Sub GetSNMPSystemName(ByRef strComputer)
Dim strTargetSnmpDevice, objWmiLocator, objWmiServices, objWmiNamedValueSet
Dim colSystem, objInterface, objProp
strTargetSnmpDevice = strComputer
strComputer = ""
On Error Resume Next
Set objWmiLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWmiServices = objWmiLocator.ConnectServer("", "root\snmp\localhost")
Set objWmiNamedValueSet = CreateObject("WbemScripting.SWbemNamedValueSet")
objWmiNamedValueSet.Add "AgentAddress", strTargetSnmpDevice
objWmiNamedValueSet.Add "AgentReadCommunityName", "public"
Set colSystem = objWmiServices.InstancesOf("SNMP_RFC1213_MIB_system", , _
objWmiNamedValueSet)
For Each objInterface In colSystem
For Each objProp In objInterface.Properties_
If objProp.Name = "sysName" Then strComputer = objProp.Value
Next
Next
' If the name is a full DNS name return only the Hostname
If InStr(strComputer, ".") > 0 Then
strComputer = Left(strComputer, InStr(strComputer, ".") - 1)
End If
' If there was an error, then return ""
If Err.Number <> 0 Then
strComputer = ""
Err.Clear
End If
End Sub
Sub GetWMISystemName(ByRef strComputer)
'declare variables
Dim objWMIService, colItems, objItem
On Error Resume Next
'get WMI service
Set objWMIService = GetObject("winmgmts:\\" & _
strComputer & "\root\cimv2")
If Err.Number <> 0 Then
strComputer = ""
Exit Sub
End If
'get item collection
Set colItems = objWMIService.ExecQuery( _
"Select * from Win32_OperatingSystem")
For Each objItem In colItems
strComputer = objItem.CSName
Next
If Err.Number <> 0 Then
strComputer = ""
Exit Sub
End If
End Sub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 04:25 AM
тАО12-29-2005 04:25 AM
Re: IP addresses showing instead of names
How about a script that can read all the A records from the DNS server and then write the associate PTR records?
That would fix everything!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 04:49 AM
тАО12-29-2005 04:49 AM
Re: IP addresses showing instead of names
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright ├В┬й1996-2001 VBnet, Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' You are free to use this code within your own applications,
' but you are expressly forbidden from selling or otherwise
' distributing this source code without prior written consent.
' This includes both posting free demo projects made from this
' code as well as reproducing the code in text or html format.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
So all I believe I can do is point you to MVPS.org and vbnet.
http://vbnet.mvps.org/index.html?code/network/hostnamefromip.htm
It takes a little work to make it want you want, but the examples are very helpful to get you started.
I use mine by putting values into Excel and using a formula to return hostname from IP or vice-versa. It's come in very handy here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 05:00 AM
тАО12-29-2005 05:00 AM
Re: IP addresses showing instead of names
'on error resume next
' This VBScript code shows how to add an A record and PTR record using
' the DNS WMI Provider
' ---------------------------------------------------------------
' From the book "Active Directory Cookbook" by Robbie Allen
' Publisher: O'Reilly and Associates
' ISBN: 0-596-00466-4
' Book web site: http://rallenhome.com/books/adcookbook/code.html
' ---------------------------------------------------------------
' ------ SCRIPT CONFIGURATION ------
strForwardDomain = "xerox.local"
set objDNS = GetObject("winMgmts:root\MicrosoftDNS")
set objRR = objDNS.Get("MicrosoftDNS_ResourceRecord")
set objDNSServer = objDNS.Get("MicrosoftDNS_Server.Name="".""")
' ------ END CONFIGURATION ---------
Const ForReading = 1
strCurrentDir = Left(WScript.ScriptFullName,InstrRev(WScript.ScriptFullName,"\"))
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
("om.txt", ForReading)
strServers = objTextFile.ReadAll
objTextFile.Close
arrComputers = Split(strServers, vbCrLf)
for each strComputer in arrComputers
arrPTRInfo = Split(strComputer, ",")
strHostName = strComputer
arrrevIP = Split(arrPTRInfo(1), ".")
strReverseRRAdd = arrRevIP (3) & "." & arrrevIP(2) & "." & arrRevIP(1) & "." & arrRevIP(0) & ".in-addr.arpa IN PTR " & strHostName & "." & strForwardDomain
strReverseDomain = arrrevIP(2) & "." & arrRevIP(1) & "." & arrRevIP(0) & ".in-addr.arpa"
strNull = objRR.CreateInstanceFromTextRepresentation( _
objDNSServer.Name, _
strReverseDomain, _
strReverseRRAdd, _
objOutParam)
set objRR2 = objDNS.Get(objOutParam)
WScript.Echo "Created Record: " & objRR2.TextRepresentation
next
It pulls from a text file that I exported from the DNS server but I do not now how to create the PTR record now that I have it correctly formated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 05:26 AM
тАО12-29-2005 05:26 AM
Re: IP addresses showing instead of names
Do you know that those reverse names are not in your DNS now?
Back to an earlier point: It would be nice to know what protocols and what order the CMS uses when doing discovery to name the devices. Once they are there does nightly discovery change them as it used to in 4.2? I don't seem to have those problems in 5.0 anymore, but don't know what changes HP implemented.
My earlier solution was to rewrite the info in the SQL database (scheduled task after the nightly discovery) that our CMS uses so that our MS server names would show rather than our location based SUN alpha-numeric DNS hostnames would display.
That angle (rewriting names in the database) might provide the results you want, albeit from a slightly different direction than you were looking for.
You may have to just run it once; the names may stick. But an answer from someone on the discovery process of the CMS would be nice first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 05:30 AM
тАО12-29-2005 05:30 AM
Re: IP addresses showing instead of names
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 05:36 AM
тАО12-29-2005 05:36 AM
Re: IP addresses showing instead of names
I think the easiest workaround for Michael would be to create a local hosts file rather than trying to create the PTR records...