Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Redfish devices discovery

PavanBV
Tera Guru

Hi Team,

Has anyone successfully implemented the discovery of devices supporting the Redfish protocol?


ServiceNow support has confirmed that out-of-the-box (OOB) probes/patterns for discovering these devices are not available, and we will need a complete end-to-end customization.


If you have experience with this implementation, please let me know the steps for it


Thanks, Pavan BV

3 REPLIES 3

swapnali ombale
Kilo Sage

Hi @PavanBV 

 

Check this 

 

https://www.servicenow.com/community/itom-forum/hp-ilo-discovery/m-p/3145763

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. 

Thanks @swapnali ombale , I was able to create a custom classifier and call the Redfish API to pull the data. But i am facing issue while setting the name of the CI form the API response. If you have any leads around this, please let me know.

 

PavanBV_0-1745230342979.png


GetResponse output structure is like below
{

"Name":"ABC",

"SerialNumber":"1234",

"PowerState":"xx",

"BiosVersion":"1234v1",

}

 

 

In the 2nd Step "Set Name" i am using below code

var parsedResponse = JSON.parse("$GetResponse");

var name = parsedResponse.Name;
return name;

 

I am setting this name to the Name field on the CI that i wanted to create

PavanBV_1-1745230631185.png


Error: 

: Failed to set attribute due to the following error: JAVASCRIPT_CODE_FAILURE: org.mozilla.javascript.EvaluatorException: invalid return (ad_hoc:EvalClosure-Untitled Step-774752959; line 4)

 

 

 Hi @PavanBV 

var parsedResponse = JSON.parse($GetResponse); // Remove quotes if $GetResponse is already a string
var name = parsedResponse.Name;
return name;

 

  • If $GetResponse is a string literal already substituted (i.e., includes quotes when you inspect the actual value): Keep the quotes in JSON.parse("$GetResponse").

  • If $GetResponse is already a JavaScript object or the raw string without quotes: Remove the quotes like: JSON.parse($GetResponse).

Kindly mark my answer as helpful and accept solution if it helped you in anyway.