Testing a new Probe and parsing the results for Discovery Storage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 04:38 AM
Hi everyone, I need to discover some IBM SVC (I'm reading this doc Storage Discovery via SMI-S and CIM) and I've created some probes since the OOTB CIM probes won't work, with these parameters:
Class = Probe, ECC queue topic = sshcommand, ECC queue name = lsvdisk (an example of command I need) and allow_unsupported_shells is setted as true in probe parameters.
If I run the Test Probe I can see in the ECC queue that the response is positive, I can access the machine in question, but if I run Discover Now I get these errors:
Sensor error when processing [probe name]: No sensors defined
As I can read in this doc Create or modify a probe the post processing script can be used as
"Define an optional post-processing script that runs on the MID Server. The script accepts probe results as an input and outputs a JSON string that is sent back to the instance for a sensor to use as input. Use this type of script to accomplish tasks like parsing data."
So I don't need to create a sensor for my custom probes? How can I parse the ecc queue data into table records?
I hope my request is clear and without misunderstandings

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 12:40 PM
Without seeing the content of your ecc_queue record, it's hard to say whether your script is causing an infinite loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 02:16 PM
My discovery schedule is using a Behaviour (so custom functionality, custom port probe, custom probe)
and the payload contains
<?xml version="1.0" encoding="UTF-8"?><results probe_time="64" result_code="0"><result><output>id name UPS_serial_number WWNN status IO_group_id IO_group_name config_node UPS_unique_id hardware iscsi_name iscsi_alias panel_name enclosure_id canister_id enclosure_serial_number site_id site_name
[ all the data taken from this IP ]
(Shell is not in supported shell list)</output></result><parameters><parameter name="mid_selector_details" value="{"mode":"specific_mid"}"/><parameter name="agent" value="mid.server.xxxxx"/><parameter name="used_by_runbook" value="true"/><parameter name="glide.xmlhelper.trim.enable" value="true"/><parameter name="signature" value=""/><parameter name="source" value="10.5x.yy.zz"/><parameter name="command_to_run" value="lsnode"/><parameter name="sys_id" value="c5c22a80871ca610b794fc46cebb3556"/><parameter name="from_host" value=""/><parameter name="sys_created_on" value="2025-03-10 18:56:50"/><parameter name="sys_domain" value="global"/><parameter name="used_by_discovery" value="true"/><parameter name="state" value="ready"/><parameter name="probe_name" value="Nodi storage"/><parameter name="deviceHistoryParams" value="{"result":{"ip":"10.5x.yy.zz","active":true,"alive":true,"hostName":null,"domainName":null,"scanners":[{"result":"open","service":"ssh","protocol":"tcp","name":"SSH","port":"22","portProbe":"ssh custom storage","contents":{"banner_text":"SSH-2.0-OpenSSH_8.0","banner_bytes":".53.53.48.2d.32.2e.30.2d.4f.70.65.6e.53.53.48.5f.38.2e.30.0d.0a."},"scanners":[],"hostName":null,"domainName":null}]},"ecc_queue":"0ca2aec88750e610b5f433770cbb3578","errMsgs":[],"status":{"valid":true,"sysID":"3ef1a240871ca610b794fc46cebb3547","number":"DIS0366673","scheduleID":"151eab3b8720d294b5f433770cbb355f","jobID":"6ef12200871ca610b794fc46cebb3581","discover":"CIs","include":null,"description":"Discover Now","createdOn":"2025-03-10 18:53:23","updatedOn":"2025-03-10 18:56:10","useSnmpVersion":"all","source":"Discover_now_schedule","priority":"2","includeAlive":false,"logStateChanges":false,"scratchpad":{"behavior:cd7ca7b78720d294b5f433770cbb3568":2,"unique":"e792aec88750e610b5f433770cbb3529"}}}"/><parameter name="response_to" value="fcc2e60c8750e610b5f433770cbb3543"/><parameter name="from_sys_id" value=""/><parameter name="priority" value="2"/><parameter name="agent_correlator" value="3ef1a240871ca610b794fc46cebb3547"/><parameter name="use_snc_ssh" value="true"/><parameter name="probe" value="bd23cdf24780e694f6b9fedbd36d43e6"/><parameter name="processed" value=""/><parameter name="error_string" value=""/><parameter name="sequence" value="195816ab9b70000001"/><parameter name="port" value="22"/><parameter name="name" value="lsnode"/><parameter name="topic" value="SSHCommand"/><parameter name="allow_unsupported_shells" value="true"/><parameter name="classification_probe" value="bd23cdf24780e694f6b9fedbd36d43e6"/><parameter name="queue" value="output"/><parameter name="ecc_queue" value="c5c22a80871ca610b794fc46cebb3556"/><parameter name="credential_id" value="17cd04b087675610b5f433770cbb3528"/></parameters></results>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 09:36 AM
I can't see an issue with your script. But potentially something wrong with the regex?
Perhaps debug this by changing the script to the following
new DiscoverySensor({
process: function(result) {
var output = result.output.trim();
output = output.replace(/\(Shell is not in supported shell list\)/g, "").trim();
var rows = output.match(/\d+ [^\n]+/g);
gs.log("is Rows an array?" + Array.isArray(rows));
gs.log("Row count is " + rows.length)
},
type: "DiscoverySensor"
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 09:46 AM
I've changed the ECC queue name parameter with lsnode -nodhr -delim ,;
so I can manage the output better
this is the script now but the ecc queue keeps looping and with input and output and gr.setValue("size", values[5]);
gr.setValue("free_space", values[7]);
won't set any value, only gr.setValue("name", values[1]); is working
new DiscoverySensor({
process: function(result) {
var output = result.output.trim();
output = output.replace(/\(Shell is not in supported shell list\)/g, "").trim();
output = output.replace(/,,,[^,]+(?:,[^,]+){4},[^,]+,,,.*$/g, "").trim();
var rows = output.split("\n");
gs.log("Parsing1 " + output);
gs.log("Parsing2 " + output.length);
gs.log("Parsing3 " + rows);
gs.log("Parsing4 " + rows.length);
for (var i = 0; i < rows.length; i++) {
var row = rows[i].trim();
var values = row.split(",");
gs.log("Parsing5 " + ", Name=" + name + ", Size=" + size + ", Free=" + free);
var gr = new GlideRecord('cmdb_ci_storage_pool');
gr.initialize();
gr.setValue("name", values[1]);
gr.setValue("size", values[5]);
gr.setValue("free_space", values[7]);
gr.insert();
}
},
type: "DiscoverySensor"
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 01:31 PM
You absolutely do need to create a sensor for a probe...Post processing scripts was/is a way to easier parse the data, but ive always just created a sensor for any new probes Ive created..