Hi everyone!!
I make some changes in data structure of itop. The last change was to add a new type of network device in iTop. I have a little problem, let me show you .
I create a new class adding in model.itop-config-mgmt.php:
ALTER TABLE `networkdevice` CHANGE `type` `type` INT(11) NULL;
ALTER TABLE `networkdevice` ADD INDEX (`type`);
CREATE TABLE `networkdevicetype` (`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` VARCHAR(255)
NOT NULL, `description` VARCHAR(255) NULL) ENGINE = innodb CHARACTER SET utf8 COLLATE utf8_unicode_ci;
The last thing add in en.dict.itop-config-mgmt.php:
Dict::Add('EN US', 'English', 'English', array(
'Class:NetworkDeviceType' => ' Network Device Type',
'Class:NetworkDeviceType/Attribute:name' => 'Name',
'Class:NetworkDeviceType/Attribute:name+' => 'Name of the device type',
'Class:NetworkDeviceType/Attribute:description' => 'Description',
'Class:NetworkDeviceType/Attribute:description+' =>
'Description of this type of network devices',
// And the menu entry
'Menu:NetworkDeviceTypes' => 'Network Device Types',
'Menu:NetworkDeviceTypes+' => 'All Network Device Types',
));
*******************************************************************
Everything works fine, just one thing. When I create a new device, I can choose any type that I create, but the system assign has type the ID of this type. For example: I create a new Device S005, the type of this device is SWITCH. The type switch has the ID=4. When I look for the device S005 has in the type field the number 4 and not the name of the type. I check in the table NetworkDeviceType and everything is in place. Then I look in the view NetworkDevice and there is a field named type and each row has a number in this field. If some knows where I has mistake please tell me.
Thanks a lot!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) make sure that the 'type' field is clean in MySQL:
UPDATE `networkdevice` SET type = NULL;
ALTER TABLE `networkdevice` CHANGE `type` `type` INT(11) NULL;
2) add the following line after the definition of the 'type' field on the NetworkDevice class:
I am doing something similar to this, except I am adding a new CI type of VirtualServers that are related to CI type Servers. In the same way that NetworkInterfaces are related to Servers. I have that all down and it is recording just great in the database. I have two problems though, one being more important than the other. The main one is, I want a "Virtual Server" tab to appear when I am looking at a CI type of Server so it will list the virtual servers that are related to that Server.
How do I add this tab to show this relationship? Any ideas?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) Modify the Server class definition (in the Init method) to declare a new "Linkset" attribute (use either the class AttributeLinkSet - for 1:n relationships or AttributeLinkSetIndirect - for n:n relationships)
2) Also in the Init method of the server class, change the line that defines the 'details' ZList to add your new attribute at the position you want the tab to appear (linksets are displayed as tabs after the main "properties" tab).
Hope this helps
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the VirtualServer listing view, it has the type column in the view. It seems to be picking up the device_id_finalclass_recall column (which is saying Server) from the view_virtualserver and not the finalclass column which has the correct value of "Virtual Server" in the view. Where is it getting the Server from in the view. The view SQL is awfully convoluted. It was generated by the toolkit. I would really like for this to show up correctly, if possible.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So once I finish with this, and the only thing left is the listing issue I am talking about above, this might be something that would be good to fold into the project. If so, let me know and I would be happy to submit what I did. So far it is working VERY well and exactly what I wanted to be able to track Virtual Servers and which physical server they are on.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
iTop is not using the SQL views at all. The views are just created to ease the life of those who may want to run SQL queries for reporting/data warehousing.
I suspect that your problem may be linked to the definition of your VirtualServer object. If you'd like to post the definition here, I may be able to pinpoint the issue for you.
Last, but not least, yes we are thinking about enhancing the iTop data model to track VMs, farms, storages and all the kind of "virtual stuff" that is common nowadays. This may come for iTop 2.0 though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am working on a blog post of exactly what I did. I need to run through the process again to make sure I have it documented correctly. Problem is, I am not sure when I will get to that. If you want, I can send you the link to what I have so far. You will be hacking and slashing code though. It is not difficult code, but code none the less. Send me an email if you are interested.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to see the results of your work and would appreciate if you could share it with us. Today the virtualization dependencies are really important of a CMDB. At the moment it`s not possible to link the servers with eachother.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FYI, I've submitted enhancement ticket 537 (https://sourceforge.net/apps/trac/itop/ticket/537) to incorporate Virtualisation, Storage, Blades, and Virtual Networking. There's a file attached, and it contains full files and diffs against iTop 1.2.1.
Hope that helps!
/Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone!!
I make some changes in data structure of itop. The last change was to add a new type of network device in iTop. I have a little problem, let me show you .
I create a new class adding in model.itop-config-mgmt.php:
MetaModel::Init_AddAttribute(
new AttributeString("name", array("allowed_values"=>null, "sql"=>"name",
"default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(
new AttributeString("description", array("allowed_values"=>null, "sql"=>"description",
"default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_SetZListItems('details', array('name', 'description'));
MetaModel::Init_SetZListItems('standard_search', array('name', 'description'));
MetaModel::Init_SetZListItems('list', array('name', 'description'));
}
}
Then create a menu adding in model.itop-config-mgmt.php:
I replace the line in model.itop-config-mgmt.php:
Finally update de database:
CREATE TABLE `networkdevicetype` (`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` VARCHAR(255)
NOT NULL, `description` VARCHAR(255) NULL) ENGINE = innodb CHARACTER SET utf8 COLLATE utf8_unicode_ci;
The last thing add in en.dict.itop-config-mgmt.php:
*******************************************************************
Everything works fine, just one thing. When I create a new device, I can choose any type that I create, but the system assign has type the ID of this type. For example: I create a new Device S005, the type of this device is SWITCH. The type switch has the ID=4. When I look for the device S005 has in the type field the number 4 and not the name of the type. I check in the table NetworkDeviceType and everything is in place. Then I look in the view NetworkDevice and there is a field named type and each row has a number in this field. If some knows where I has mistake please tell me.
Thanks a lot!!
I found the answer!!!
Thanks to dflaven
1) make sure that the 'type' field is clean in MySQL:
UPDATE `networkdevice` SET type = NULL;
ALTER TABLE `networkdevice` CHANGE `type` `type` INT(11) NULL;
2) add the following line after the definition of the 'type' field on the NetworkDevice class:
MetaModel::Init_AddAttribute(new AttributeExternalField("type_name", array("allowed_values"=>null, "extkey_attcode"=>"type", "target_attcode"=>"name", "is_null_allowed"=>true, "depends_on"=>array())));
This works for me, everything is fine now!!!!
Just for your information, the wiki is still under construction but already contains a new version of the customization "toolkit".
Have a look at the article "http://sourceforge.net/apps/mediawiki/itop/index.php?title=Toolkit_for_modifying_the_data_model" if you are dealing with customizations of iTop.
Hope this helps
hello, guys
i'm a fan of itop from China, i have a problem of downloading iTopDataModelToolkit-1.1.zip.
i cann't open www.combodo.com!
could someone be good as to send me it to unbending.me@gmail.com
Thank you very much!
I am doing something similar to this, except I am adding a new CI type of VirtualServers that are related to CI type Servers. In the same way that NetworkInterfaces are related to Servers. I have that all down and it is recording just great in the database. I have two problems though, one being more important than the other. The main one is, I want a "Virtual Server" tab to appear when I am looking at a CI type of Server so it will list the virtual servers that are related to that Server.
How do I add this tab to show this relationship? Any ideas?
To make a new tab appear on the Server object:
1) Modify the Server class definition (in the Init method) to declare a new "Linkset" attribute (use either the class AttributeLinkSet - for 1:n relationships or AttributeLinkSetIndirect - for n:n relationships)
2) Also in the Init method of the server class, change the line that defines the 'details' ZList to add your new attribute at the position you want the tab to appear (linksets are displayed as tabs after the main "properties" tab).
Hope this helps
I will give this a try. One other question.
In the VirtualServer listing view, it has the type column in the view. It seems to be picking up the device_id_finalclass_recall column (which is saying Server) from the view_virtualserver and not the finalclass column which has the correct value of "Virtual Server" in the view. Where is it getting the Server from in the view. The view SQL is awfully convoluted. It was generated by the toolkit. I would really like for this to show up correctly, if possible.
So once I finish with this, and the only thing left is the listing issue I am talking about above, this might be something that would be good to fold into the project. If so, let me know and I would be happy to submit what I did. So far it is working VERY well and exactly what I wanted to be able to track Virtual Servers and which physical server they are on.
Hi synchrophoto,
iTop is not using the SQL views at all. The views are just created to ease the life of those who may want to run SQL queries for reporting/data warehousing.
I suspect that your problem may be linked to the definition of your VirtualServer object. If you'd like to post the definition here, I may be able to pinpoint the issue for you.
Last, but not least, yes we are thinking about enhancing the iTop data model to track VMs, farms, storages and all the kind of "virtual stuff" that is common nowadays. This may come for iTop 2.0 though.
Hi synchrophoto.
I also need to manage VirtualServers related to Phisical ones.
Could you be so kind and publish your changes?
Don't want to reinvent the weel.
Thank you very much.
Ely.
I am working on a blog post of exactly what I did. I need to run through the process again to make sure I have it documented correctly. Problem is, I am not sure when I will get to that. If you want, I can send you the link to what I have so far. You will be hacking and slashing code though. It is not difficult code, but code none the less. Send me an email if you are interested.
Great.
What I think it would be best, would be to compare your source code to the original source of the same version (is it 1.1?) to create a "patch" file.
That way you shouldn't miss anything. I hope.
Don't think we need to compare the database, since it gets created acordingly to the model source code. Right?
If you want me to do it, I would gladly help you comparing the sources.
My address is: ely.itop.1 using the domain mitalteli.com.
Thanks again.
Ely
Hello again synchrophoto
My e-mail address is: ely.itop.1 using the domain mitalteli.com
I would gladly help you see if you are missing something in your blog. :)
Well. It's me again.
synchrophoto: I'm Sorry to insist, but I would really appreciate if you could show me what you did.
Have you been able to post it? Where can I find it?
My e-mail address is: ely.itop.1 using the domain mitalteli.com (replace " using the domain " by an "at sign")
Thanks.
Hi,
I would like to see the results of your work and would appreciate if you could share it with us. Today the virtualization dependencies are really important of a CMDB. At the moment it`s not possible to link the servers with eachother.
FYI, I've submitted enhancement ticket 537 (https://sourceforge.net/apps/trac/itop/ticket/537) to incorporate Virtualisation, Storage, Blades, and Virtual Networking. There's a file attached, and it contains full files and diffs against iTop 1.2.1.
Hope that helps!
/Mike