Share

Read next article:

"WhatsUp Gold Network Ports"

Read previous article:

"Create Customized Syslog Monitor"

Change Display Name to Host Name

In Default | 0 comments

The script will change the display name of the device to be the same as its host name.

  • Display name is populated during discovery, but can be changed by the user at any time.
  • Host name is the DNS name that can be resolved to IP address.
UPDATE Device
SET Device.sDisplayName = NetworkInterface.sNetworkName
FROM Device
LEFT OUTER JOIN NetworkInterface ON 
Device.nDefaultNetworkInterfaceID = NetworkInterface.nNetworkInterfaceID

Apply changes for specific group

UPDATE Device
SET Device.sDisplayName = NetworkInterface.sNetworkName
FROM Device
LEFT OUTER JOIN NetworkInterface ON 
Device.nDefaultNetworkInterfaceID = NetworkInterface.nNetworkInterfaceID
LEFT OUTER JOIN PivotDeviceToGroup ON PivotDeviceToGroup.nDeviceID = Device.nDeviceID
LEFT OUTER JOIN DeviceGroup ON DeviceGroup.nDeviceGroupID = PivotDeviceToGroup.nDeviceGroupID
WHERE DeviceGroup.sGroupName = 'Test'

Apply changes for devices with certain Attribute

UPDATE Device
SET Device.sDisplayName = NetworkInterface.sNetworkName
FROM Device
LEFT OUTER JOIN NetworkInterface ON 
Device.nDefaultNetworkInterfaceID = NetworkInterface.nNetworkInterfaceID
LEFT OUTER JOIN DeviceAttribute ON DeviceAttribute.nDeviceID = Device.nDeviceID
WHERE DeviceAttribute.sName = 'Location' AND DeviceAttribute.sValue = 'Data Center Room'
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on LinkedIn0Pin on Pinterest0

Leave a Reply

Allowed Tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

3 × 5 =

Facebook

Unable to display Facebook posts.
Show error

Error: Unsupported get request. Object with ID 'orchtechsoftwarehouse' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
Type: GraphMethodException
Code: 100
Please refer to our Error Message Reference.