IPAddressFixup - Global
-
- UpdatedFeb 1, 2024
- 5 minutes to read
- Washington DC
- API reference
The IPAddressFixup API provides methods that ensure that no other device has the same IP address, after a device has been successfully discovered. If any duplicates are found, the IP address field is cleared.
Use with any server-side Discovery script to validate IP addresses.
IPAddressFixup - dedupe(String tableName, String ip)
Removes duplicates of the specified IP address in the specified table.
After a device has been successfully discovered, you can use the dedupe() method to remove the duplicate IP addresses for that device.
Name | Type | Description |
---|---|---|
tableName | String | Table to check for duplicates. |
ip | String | IP address to check for. |
Type | Description |
---|---|
void |
Example
The following example shows how to use dedupe() in a background script to remove duplicate IP addresses for the specified IP address within the cmdb_ci_hardware table.
Example
The following example shows how to use dedupe() in a business rule to remove duplicate IP addresses for the specified IP address within the cmdb_ci_hardware table.
IPAddressFixup - dedupeAll()
Removes all duplicate IP addresses from the tables.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
void |
Example
The following example shows how to use dedupeAll() in a background script to remove all duplicate IP addresses.
Example
The following example shows how to use dedupeAll() in a business rule to remove all duplicate IP addresses.
IPAddressFixup - fix()
Removes all duplicate IP addresses and ensures that the parent ip_address record is set to one of the network interface card's (NIC) IP addresses.
After a device has been successfully discovered, you can use the dedupe() method to remove the duplicate IP addresses for that device and set the parent ip_address record value.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
void |
Example
The following example shows how to use fix() in a background script to remove duplicate IP addresses and set the parent IP address.
Example
The following example shows how to use fix() in a business rule to remove duplicate IP addresses and set the parent IP address.
IPAddressFixup - getParentIP()
Returns the parent IP address for the current device.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | Parent IP address |
Example
The following example shows how to use getParentIP() in a background script to obtain the parent IP address.
Output:
Example
The following example shows how to use getParentIP() in a business rule to obtain the parent IP address.
IPAddressFixup - syncIP()
Ensures that the parent ip_address record is set to one of the NIC's IP addresses, or leaves it alone if there were no NICs.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
void |
Example
This shows an example of using the syncIP() method in a background script.
Example
This shows an example of using the syncIP() method in a business rule.
IPAddressFixup - setParentIP(String ip)
Sets the parent IP address field for the current CI.
Name | Type | Description |
---|---|---|
ip | String | Parent IP address for the current CI. |
Type | Description |
---|---|
void |
Example
The following example shows how to use setParentIP() in a background script to store the parent IP address.
Example
The following example shows how to use setParentIP() in a business rule to store the parent IP address.