Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Pulling ifAlias from switchports

David Casper
Tera Guru

My goal is to pull the ifAlias value from the Cisco switchports as follows.
 - If a specific value is contained within ifAlias

 - then extract a specific value from ifAlias

 - use that value to pull the sys_id from the company table

 - use the sys_id to populate the company field on the switchport table

 

Since I don't want to edit the existing pattern, I'm using an extension.

 

The first issue I ran into was finding which OID to use, which I resolved. I'm currently able to see the ifAlias value using a SNMP Query and tabular variable. It shows the ifAlias and insatnceID values.

DavidCasper_0-1727293047793.png

 

 

I then went to store that value in the existing $switchportsTable which is created by the OOB Network Switch discovery pattern.  When trying this I keep receiving a "contains rows of an unsupported type" error. "Test failed: "ifXEntry[*].ifAlias" contains rows of an unsupported type"

DavidCasper_1-1727293081296.png

 

Now I'm looking for some recommendations where to go from here. 
1) what is causing the "unsupported type" error I'm receiving

2) how should I resolve this and should I store it in a different table or variable? 

3) I assume I'll have to use a pre sensor script (see referenced articles below)
4) any other recommendations/best practices are welcome!

 

Thanks!

 

Using Pre/Post Processing Scripts to handle refere... - Page 3 - ServiceNow Community

Patterns Pre Post Scripts - Purpose and Usecases - ServiceNow Community

1 REPLY 1

Pratiksha
Mega Sage
Mega Sage

I have done this before. I think I have backup of this. Try this let me know if it works.