var result = [],
	sensors = JSON.parse(value)['val']['HostNumericSensorInfo'],
	discovery_flag = '{$VMWARE.HV.SENSOR.DISCOVERY}'.toLowerCase().trim();

if (!(discovery_flag == 'true' || discovery_flag == 'false')) {
	throw 'Incorrect value of macro "{$' + 'VMWARE.HV.SENSOR.DISCOVERY}". Can be used only "true" or "false". Actual value: ' + discovery_flag;
}

if (discovery_flag !== 'true' || typeof sensors === "undefined") {
	return JSON.stringify([]);
}

sensors.forEach(function(sensor) {
	result.push({"{#NAME}": sensor['name'], "{#TYPE}": sensor['sensorType'].toLowerCase()});
})

return JSON.stringify(result);