Hi, we have defined a life cycle for our server and we would remove IP on the NetworkInterface named "eht0" when the have a transition between state "production" and "decommission"
We have defined in the class Server this tansition
With this function, the ip of the server well removed but not the IP of the networkInterface, why ?
What do I wrong ?
I think it is because I am not on the "current object" and so the update are not done in the database, but so, how to do it ?
If someone have the solution thank in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thank you for your quick response, we have added this line after,
but we have now a "Error page" named "iTop - Fatal Error" with theses informations:
Fatal error, iTop cannot continue.
Error: DBUpdate() could not be used here, please use DBUpdateTracked() instead.
We have tested with the function proposed "DBUpdateTracked()" , but the last one require an argument and I don't found where to get it.
For our protoype, we are using the version 1.0 of itop
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, we have defined a life cycle for our server and we would remove IP on the NetworkInterface named "eht0" when the have a transition between state "production" and "decommission"
We have defined in the class Server this tansition
And so the function:
With this function, the ip of the server well removed but not the IP of the networkInterface, why ?
What do I wrong ?
I think it is because I am not on the "current object" and so the update are not done in the database, but so, how to do it ?
If someone have the solution thank in advance
The network interface is an object of its own in iTop, so if you want to update it you'll have save it as well.
The "main" object ($this) will be saved automatically when the new state is applied, but not the interface.
So in your RemoveEth0IP method, after the line "$oNetItf->Set('ip_address','');", insert the line:
Hi,
thank you for your quick response, we have added this line after,
but we have now a "Error page" named "iTop - Fatal Error" with theses informations:
We have tested with the function proposed "DBUpdateTracked()" , but the last one require an argument and I don't found where to get it.
For our protoype, we are using the version 1.0 of itop
Thanks
Replace the line:
By
It works fine, thanks a lot !!!
Hi Olivier,
Can i ask how you defined your Stimulus to allow you to change from 'Production' to 'Decommission'.... is it Internal or user defined.
Would you mind sharing this please?
Kind Regards