Pattern Designer model_id

AchimM279672093
Tera Contributor

Hello,

I would like to set the model for an SNMP device in Pattern Designer.

I can read the model via sysdescr, but I can’t enter this value directly under $cmdb_ci_ip_switch[*].model_id. To do that, I would need to know the model_id.
This is, of course, difficult because the model may not have existed previously, and even if it did, I can’t find a way to determine the model_id in Pattern Designer.

Unfortunately, the Pattern Designer does not have the MakeAndModelJS function, as is available for probes/sensors.

Does anyone know of a way to enter the model in plain text?

I would appreciate a response.

 

Best regards,
Achim

4 REPLIES 4

thomasbueck
Giga Contributor

Hi,

take a look in the Pre Post Processing scripts, there are pre processing scripts like 'Handle Model and Manufacturer for HMC' which you can use as example.
You find it directly in the menu with 'pre post' or sa_pattern_prepost_script

AchimM279672093
Tera Contributor

Thanks for your answer.

 

I'm a little bit confused, because ServiceNow is doing it directly, for example in the Network Switch pattern -> discovery -> Step 3 Insert model to cmdb_ci_ip_switch.

If I'm doing the same in a pattern extension it doesn't work.

 

Screenshot 2026-05-07 143937.png

thomasbueck
Giga Contributor

@AchimM279672093 
I assumed you get the model name, which you can't enter directly in the pattern as you need to look up the value. This would be possible with pre post scripts as MakeAndModelJS function can be used there.
If you have the value available you can add it in the pattern. When there is need to transform it you can use EVAL scripts.
This is the kb article: KB0647736 a good explanation video is: https://youtu.be/wuuG85XtL1s?si=wMhS103STTfa9nMj

GlideFast Service Delivery Director/ITOM Architect Robert Geen dives into an advanced ServiceNow Service Mapping topic: using eval scripts inside discovery patterns. While not for everyday use, eval scripts are a powerful tool when you need to go beyond standard parsing methods to handle complex ...