Technote (FAQ)
Question
What are the methods available in ITNM to enrich the events ?
Answer
By default - we have two methods (via ITNM) you can opt to enrich events i.e.
1) Enrich events via probe rules (nco_p_ncpmonitor.rules)
2) Enrich events via EventGateway (ncp_g_event)
Method#1: In this method you can only enrich with topology attributes that are made available by Poller. The list of attributes are @ http://www-01.ibm.com/support/docview.wss?uid=swg21380581
If you have custom attributes (for e.g. ExtraInfo->Customer) - such attributes are not available as Poller is hardcoded with only specific attributes.
Method#2: This method works to enrich events of any topology attribute. Below are steps involved and you can use this example as a template and make necessary changes to meet specific requirements:
a) Stop ITNM (itnm_stop ncp)
b) Alter the ncim.entityData table to accommodate all custom Attributes.
In my example - I got NCIM as MySql and custom column as 'GoGoCustom':
mysql> use ncim;
Database changed
mysql> ALTER TABLE entityData ADD GoGoCustom VARCHAR(255) AFTER manual;
Above command adds column after last column in the table i.e. 'manual'.
mysql> desc entityData;
+------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| entityId | int(11) | NO | PRI | NULL | |
| mainNodeEntityId | int(11) | YES | MUL | NULL | |
| entityName | varchar(255) | NO | MUL | NULL | |
| entityType | int(11) | NO | MUL | NULL | |
| createTime | datetime | NO | | NULL | |
| changeTime | datetime | NO | | NULL | |
| displayLabel | varchar(255) | NO | | NULL | |
| description | varchar(512) | YES | | NULL | |
| alias | varchar(255) | YES | | NULL | |
| cdmAdminState | tinyint(4) | NO | | 0 | |
| manual | tinyint(4) | NO | | 0 | |
| GoGoCustom | varchar(255) | YES | | NULL | |
+------------------+--------------+------+-----+---------+-------+
12 rows in set (0.00 sec)
c) Modify $NCHOME/etc/precision/ModelNcimDb.DOMAIN.cfg so that the new attribute is mapped and ncp_model can write those custom values to the database.
insert into dbModel.entityMap
(
EntityFilter,
TableName,
DisplayLabel,
FieldMap,
Relationships
)
values
(
"1=1",
"entityData",
"eval(multibyte, 'LOOKUP(`m_DisplayLabel`, &ExtraInfo, &EntityName)')",
{
entityId = "eval(int, '&ObjectId')",
..................deleted few lines.......................
manual = "eval(int, '0 + &Manual')",
GoGoCustom = "eval(text, '&ExtraInfo->m_WHATEVER')"
},
The key is - you must add these custom attributes in "1=1" (one to one) EntityFilter - so that we check each and every record of topology in-order to populate NCIM db.
d) Modify ITNM Gateway Stitcher to pick new attribute - this is done under $NCHOME/precision/eventGateway/stitchers/StandardEventEnrichmet.DOMAIN.stch
StitcherRules
{
Record entity = ARG_1;
Record enrichedFields;
int entityType = @entity.entityData.ENTITYTYPE;
.............deleted few lines...................
text GoGoCustom= @entity.entityData.GOGOCUSTOM;
@enrichedFields.GoGoCustom=GoGoCustom;
One caveat is that - the column names of entityData should be listed in all capitals - though we created as 'GoGoCustom', but with in the stitcher, it should be listed as 'GOGOCUSTOM'.
e) Now, its time to pass that custom attribute to ObjectServer: this is done under $NCHOME/etc/precision/EventGatewaySchema.DOMAIN.cfg within ncp2nco section:
insert into config.ncp2nco
(
FieldFilter
)
values
(
[
"NmosCauseType",
...........deleted few lines..............
"NmosSerial",
"GoGoCustom",
............deleted few lines..........
"NmosClassName"
]
);
f) Last but not least, all the custom attributes must exist in ObjectServer to receive ITNM Gateway updates. In this case, ObjectServer 'alerts.status' table was modified with below command:
1> alter table alerts.status add column GoGoCustom varchar(255);
2> go
(0 rows affected)
That's it really. Once above changes are made - restart ITNM as normally (itnm_start ncp).
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.