Hello
I'm trying to find where the type of a certain config item is saved.
I've looked everywhere in the database, and the only thing saved is the Class (i.e Hardware, Network, etc..)
But I need to extract the type, through a view, to send it to a reporting tool. I need to be able to differentiate between Router, Modem, etc...
The only thing close I found was in table "configitem_history", when you update the configitem with a new a type, it shows something like
"[1]{'Version'}[1]{'Type'}[1]%%%%58"
This is not practical and I'm hoping I could do without. I tried going through the code to see how OTRS saves/reads , but I've been unlucky so far.
Any help or tip would be highly appreciated.
Regards
ITSM: get type of config item
-
- Znuny newbie
- Posts: 1
- Joined: 30 May 2011, 12:55
- Znuny Version: 3.0.x
- Real Name: Jad Kanounji
- Company: Navlink S.A.L
ITSM: get type of config item
Httpd 2.2.3 with mod_perl 2.0.4
Perl 5.8.8
OTRS 3.0.6
RHEL 5.5 x64
Perl 5.8.8
OTRS 3.0.6
RHEL 5.5 x64
-
- Znuny newbie
- Posts: 11
- Joined: 15 Sep 2011, 23:42
- Znuny Version: 3.0.10
- Real Name: Brian Goff
Re: ITSM: get type of config item
Not sure what you mean by type.
If Type is a field in your CI definition then the only place to get it is from the xml_storage table.
Links work as follows:
config_item.id = configitem_version.config_item_id
configitem_version.id = xml_storage.xml_key
In xml_storage you should look at the xml_content_key and look at the "Content" record for that field.
So something like "[1]{'Version'}[1]{'Type'}[1]['Content']", then the value is xml_content_value.
The xml_content_key field is a bit weird to look at w/o knowing what all of it means.
IF there is only 1 iteration of the Type field and Type has no sub-fields, then having your SQL statement lookup [1]{'Version'}[1]['Type'][1]['Content'] and selecting xml_content_value should give you what you need.
Keep in mind that Type may be an ID number to a reference in the GeneralCatalog.
If Type is a field in your CI definition then the only place to get it is from the xml_storage table.
Links work as follows:
config_item.id = configitem_version.config_item_id
configitem_version.id = xml_storage.xml_key
In xml_storage you should look at the xml_content_key and look at the "Content" record for that field.
So something like "[1]{'Version'}[1]{'Type'}[1]['Content']", then the value is xml_content_value.
The xml_content_key field is a bit weird to look at w/o knowing what all of it means.
IF there is only 1 iteration of the Type field and Type has no sub-fields, then having your SQL statement lookup [1]{'Version'}[1]['Type'][1]['Content'] and selecting xml_content_value should give you what you need.
Keep in mind that Type may be an ID number to a reference in the GeneralCatalog.