The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discovery Sensor Relationships for Wireless AP's

bernard6
Mega Expert

Hi Everyone,


I'm creating a probe/sensor for discovering Wireless Access Points.   The issue with discovering them is that the AP's do not have SNMP.   Though i'm able to query their information from the Wireless Controller they are connected to via SNMP.   I've built the probe and sensor and I have added it to the controller and it is working.

The issue i'm facing now is i'm trying to create a 'Controller for::Controlled by' relationship between the controller and the AP.   Since i'm creating the AP in the sensor i have the information i need for the AP, but i can't seem to determine how to get a reference to the controller the probe ran against to use for the parent of the relationship.

Anyone know how i could do this?

Thanks,

David Bernard

1 ACCEPTED SOLUTION

jake_mckenna
ServiceNow Employee
ServiceNow Employee

Congrats on getting this far. Now for what you are trying to do in the sensor i believe you can do something like this:



//gr is the object to insert on the AP i am assuming


gr.insert();


g_disco_functions.createRelationship(g_device.getCmdbCi(), gr, "Controller for::Controlled by");




View solution in original post

27 REPLIES 27

jake_mckenna
ServiceNow Employee
ServiceNow Employee

Congrats on getting this far. Now for what you are trying to do in the sensor i believe you can do something like this:



//gr is the object to insert on the AP i am assuming


gr.insert();


g_disco_functions.createRelationship(g_device.getCmdbCi(), gr, "Controller for::Controlled by");




Thanks Jake!   That did the trick.


I would suggest making use of the other function:



g_disco_functions.createRelationshipIfNotExists(g_device.getCmdbCi(), gr, "Controller for::Controlled by");



Otherwise you could end up with dupes if your Sensor runs more than once.



There are many useful things in the DiscoveryFunctions Script Include.


Hi Johnny,



That is the function i used in the sensor for that very reason.



Thanks,
David Bernard