Why can't i update the ip of a server ?

Fotios Kossyvas
Tera Contributor

I tried to change the ip of a server after it's discovery. I tried to set it to a ip used in one of it's network adapters (the server has more than one).
It seems that i can change it, i mean the server form has the ip field unprotected and there's no error after updating it BUT after clicking the update button the ip remains the same as before. I have the admin role, can anyone tell me what am i dong wrong?

1 ACCEPTED SOLUTION

gr.addQuery("name", "eth0");

line always taking the eth0 IP.

So even you updated with any IP, it will only take eth0 one

you have to change it to erogozine or the one you want.

 

Also this BR is not OOTB, you have to check who created this BR in your team.

Mark answer as correct if its helpful

Regards,
Anshu

View solution in original post

5 REPLIES 5

Vishnu Prasad K
Giga Guru

Hi Fotios,

 

Check for any client scripts configured with return false and without an alert

Anshu_Anand_
Kilo Sage
Kilo Sage

You have to troubleshoot it.

Once discovery completes for a CI, a discovery.device.complete event is created. The script action which responds to this event calls script include IPAddressFixup. IPAddressFixup is controlled by the following properties:

  1. glide.discovery.enforce_ip_sync
  2. glide.discovery.exclude_ip_sync_classes
  3. glide.discovery.enforce_unique_ips

Note: Post discovery can update the ip_address field for both probes and pattern based discovery.

Discovery Properties

glide.discovery.enforce_ip_sync:

  • Prevents the system from using a discovered IP address in the CI record if the address doesn't match that of a NIC on the device. If this property is true, Discovery checks the IP address returned to determine if it is associated with a NIC on the device. If the address is not associated with a NIC, Discovery uses the IP address from one of the NICs instead. The IP address used will be the first found in the list of IP addresses belonging to the CI, the IP address will be ordered by the ip_address column. 

glide.discovery.exclude_ip_sync_classes:

  • Defines CI classes whose IP addresses should not be substituted if the address returned by Discovery does not match one of the devices' NICs. Use a comma separated list to define multiple classes. By default, the system uses the management IP of a load balancer returned by Discovery in the CI record, rather than substituting it for the IP address of one of the load balancer's NICs.

glide.discovery.enforce_unique_ips:

  • Each time a computer, printer, or network gear is discovered, and that device has a valid IP address, then any other devices with the same IP address have their IP address field cleared.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0687602

 

Enable the script tracer and try to manually change the IP address

find_real_file.png

Then you can see which scripts run after the update of IP address

Hope its help

Regards,
Anshu

Thank you anshu, explaining me how to use the Script Traces was very helpful.

I found that there is a business rule called Force to use IP prod network card  which prevents me from changing the ip (screenshot of the script traced attached to this post), even if i use an ip already present on a NIC.

I mean that the server

has the ip 192.168.76.70 (which is from NIC eth0)

and when i am trying to change it to 192.168.16.160 (NIC Erogazione)

it remains 192.168.76.70 (eth0)

 

I am not good enough yet to understand the script code of the BR, can you tell me if this means that it's enforcing only the eth0 NIC ip?

 

(function executeRule(current, previous /*null when async*/) {
//(function onBefore(current, previous) {

// Add your code here

var id = current.sys_id;
//var id = current.cmdb_ci;
//gs.log("TESTAT - IP - sysid: "+ id);

var gr = new GlideRecord("cmdb_ci_network_adapter");
gr.addQuery("cmdb_ci", id);
gr.addQuery("name", "eth0");
gr.addQuery("install_status", "1");
gr.query();
if (gr.next()) {
//gs.log("TESTAT - IP before: "+ current.ip_address);
//gs.log("TESTAT - IP eth0: "+ gr.ip_address);

if (current.ip_address != gr.ip_address) {
current.ip_address=gr.ip_address;
//gs.log("TESTAT - IP changed: "+ current.ip_address);
gr.update();
}
//gs.log("TESTAT - IP after: "+ current.ip_address);
}

})(current, previous);

 

 

gr.addQuery("name", "eth0");

line always taking the eth0 IP.

So even you updated with any IP, it will only take eth0 one

you have to change it to erogozine or the one you want.

 

Also this BR is not OOTB, you have to check who created this BR in your team.

Mark answer as correct if its helpful

Regards,
Anshu