('46937','21','','10617','Object storage discovery','oci.object.storage.discovery','1h','31d','365d','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction prepareCompartments(compartments, tenancy) {\r\n	if (typeof compartments === \'undefined\' || compartments === \'\') {\r\n		return [tenancy];\r\n	} else {\r\n		return compartments.split(\',\')\r\n	}\r\n}\r\n\r\nfunction OCI(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ OCI ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.hash = function (string) {\r\n		return sha256(string);\r\n	};\r\n\r\n	this.sign = function (string) {\r\n		return sign(\'sha256\', params[\'private_key\'], string);\r\n	};\r\n\r\n	this.encode = function (hash) {\r\n		const hexArr = hash.match(/.{1,2}/g);\r\n		var uInt8Array = new Uint8Array(hexArr.length);\r\n		hexArr.forEach(function (hex, idx) {\r\n			uInt8Array[idx] = parseInt(hex, 16);\r\n		});\r\n		return btoa(uInt8Array);\r\n	};\r\n\r\n	this.getDate = function () {\r\n		const weekdayShortList = [\'Sun\', \'Mon\', \'Tue\', \'Wed\', \'Thu\', \'Fri\', \'Sat\'];\r\n		const monthShortList = [\'jan\', \'feb\', \'mar\', \'apr\', \'may\', \'jun\', \'jul\', \'aug\', \'sep\', \'oct\', \'nov\', \'dec\'];\r\n		const today = new Date();\r\n		return weekdayShortList[today.getUTCDay()] + \', \' + today.getUTCDate() + \' \' + monthShortList[today.getUTCMonth()] + \' \' + today.getUTCFullYear() + \' \' + today.getUTCHours() + \':\' + today.getUTCMinutes() + \':\' + today.getUTCSeconds() + \' GMT\';\r\n	};\r\n\r\n	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {\r\n		var headers = \'(request-target) date host\';\r\n		const contentTypeHeader = \'content-type: application/json\';\r\n		const dateHeader = \'date: \' + this.getDate();\r\n		const hostHeader = \'host: \' + params[\'api_host\'];\r\n		const requestTarget = \'(request-target): \' + httpMethod + \' \' + apiPath + apiParams;\r\n		var signingString = requestTarget + \'\\n\' + dateHeader + \'\\n\' + hostHeader;\r\n		var reqHeaders = [contentTypeHeader, dateHeader];\r\n\r\n		if (httpMethod === \'post\') {\r\n			var body = JSON.stringify({\r\n				\'namespace\': namespace,\r\n				\'query\': mql\r\n			});\r\n			headers = headers + \' x-content-sha256 content-type content-length\';\r\n			const bodyHeader = \'x-content-sha256: \' + this.encode(this.hash(body));\r\n			const bodyLengthHeader = \'content-length: \' + body.length;\r\n			signingString = signingString + \'\\n\' + bodyHeader + \'\\n\' + contentTypeHeader + \'\\n\' + bodyLengthHeader;\r\n			reqHeaders.push(bodyHeader, bodyLengthHeader);\r\n		}\r\n\r\n		const signature = this.encode(this.sign(signingString));\r\n\r\n		reqHeaders.push(\'Authorization: Signature version="1",keyId="\' + params[\'tenancy_ocid\'] + \'/\' + params[\'user_ocid\'] + \'/\' + params[\'fingerprint\'] + \'",algorithm="rsa-sha256",headers="\' + headers + \'",signature="\' + signature + \'"\');\r\n		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {\r\n			this.request.addHeader(reqHeaders[header]);\r\n		}\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		if (httpMethod === \'post\') {\r\n			var apiRateLimitExceeded = false;\r\n			do {\r\n				const response = this.request.post(\'https://\' + params[\'api_host\'] + apiPath + apiParams, body);\r\n\r\n				try {\r\n					if (JSON.parse(response)[\'code\'] === \'TooManyRequests\') {\r\n\r\n						apiRateLimitExceeded = true;\r\n						Zabbix.sleep(1000);\r\n					} else {\r\n						apiRateLimitExceeded = false;\r\n					}\r\n				} catch (error) {\r\n					Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the response: \' + JSON.stringify(response));\r\n					throw \'Could not parse the response. See logs for more information.\';\r\n				}\r\n			} while (apiRateLimitExceeded);\r\n		} else {\r\n			const response = this.request.get(\'https://\' + params[\'api_host\'] + apiPath + apiParams);\r\n		}\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (httpMethod, data, keys, compartment) {\r\n		try {\r\n			data = JSON.parse(data);\r\n		} catch (error) {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n			throw \'Could not parse received JSON object. See logs for more information.\';\r\n		}\r\n\r\n		if (typeof keys == \'object\') {\r\n			var returnBuffer = [];\r\n			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {\r\n\r\n				var objectBuffer = {};\r\n				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {\r\n					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {\r\n						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];\r\n					} else {\r\n						Zabbix.log(3, this.zabbixLogPrefix + \' Received an unexpected JSON object. Could not get value for key "\' + keys[key] + \'" in JSON: \' + JSON.stringify(data[dataObj]));\r\n						throw \'Received an unexpected JSON object. See logs for more information.\';\r\n					}\r\n				}\r\n				if (typeof compartment != \'undefined\' && compartment != \'\') objectBuffer[\'compartment\'] = compartment;\r\n				returnBuffer.push(objectBuffer);\r\n			}\r\n			return returnBuffer;\r\n		}\r\n\r\n		try {\r\n			if (httpMethod === \'get\') {\r\n				return data[keys];\r\n			} else {\r\n				if (data.length === 0) {\r\n					return 0;\r\n				}\r\n				data = data[0][keys];\r\n				return data[data.length - 1][\'value\'];\r\n			}\r\n		} catch (error) {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Could not find key "\' + keys + \'" in JSON: \' + JSON.stringify(data));\r\n			throw \'Could not find required key in JSON object. See logs for more information.\';\r\n		}\r\n	};\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\nvalidateZabbixParams([\'tenancy_ocid\', \'user_ocid\', \'private_key\', \'fingerprint\', \'api_host\', \'http_status_code\'], params);\r\nvar oci = new OCI(\'Object storage\', \'Get buckets\', params);\r\nvar compartments = prepareCompartments(params[\'compartment_ocid\'], params[\'tenancy_ocid\']);\r\nconst namespace = JSON.parse(oci.executeRequest(\'get\', \'/n\', \'\'));\r\n\r\nvar buffer = [];\r\ncompartments.forEach(function (compartment) {\r\n	Array.prototype.push.apply(buffer, oci.extractData(\'get\', oci.executeRequest(\'get\', \'/n/\' + encodeURIComponent(namespace) + \'/b/\', \'?compartmentId=\' + encodeURIComponent(compartment) + \'&fields=tags\'), [\'name\', \'freeformTags\'], compartment));\r\n})\r\nreturn JSON.stringify(buffer);','','0','','','','','1',NULL,'Discover object storage.','0','7d','1','',NULL,'10s','','','','200','1','0','','','0','0','0','0','0','0','0','e1949f127af04efeb8c192f23e45b58a','0','2','0'),
('46938','21','','10617','Virtual cloud networks discovery','oci.vcn.discovery','1h','31d','365d','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction prepareCompartments(compartments, tenancy) {\r\n	if (typeof compartments === \'undefined\' || compartments === \'\') {\r\n		return [tenancy];\r\n	} else {\r\n		return compartments.split(\',\')\r\n	}\r\n}\r\n\r\nfunction OCI(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ OCI ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.hash = function (string) {\r\n		return sha256(string);\r\n	};\r\n\r\n	this.sign = function (string) {\r\n		return sign(\'sha256\', params[\'private_key\'], string);\r\n	};\r\n\r\n	this.encode = function (hash) {\r\n		const hexArr = hash.match(/.{1,2}/g);\r\n		var uInt8Array = new Uint8Array(hexArr.length);\r\n		hexArr.forEach(function (hex, idx) {\r\n			uInt8Array[idx] = parseInt(hex, 16);\r\n		});\r\n		return btoa(uInt8Array);\r\n	};\r\n\r\n	this.getDate = function () {\r\n		const weekdayShortList = [\'Sun\', \'Mon\', \'Tue\', \'Wed\', \'Thu\', \'Fri\', \'Sat\'];\r\n		const monthShortList = [\'jan\', \'feb\', \'mar\', \'apr\', \'may\', \'jun\', \'jul\', \'aug\', \'sep\', \'oct\', \'nov\', \'dec\'];\r\n		const today = new Date();\r\n		return weekdayShortList[today.getUTCDay()] + \', \' + today.getUTCDate() + \' \' + monthShortList[today.getUTCMonth()] + \' \' + today.getUTCFullYear() + \' \' + today.getUTCHours() + \':\' + today.getUTCMinutes() + \':\' + today.getUTCSeconds() + \' GMT\';\r\n	};\r\n\r\n	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {\r\n		var headers = \'(request-target) date host\';\r\n		const contentTypeHeader = \'content-type: application/json\';\r\n		const dateHeader = \'date: \' + this.getDate();\r\n		const hostHeader = \'host: \' + params[\'api_host\'];\r\n		const requestTarget = \'(request-target): \' + httpMethod + \' \' + apiPath + apiParams;\r\n		var signingString = requestTarget + \'\\n\' + dateHeader + \'\\n\' + hostHeader;\r\n		var reqHeaders = [contentTypeHeader, dateHeader];\r\n\r\n		if (httpMethod === \'post\') {\r\n			var body = JSON.stringify({\r\n				\'namespace\': namespace,\r\n				\'query\': mql\r\n			});\r\n			headers = headers + \' x-content-sha256 content-type content-length\';\r\n			const bodyHeader = \'x-content-sha256: \' + this.encode(this.hash(body));\r\n			const bodyLengthHeader = \'content-length: \' + body.length;\r\n			signingString = signingString + \'\\n\' + bodyHeader + \'\\n\' + contentTypeHeader + \'\\n\' + bodyLengthHeader;\r\n			reqHeaders.push(bodyHeader, bodyLengthHeader);\r\n		}\r\n\r\n		const signature = this.encode(this.sign(signingString));\r\n\r\n		reqHeaders.push(\'Authorization: Signature version="1",keyId="\' + params[\'tenancy_ocid\'] + \'/\' + params[\'user_ocid\'] + \'/\' + params[\'fingerprint\'] + \'",algorithm="rsa-sha256",headers="\' + headers + \'",signature="\' + signature + \'"\');\r\n		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {\r\n			this.request.addHeader(reqHeaders[header]);\r\n		}\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		if (httpMethod === \'post\') {\r\n			var apiRateLimitExceeded = false;\r\n			do {\r\n				const response = this.request.post(\'https://\' + params[\'api_host\'] + apiPath + apiParams, body);\r\n\r\n				try {\r\n					if (JSON.parse(response)[\'code\'] === \'TooManyRequests\') {\r\n\r\n						apiRateLimitExceeded = true;\r\n						Zabbix.sleep(1000);\r\n					} else {\r\n						apiRateLimitExceeded = false;\r\n					}\r\n				} catch (error) {\r\n					Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the response: \' + JSON.stringify(response));\r\n					throw \'Could not parse the response. See logs for more information.\';\r\n				}\r\n			} while (apiRateLimitExceeded);\r\n		} else {\r\n			const response = this.request.get(\'https://\' + params[\'api_host\'] + apiPath + apiParams);\r\n		}\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (httpMethod, data, keys, compartment) {\r\n		try {\r\n			data = JSON.parse(data);\r\n		} catch (error) {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n			throw \'Could not parse received JSON object. See logs for more information.\';\r\n		}\r\n\r\n		if (typeof keys == \'object\') {\r\n			var returnBuffer = [];\r\n			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {\r\n\r\n				var objectBuffer = {};\r\n				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {\r\n					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {\r\n						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];\r\n					} else {\r\n						Zabbix.log(3, this.zabbixLogPrefix + \' Received an unexpected JSON object. Could not get value for key "\' + keys[key] + \'" in JSON: \' + JSON.stringify(data[dataObj]));\r\n						throw \'Received an unexpected JSON object. See logs for more information.\';\r\n					}\r\n				}\r\n				if (typeof compartment != \'undefined\' && compartment != \'\') objectBuffer[\'compartment\'] = compartment;\r\n				returnBuffer.push(objectBuffer);\r\n			}\r\n			return returnBuffer;\r\n		}\r\n\r\n		try {\r\n			if (httpMethod === \'get\') {\r\n				return data[keys];\r\n			} else {\r\n				if (data.length === 0) {\r\n					return 0;\r\n				}\r\n				data = data[0][keys];\r\n				return data[data.length - 1][\'value\'];\r\n			}\r\n		} catch (error) {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Could not find key "\' + keys + \'" in JSON: \' + JSON.stringify(data));\r\n			throw \'Could not find required key in JSON object. See logs for more information.\';\r\n		}\r\n	};\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\nvalidateZabbixParams([\'tenancy_ocid\', \'user_ocid\', \'private_key\', \'fingerprint\', \'api_host\', \'http_status_code\'], params);\r\nvar oci = new OCI(\'VCN\', \'Get VCNs\', params);\r\nvar compartments = prepareCompartments(params[\'compartment_ocid\'], params[\'tenancy_ocid\']);\r\n\r\nvar buffer = [];\r\ncompartments.forEach(function (compartment) {\r\n	Array.prototype.push.apply(buffer, oci.extractData(\'get\', oci.executeRequest(\'get\', \'/20160918/vcns\', \'?compartmentId=\' + encodeURIComponent(compartment)), [\'id\', \'displayName\', \'lifecycleState\', \'freeformTags\'], compartment));\r\n})\r\nreturn JSON.stringify(buffer);','','0','','','','','1',NULL,'Discover virtual cloud networks (VCNs).','0','7d','1','',NULL,'10s','','','','200','1','0','','','0','0','0','0','0','0','0','378d760173924bf48fbc25c74a520a8b','0','2','0'),
('46941','21','','10618','VNIC [{#NAME}]: Get metrics','oci.compute.vnic.metrics.get[{#ID}]','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction OCI(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ OCI ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.hash = function (string) {\r\n		return sha256(string);\r\n	};\r\n\r\n	this.sign = function (string) {\r\n		return sign(\'sha256\', params[\'private_key\'], string);\r\n	};\r\n\r\n	this.encode = function (hash) {\r\n		const hexArr = hash.match(/.{1,2}/g);\r\n		var uInt8Array = new Uint8Array(hexArr.length);\r\n		hexArr.forEach(function (hex, idx) {\r\n			uInt8Array[idx] = parseInt(hex, 16);\r\n		});\r\n		return btoa(uInt8Array);\r\n	};\r\n\r\n	this.getDate = function () {\r\n		const weekdayShortList = [\'Sun\', \'Mon\', \'Tue\', \'Wed\', \'Thu\', \'Fri\', \'Sat\'];\r\n		const monthShortList = [\'jan\', \'feb\', \'mar\', \'apr\', \'may\', \'jun\', \'jul\', \'aug\', \'sep\', \'oct\', \'nov\', \'dec\'];\r\n		const today = new Date();\r\n		return weekdayShortList[today.getUTCDay()] + \', \' + today.getUTCDate() + \' \' + monthShortList[today.getUTCMonth()] + \' \' + today.getUTCFullYear() + \' \' + today.getUTCHours() + \':\' + today.getUTCMinutes() + \':\' + today.getUTCSeconds() + \' GMT\';\r\n	};\r\n\r\n	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {\r\n		var headers = \'(request-target) date host\';\r\n		const contentTypeHeader = \'content-type: application/json\';\r\n		const dateHeader = \'date: \' + this.getDate();\r\n		const hostHeader = \'host: \' + params[\'api_host\'];\r\n		const requestTarget = \'(request-target): \' + httpMethod + \' \' + apiPath + apiParams;\r\n		var signingString = requestTarget + \'\\n\' + dateHeader + \'\\n\' + hostHeader;\r\n		var reqHeaders = [contentTypeHeader, dateHeader];\r\n\r\n		if (httpMethod === \'post\') {\r\n			var body = JSON.stringify({\r\n				\'namespace\': namespace,\r\n				\'query\': mql\r\n			});\r\n			headers = headers + \' x-content-sha256 content-type content-length\';\r\n			const bodyHeader = \'x-content-sha256: \' + this.encode(this.hash(body));\r\n			const bodyLengthHeader = \'content-length: \' + body.length;\r\n			signingString = signingString + \'\\n\' + bodyHeader + \'\\n\' + contentTypeHeader + \'\\n\' + bodyLengthHeader;\r\n			reqHeaders.push(bodyHeader, bodyLengthHeader);\r\n		}\r\n\r\n		const signature = this.encode(this.sign(signingString));\r\n\r\n		reqHeaders.push(\'Authorization: Signature version="1",keyId="\' + params[\'tenancy_ocid\'] + \'/\' + params[\'user_ocid\'] + \'/\' + params[\'fingerprint\'] + \'",algorithm="rsa-sha256",headers="\' + headers + \'",signature="\' + signature + \'"\');\r\n		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {\r\n			this.request.addHeader(reqHeaders[header]);\r\n		}\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		if (httpMethod === \'post\') {\r\n			var apiRateLimitExceeded = false;\r\n			do {\r\n				const response = this.request.post(\'https://\' + params[\'api_host\'] + apiPath + apiParams, body);\r\n\r\n				try {\r\n					if (JSON.parse(response)[\'code\'] === \'TooManyRequests\') {\r\n\r\n						apiRateLimitExceeded = true;\r\n						Zabbix.sleep(1000);\r\n					} else {\r\n						apiRateLimitExceeded = false;\r\n					}\r\n				} catch (error) {\r\n					Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the response: \' + JSON.stringify(response));\r\n					throw \'Could not parse the response. See logs for more information.\';\r\n				}\r\n			} while (apiRateLimitExceeded);\r\n		} else {\r\n			const response = this.request.get(\'https://\' + params[\'api_host\'] + apiPath + apiParams);\r\n		}\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (httpMethod, data, keys, compartment) {\r\n		try {\r\n			data = JSON.parse(data);\r\n		} catch (error) {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n			throw \'Could not parse received JSON object. See logs for more information.\';\r\n		}\r\n\r\n		if (typeof keys == \'object\') {\r\n			var returnBuffer = [];\r\n			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {\r\n\r\n				var objectBuffer = {};\r\n				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {\r\n					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {\r\n						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];\r\n					} else {\r\n						Zabbix.log(3, this.zabbixLogPrefix + \' Received an unexpected JSON object. Could not get value for key "\' + keys[key] + \'" in JSON: \' + JSON.stringify(data[dataObj]));\r\n						throw \'Received an unexpected JSON object. See logs for more information.\';\r\n					}\r\n				}\r\n				if (typeof compartment != \'undefined\' && compartment != \'\') objectBuffer[\'compartment\'] = compartment;\r\n				returnBuffer.push(objectBuffer);\r\n			}\r\n			return returnBuffer;\r\n		}\r\n\r\n		try {\r\n			if (httpMethod === \'get\') {\r\n				return data[keys];\r\n			} else {\r\n				if (data.length === 0) {\r\n					return 0;\r\n				}\r\n				data = data[0][keys];\r\n				return data[data.length - 1][\'value\'];\r\n			}\r\n		} catch (error) {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Could not find key "\' + keys + \'" in JSON: \' + JSON.stringify(data));\r\n			throw \'Could not find required key in JSON object. See logs for more information.\';\r\n		}\r\n	};\r\n}\r\n\r\nfunction buildMql(id, metrics, defaultStatistic, resourceType) {\r\n	resourceType = resourceType === \'\' || resourceType === undefined ? \'resourceId\' : resourceType;\r\n	this.query = \'[\' + params[\'req_interval\'] + \'m]{\' + resourceType + \'=\' + id + \'}.\';\r\n\r\n	for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {\r\n		const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));\r\n		metrics[i] = [metric[0], this.query + metric[1]];\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\nvalidateZabbixParams([\'tenancy_ocid\', \'user_ocid\', \'private_key\', \'fingerprint\', \'api_host\', \'vnic_id\', \'http_status_code\', \'req_interval\', \'compartment_id\'], params);\r\nvar oci = new OCI(\'Compute - VNIC\', \'Get metrics\', params);\r\n\r\nconst metrics = [\r\n	\'VnicEgressDropsSecurityList\',\r\n	\'VnicIngressDropsSecurityList\',\r\n	\'VnicFromNetworkBytes\',\r\n	\'VnicFromNetworkPackets\',\r\n	\'VnicToNetworkBytes\',\r\n	\'VnicToNetworkPackets\',\r\n	\'VnicIngressDropsThrottle\',\r\n	\'VnicEgressDropsThrottle\',\r\n	\'VnicIngressDropsConntrackFull\',\r\n	\'VnicEgressDropsConntrackFull\',\r\n	\'VnicConntrackUtilPercent\',\r\n	[\'VnicConntrackIsFull\', \'last\'],\r\n	\'SmartnicBufferDropsFromNetwork\',\r\n	\'SmartnicBufferDropsFromHost\'\r\n];\r\nbuildMql(params[\'vnic_id\'], metrics, \'sum\');\r\n\r\nvar result = {};\r\nfor (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {\r\n	result[metrics[i][0]] = oci.extractData(\'post\', oci.executeRequest(\'post\', \'/20180401/metrics/actions/summarizeMetricsData\', \'?compartmentId=\' + encodeURIComponent(params[\'compartment_id\']), metrics[i][0] + metrics[i][1] + \'()\', \'oci_vcn\'), \'aggregatedDatapoints\');\r\n}\r\nreturn JSON.stringify(result);','','0','','','','','2',NULL,'Gets virtual network interface card metrics.','0','7d','0','',NULL,'30s','','','','200','1','0','','','0','0','0','0','0','0','0','eb79782153524452ba4ba8506fb207a5','0','2','0'),
('46958','11','','10317','Get database','db.odbc.get[get_database,"{$MYSQL.DSN}"]','1h','0','0','0','4','','','','',NULL,NULL,'show databases','','0','{$MYSQL.USER}','{$MYSQL.PASSWORD}','','','0',NULL,'Used for scanning databases in DBMS.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','70491bf6b6af401c9dfb10c0cbfddee1','0','2','0'),
('46959','11','','10317','Get replication','db.odbc.get[get_replication,"{$MYSQL.DSN}"]','1m','0','0','0','4','','','','',NULL,NULL,'show slave status','','0','{$MYSQL.USER}','{$MYSQL.PASSWORD}','','','0',NULL,'Gets replication status information.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','e389af9f1d134e028e3b637544c8a265','0','2','0'),
('46960','11','','10328','Get archive log','db.odbc.get[get_archivelog,,"Driver={$ORACLE.DRIVER};DBQ=//{$ORACLE.HOST}:{$ORACLE.PORT}/{$ORACLE.SERVICE};"]','1h','0','0','0','4','','','','',NULL,NULL,'SELECT d.dest_name\r\nFROM v$archive_dest d , v$database db WHERE d.status != \'INACTIVE\' AND db.log_mode = \'ARCHIVELOG\';','','0','{$ORACLE.USER}','{$ORACLE.PASSWORD}','','','0',NULL,'Gets the destinations of the log archive.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','76591a03cf684d30ae15eca8519ce1dd','0','2','0'),
('46961','11','','10328','Get ASM disk groups','db.odbc.get[get_asm,,"Driver={$ORACLE.DRIVER};DBQ=//{$ORACLE.HOST}:{$ORACLE.PORT}/{$ORACLE.SERVICE};"]','1h','0','0','0','4','','','','',NULL,NULL,'SELECT name AS dgname FROM v$asm_diskgroup;','','0','{$ORACLE.USER}','{$ORACLE.PASSWORD}','','','0',NULL,'Gets the ASM disk groups.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','10f3da9afb674ff18956aa99229de8dd','0','2','0'),
('46962','11','','10328','Get database','db.odbc.get[get_db,,"Driver={$ORACLE.DRIVER};DBQ=//{$ORACLE.HOST}:{$ORACLE.PORT}/{$ORACLE.SERVICE};"]','1h','0','0','0','4','','','','',NULL,NULL,'SELECT name as DBNAME, DECODE(CDB, \'YES\', \'CDB\', \'No-CDB\') AS TYPE  FROM V$DATABASE;','','0','{$ORACLE.USER}','{$ORACLE.PASSWORD}','','','0',NULL,'Gets the databases in the database management system (DBMS).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','7ca479f46bb2435f9f9cb62d404fa37c','0','2','0'),
('46963','11','','10328','Get PDB','db.odbc.get[get_pdb,,"Driver={$ORACLE.DRIVER};DBQ=//{$ORACLE.HOST}:{$ORACLE.PORT}/{$ORACLE.SERVICE};"]','1h','0','0','0','4','','','','',NULL,NULL,'SELECT name as DBNAME FROM V$PDBS;','','0','{$ORACLE.USER}','{$ORACLE.PASSWORD}','','','0',NULL,'Gets the pluggable database (PDB) in DBMS.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','de5aa291b7da4733ad26d517e8ff55cf','0','2','0'),
('46964','11','','10328','Get tablespace','db.odbc.get[get_tablespace,,"Driver={$ORACLE.DRIVER};DBQ=//{$ORACLE.HOST}:{$ORACLE.PORT}/{$ORACLE.SERVICE};"]','1h','0','0','0','4','','','','',NULL,NULL,'SELECT NVL(CON$NAME, \'DB\') CON_NAME,\r\nTABLESPACE_NAME TABLESPACE,\r\nCONTENTS\r\nFROM CDB_TABLESPACES;','','0','{$ORACLE.USER}','{$ORACLE.PASSWORD}','','','0',NULL,'Gets tablespaces in DBMS.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2310462a8936465c8a62d8586ab0ba65','0','2','0'),
('46965','20','1.3.6.1.4.1.12356.101.13.1.5.0','10604','HA config sync','ha.auto.sync[fgHaAutoSync.0]','1h','31d','365d','0','3','','','','',NULL,'1206','','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nConfiguration of an automatic configuration synchronization (enabled or disabled).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ea59bff13fd44c37aa5bd711146fe3d9','0','2','0'),
('46966','20','1.3.6.1.4.1.12356.101.13.1.2.0','10604','HA cluster group ID','ha.cluster.group_id[fgHaGroupId.0]','1h','31d','0','0','3','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nHA cluster group ID device is configured for.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','dbc47cff3e60401d9a52f590e1ed6281','0','2','0'),
('46967','20','1.3.6.1.4.1.12356.101.13.1.7.0','10604','HA cluster group name','ha.cluster.group_name[fgHaGroupName.0]','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nHA cluster group name.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','4e2b57a68243445e87ca0e23277bafd6','0','2','0'),
('46968','20','1.3.6.1.4.1.12356.101.13.1.4.0','10604','HA cluster primary override','ha.cluster.override[fgHaOverride.0]','1h','31d','365d','0','3','','','','',NULL,'1206','','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nStatus of the primary override flag.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b6bdf8c8d09140ffa4087d0204a0711d','0','2','0'),
('46969','20','1.3.6.1.4.1.12356.101.13.1.3.0','10604','HA cluster priority','ha.cluster.priority[fgHaPriority.0]','1h','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nHA clustering priority of the device (default = 128).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3f1d2dfb8fd74e80aedb6fa0b7ff7215','0','2','0'),
('46970','20','walk[1.3.6.1.4.1.12356.101.13.2.1.1]','10604','SNMP walk HA members','ha.members.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Used for discovering HA members from FORTINET-FORTIGATE-MIB.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ff27aa75a1d84aa5a472fbf114f8dec0','0','2','0'),
('46971','20','1.3.6.1.4.1.12356.101.13.1.1.0','10604','HA mode','ha.mode[fgHaSystemMode.0]','1h','31d','0','0','3','','','','',NULL,'1208','','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nHigh-availability mode (Standalone, A-A or A-P).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3d9bb1ddb4924d5ba4dc75fb4103cc10','0','2','0'),
('46972','20','1.3.6.1.4.1.12356.101.13.1.6.0','10604','HA load-balancing schedule','ha.schedule[fgHaSchedule.0]','1h','31d','365d','0','3','','','','',NULL,'1205','','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nLoad-balancing schedule of cluster (in A-A mode).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','bd3dc8fdcb8e41569f1f81b2624e1462','0','2','0'),
('46973','20','walk[1.3.6.1.4.1.12356.101.4.3.2.1]','10604','SNMP walk hardware sensors','hw.sensor.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Used for discovering hardware sensors from FORTINET-FORTIGATE-MIB.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','bb422f92e3ad4eafb9f43f0167a250ee','0','2','0'),
('46974','20','1.3.6.1.4.1.12356.101.9.2.1.1.2.1','10604','Blocked intrusions','ips.blocked[fgIpsIntrusionsBlocked.0]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nNumber of intrusions blocked per second.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','04f58b6b63b945a08a27799bee741702','0','2','0'),
('46975','20','1.3.6.1.4.1.12356.101.4.2.2.0','10604','IPS database version','ips.database.version[fgSysVersionIps.0]','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nIPS signature database version installed on the device.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','9a42006208224b94a64ecc13437516b6','0','2','0'),
('46976','20','1.3.6.1.4.1.12356.101.9.2.1.1.9.1','10604','Detected anomaly based intrusions','ips.detected.anomaly[fgIpsAnomalyDetections.0]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nNumber of intrusions detected as anomalies per second.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','afa9709de4c34d0c82aaf87c5b4f4572','0','2','0'),
('46977','20','1.3.6.1.4.1.12356.101.9.2.1.1.3.1','10604','Detected critical intrusions','ips.detected.crit[fgIpsCritSevDetections.0]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nNumber of critical severity intrusions detected per second.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','20ceeb0c520d454bba3d032d10a5db11','0','2','0'),
('46978','20','1.3.6.1.4.1.12356.101.9.2.1.1.4.1','10604','Detected high intrusions','ips.detected.high[fgIpsHighSevDetections.0]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nNumber of high severity intrusions detected per second.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','badcc4a4fe3d4b219a2c67cda182ff4c','0','2','0'),
('46979','20','1.3.6.1.4.1.12356.101.9.2.1.1.7.1','10604','Detected info intrusions','ips.detected.info[fgIpsInfoSevDetections.0]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nNumber of info severity intrusions detected per second.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f570cf723b904be593a99a8338e577de','0','2','0'),
('46980','20','1.3.6.1.4.1.12356.101.9.2.1.1.6.1','10604','Detected low intrusions','ips.detected.low[fgIpsLowSevDetections.0]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nNumber of low severity intrusions detected per second.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5edd46eba610442888acf0c8bdcde2c1','0','2','0'),
('46981','20','1.3.6.1.4.1.12356.101.9.2.1.1.5.1','10604','Detected medium intrusions','ips.detected.med[fgIpsMedSevDetections.0]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nNumber of medium severity intrusions detected per second.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','0e4f211aa2b6492fa461e2bc5af1723f','0','2','0'),
('46982','20','1.3.6.1.4.1.12356.101.9.2.1.1.8.1','10604','Detected signature based intrusions','ips.detected.sign[fgIpsSignatureDetections.0]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nNumber of intrusions detected by signature per second.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','bf7ab7c7fdfd42a28e15545904baa6dc','0','2','0'),
('46983','20','1.3.6.1.4.1.12356.101.9.2.1.1.1.1','10604','Total detected intrusions','ips.detected.total[fgIpsIntrusionsDetected.0]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nTotal number of intrusions detected per second.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f35dea442cbe4578a221571b2dbd676f','0','2','0'),
('46984','20','1.3.6.1.4.1.12356.101.4.1.8.0','10604','IPv4 Active sessions','net.ipv4.sessions[fgSysSesCount.0]','5m','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nNumber of active sessions on the device.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ba89be1a4a01484f955fc6d740d1c736','0','2','0'),
('46985','20','walk[1.3.6.1.4.1.12356.101.4.9.2.1]','10604','SNMP walk SD-WAN health-checks','sdwan_health.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Used for discovering SD-WAN health-checks from FORTINET-FORTIGATE-MIB.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','de401c1befce453bb9de93cb154026d4','0','2','0'),
('46986','20','walk[1.3.6.1.4.1.12356.101.4.4.2.1]','10604','SNMP walk CPU','system.cpu.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Used for discovering CPU from FORTINET-FORTIGATE-MIB.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','47d06309bad546b0b303c0c602c76415','0','2','0'),
('46987','20','walk[1.3.6.1.4.1.12356.101.3.2.1.1]','10604','SNMP walk virtual domain','vdom.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Used for discovering virtual domains from FORTINET-FORTIGATE-MIB.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','14d4584977a74e0791bf063652bf4c39','0','2','0'),
('46988','20','1.3.6.1.4.1.12356.101.12.2.3.1.1.1','10604','SSL VPN state','vpn.ssl.state[fgVpnSslState.0]','1m','31d','365d','0','3','','','','',NULL,'1211','','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nUsed to determine whether SSL-VPN is enabled on this virtual domain.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','08bf282b9b3c4e78b139f3f6fe3bcd97','0','2','0'),
('46989','20','1.3.6.1.4.1.12356.101.12.1.1.0','10604','Active IPsec VPN tunnels','vpn.tunnel.active[fgVpnTunnelUpCount.0]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nNumber of IPsec VPN tunnels with at least one SA.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','1699dd171a1f41d5896ac766477033ca','0','2','0'),
('46990','20','walk[1.3.6.1.4.1.12356.101.12.2.2.1.3,1.3.6.1.4.1.12356.101.12.2.2.1.20]','10604','SNMP walk VPN tunnels','vpn.tunnel.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Used for discovering VPN tunnels from FORTINET-FORTIGATE-MIB.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','349a383498cd42729940d1b9e5176e3e','0','2','0'),
('46991','20','1.3.6.1.4.1.12356.101.12.2.3.1.2.1','10604','Active SSL VPN users','vpn.users.count[fgVpnSslStatsLoginUsers.0]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: FORTINET-FORTIGATE-MIB\r\nCurrent number of users logged in through SSL-VPN tunnels in the virtual domain.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','c9a78b70b0f54fdc92d5efbfd38a32c5','0','2','0'),
('46992','20','walk[1.3.6.1.4.1.12356.101.14.4.3.1]','10604','SNMP walk wireless AP','wireless.ap.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Used for discovering wireless access points from FORTINET-FORTIGATE-MIB.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5135b14791f844e4b1e1cdef4817a5d2','0','2','0'),
('47069','21','','10627','Get ELB NLB alarms data','aws.elb.nlb.get_alarms','0s;m/1','0','0','0','4','','','','',NULL,NULL,'var AWS = {\r\n	params: {},\r\n	metadata: \'http://169.254.169.254/latest/\',\r\n\r\n	getField: function (data, path) {\r\n		var steps = path.split(\'.\');\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n\r\n			data = data[step];\r\n		}\r\n\r\n		return data;\r\n	},\r\n\r\n	setParams: function (params) {\r\n		AWS.params[\'proxy\'] = params.proxy;\r\n		switch (AWS.getField(params, \'auth_type\')) {\r\n			case \'role_base\':\r\n				AWS.params[\'auth_type\'] = \'role_base\';\r\n				var request = new HttpRequest();\r\n				if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n					request.setProxy(AWS.params.proxy);\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token-ttl-seconds: 21600\');\r\n				var token = request.put(AWS.metadata + \'api/token\');\r\n\r\n				if (request.getStatus() !== 200 || token === null || token === \'\') {\r\n					throw \'Error getting IMDSv2 session token.\';\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token: \' + token);\r\n				var IamRoleName = request.get(AWS.metadata + \'meta-data/iam/security-credentials\');\r\n\r\n				if (request.getStatus() !== 200 || IamRoleName === null || IamRoleName === \'\') {\r\n					throw \'Error getting security credentials from instance metadata. Role not found.\';\r\n				}\r\n\r\n				credentials = request.get(AWS.metadata + \'meta-data/iam/security-credentials/\' + encodeURI(IamRoleName));\r\n\r\n				if (request.getStatus() !== 200 || credentials === null || credentials === \'\') {\r\n					throw \'Error getting security credentials from instance metadata.\';\r\n				}\r\n\r\n				try {\r\n					credentials = JSON.parse(credentials);\r\n				}\r\n				catch (error) {\r\n					throw \'Failed to parse response received from instance metadata. Check debug log for more information.\';\r\n				}\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'Token\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			case \'assume_role\':\r\n				AWS.params[\'auth_type\'] = \'assume_role\';\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'sts_region\', \'role_arn\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n\r\n				role_arn_regex = /role\\/(.+)$/;\r\n\r\n				var payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': AWS.params.role_arn.match(role_arn_regex)[1] + \'Session\',\r\n				};\r\n\r\n				credentials = AWS.getField(AWS.request(\'GET\', AWS.params.sts_region, \'sts\', AWS.prepareParams(payload), \'\'), \'AssumeRoleResponse.AssumeRoleResult.Credentials\');\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'SessionToken\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			default:\r\n				AWS.params[\'auth_type\'] = \'access_key\';\r\n				[\'AccessKeyId\', \'SecretAccessKey\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n		}\r\n		[\'region\', \'arn\', \'loadbalancer_name\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: "\' + field + \'".\';\r\n			}\r\n			AWS.params[field] = params[field];\r\n		});\r\n	},\r\n\r\n	sign: function (key, message) {\r\n		var hex = hmac(\'sha256\', key, message);\r\n\r\n		if ((hex.length % 2) === 1) {\r\n			throw \'Invalid length of a hex string!\';\r\n		}\r\n\r\n		var result = new Int8Array(hex.length / 2);\r\n		for (var i = 0, b = 0; i < hex.length; i += 2, b++) {\r\n			result[b] = parseInt(hex.substring(i, i + 2), 16);\r\n		}\r\n\r\n		return result;\r\n	},\r\n\r\n	prepareParams: function (params) {\r\n		var result = [];\r\n\r\n		Object.keys(params).sort().forEach(function (key) {\r\n			if (typeof params[key] !== \'object\') {\r\n				result.push(key + \'=\' + encodeURIComponent(params[key]));\r\n			}\r\n			else {\r\n				result.push(prepareObject(key, params[key]));\r\n			}\r\n		});\r\n\r\n		return result.join(\'&\');\r\n	},\r\n\r\n	request: function (method, region, service, params, data) {\r\n		if (typeof data === \'undefined\' || data === null) {\r\n			data = \'\';\r\n		}\r\n\r\n		var amzdate = (new Date()).toISOString().replace(/\\.\\d+Z/, \'Z\').replace(/[-:]/g, \'\'),\r\n			date = amzdate.replace(/T\\d+Z/, \'\'),\r\n			host = service + \'.\' + region + \'.amazonaws.com\',\r\n			canonical_uri = \'/\',\r\n			canonical_headers = \'content-encoding:amz-1.0\\n\' + \'host:\' + host + \'\\n\' + \'x-amz-date:\' + amzdate + \'\\n\',\r\n			signed_headers = \'content-encoding;host;x-amz-date\',\r\n			canonical_request = method + \'\\n\' + canonical_uri + \'\\n\' + params + \'\\n\' + canonical_headers + \'\\n\' + signed_headers + \'\\n\' + sha256(data),\r\n			credential_scope = date + \'/\' + region + \'/\' + service + \'/\' + \'aws4_request\',\r\n			request_string = \'AWS4-HMAC-SHA256\' + \'\\n\' + amzdate + \'\\n\' + credential_scope + \'\\n\' + sha256(canonical_request),\r\n			key = AWS.sign(\'AWS4\' + AWS.params.SecretAccessKey, date),\r\n			key = AWS.sign(key, region),\r\n			key = AWS.sign(key, service),\r\n			key = AWS.sign(key, \'aws4_request\'),\r\n			request = new HttpRequest(),\r\n			url = \'https://\' + host + canonical_uri + \'?\' + params;\r\n\r\n		if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n			request.setProxy(AWS.params.proxy);\r\n		}\r\n		request.addHeader(\'x-amz-date: \' + amzdate);\r\n		request.addHeader(\'Accept: application/json\');\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Content-Encoding: amz-1.0\');\r\n		request.addHeader(\'Authorization: \' + \'AWS4-HMAC-SHA256 Credential=\' + AWS.params.AccessKeyId + \'/\' + credential_scope + \', \' + \'SignedHeaders=\' + signed_headers + \', \' + \'Signature=\' + hmac(\'sha256\', key, request_string));\r\n		if (AWS.params.auth_type === \'role_base\' || (AWS.params.auth_type === \'assume_role\' & !params.includes(\'AssumeRole\'))) {\r\n			request.addHeader(\'X-Amz-Security-Token: \' + (AWS.params.auth_type === \'role_base\' ? AWS.params.Token : AWS.params.SessionToken));\r\n		}\r\n\r\n		Zabbix.log(4, \'[ AWS ELB ] Sending request: \' + url);\r\n		response = request.get(url);\r\n		Zabbix.log(4, \'[ AWS ELB ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() !== 200) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			try {\r\n				response = JSON.parse(XML.toJson(response));\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from AWS CloudWatch API. Check debug log for more information.\';\r\n			}\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	getAlarms: function () {\r\n		var payload = {\r\n			\'Action\': \'DescribeAlarms\',\r\n			\'Version\': \'2010-08-01\',\r\n			\'MaxRecords\': 100\r\n		},\r\n			result = [];\r\n\r\n		while (payload.NextToken !== \'\') {\r\n			var alarms = AWS.getField(AWS.request(\'GET\', AWS.params.region, \'monitoring\', AWS.prepareParams(payload)), \'DescribeAlarmsResponse.DescribeAlarmsResult\');\r\n			payload.NextToken = alarms.NextToken || \'\';\r\n			alarms_list = AWS.getField(alarms, \'MetricAlarms\');\r\n			regex = /loadbalancer\\/(.+)$/;\r\n\r\n			if (!Array.isArray(alarms_list))\r\n				alarms_list = [alarms_list];\r\n			alarms_list.forEach(function (alarm) {\r\n				var dimensions = alarm.Dimensions;\r\n\r\n				if (Array.isArray(alarm.Metrics)) {\r\n					alarm.Metrics.forEach(function (metric) {\r\n						if (typeof metric.MetricStat === \'object\' && metric.MetricStat !== null\r\n							&& typeof metric.MetricStat.Metric === \'object\' && metric.MetricStat.Metric !== null\r\n							&& Array.isArray(metric.MetricStat.Metric.Dimensions)) {\r\n							dimensions = dimensions.concat(metric.MetricStat.Metric.Dimensions);\r\n						}\r\n					});\r\n				}\r\n				for (var i in dimensions) {\r\n					if ((dimensions[i].Name === \'LoadBalancer\' && dimensions[i].Value === AWS.params.arn.match(regex)[1])\r\n						|| (dimensions[i].Name === \'LoadBalancerName\' && dimensions[i].Value === AWS.params.loadbalancer_name)) {\r\n						result.push(alarm);\r\n						break;\r\n					}\r\n				}\r\n			});\r\n		}\r\n\r\n		return result;\r\n	}\r\n};\r\n\r\ntry {\r\n	AWS.setParams(JSON.parse(value));\r\n\r\n	return JSON.stringify(AWS.getAlarms());\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ AWS ELB Alarms ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'`DescribeAlarms` API method: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html','0','7d','0','',NULL,'{$AWS.DATA.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','6d74c1a68ea9476dadc39b785f333d5d','0','2','0'),
('47070','21','','10627','Get metrics data','aws.elb.nlb.get_metrics','0s;m/1','0','0','0','4','','','','',NULL,NULL,'var AWS = {\r\n	params: {},\r\n	metadata: \'http://169.254.169.254/latest/\',\r\n	request_period: 60,\r\n\r\n	getField: function (data, path) {\r\n		var steps = path.split(\'.\');\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n\r\n			data = data[step];\r\n		}\r\n\r\n		return data;\r\n	},\r\n\r\n	setParams: function (params) {\r\n		AWS.params[\'proxy\'] = params.proxy;\r\n		switch (AWS.getField(params, \'auth_type\')) {\r\n			case \'role_base\':\r\n				AWS.params[\'auth_type\'] = \'role_base\';\r\n				var request = new HttpRequest();\r\n				if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n					request.setProxy(AWS.params.proxy);\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token-ttl-seconds: 21600\');\r\n				var token = request.put(AWS.metadata + \'api/token\');\r\n\r\n				if (request.getStatus() !== 200 || token === null || token === \'\') {\r\n					throw \'Error getting IMDSv2 session token.\';\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token: \' + token);\r\n				var IamRoleName = request.get(AWS.metadata + \'meta-data/iam/security-credentials\');\r\n\r\n				if (request.getStatus() !== 200 || IamRoleName === null || IamRoleName === \'\') {\r\n					throw \'Error getting security credentials from instance metadata. Role not found.\';\r\n				}\r\n\r\n				credentials = request.get(AWS.metadata + \'meta-data/iam/security-credentials/\' + encodeURI(IamRoleName));\r\n\r\n				if (request.getStatus() !== 200 || credentials === null || credentials === \'\') {\r\n					throw \'Error getting security credentials from instance metadata.\';\r\n				}\r\n\r\n				try {\r\n					credentials = JSON.parse(credentials);\r\n				}\r\n				catch (error) {\r\n					throw \'Failed to parse response received from instance metadata. Check debug log for more information.\';\r\n				}\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'Token\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			case \'assume_role\':\r\n				AWS.params[\'auth_type\'] = \'assume_role\';\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'sts_region\', \'role_arn\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n\r\n				role_arn_regex = /role\\/(.+)$/;\r\n\r\n				var payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': AWS.params.role_arn.match(role_arn_regex)[1] + \'Session\',\r\n				};\r\n\r\n				credentials = AWS.getField(AWS.request(\'POST\', AWS.params.sts_region, \'sts\', AWS.prepareParams(payload), \'\'), \'AssumeRoleResponse.AssumeRoleResult.Credentials\');\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'SessionToken\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			default:\r\n				AWS.params[\'auth_type\'] = \'access_key\';\r\n				[\'AccessKeyId\', \'SecretAccessKey\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n		}\r\n		[\'region\', \'arn\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: "\' + field + \'".\';\r\n			}\r\n			AWS.params[field] = params[field];\r\n		});\r\n	},\r\n\r\n	sign: function (key, message) {\r\n		var hex = hmac(\'sha256\', key, message);\r\n\r\n		if ((hex.length % 2) === 1) {\r\n			throw \'Invalid length of a hex string!\';\r\n		}\r\n\r\n		var result = new Int8Array(hex.length / 2);\r\n		for (var i = 0, b = 0; i < hex.length; i += 2, b++) {\r\n			result[b] = parseInt(hex.substring(i, i + 2), 16);\r\n		}\r\n\r\n		return result;\r\n	},\r\n\r\n	prepareParams: function (params) {\r\n		var result = [];\r\n\r\n		Object.keys(params).sort().forEach(function (key) {\r\n			if (typeof params[key] !== \'object\') {\r\n				result.push(key + \'=\' + encodeURIComponent(params[key]));\r\n			}\r\n			else {\r\n				result.push(prepareObject(key, params[key]));\r\n			}\r\n		});\r\n\r\n		return result.join(\'&\');\r\n	},\r\n\r\n	renderMetricQuery: function (period, arn) {\r\n		var metrics_list = [\r\n			\'ActiveFlowCount:Average\',\r\n			\'ActiveFlowCount_TCP:Average\',\r\n			\'ActiveFlowCount_TLS:Average\',\r\n			\'ActiveFlowCount_UDP:Average\',\r\n			\'ClientTLSNegotiationErrorCount:Sum\',\r\n			\'ConsumedLCUs:Sum\',\r\n			\'ConsumedLCUs_TCP:Sum\',\r\n			\'ConsumedLCUs_TLS:Sum\',\r\n			\'ConsumedLCUs_UDP:Sum\',\r\n			\'NewFlowCount:Sum\',\r\n			\'NewFlowCount_TCP:Sum\',\r\n			\'NewFlowCount_TLS:Sum\',\r\n			\'NewFlowCount_UDP:Sum\',\r\n			\'PeakPacketsPerSecond:Maximum\',\r\n			\'PortAllocationErrorCount:Sum\',\r\n			\'SecurityGroupBlockedFlowCount_Inbound_ICMP:Sum\',\r\n			\'SecurityGroupBlockedFlowCount_Inbound_TCP:Sum\',\r\n			\'SecurityGroupBlockedFlowCount_Inbound_UDP:Sum\',\r\n			\'SecurityGroupBlockedFlowCount_Outbound_ICMP:Sum\',\r\n			\'SecurityGroupBlockedFlowCount_Outbound_TCP:Sum\',\r\n			\'SecurityGroupBlockedFlowCount_Outbound_UDP:Sum\',\r\n			\'ProcessedBytes:Sum\',\r\n			\'ProcessedBytes_TCP:Sum\',\r\n			\'ProcessedBytes_TLS:Sum\',\r\n			\'ProcessedBytes_UDP:Sum\',\r\n			\'ProcessedPackets:Sum\',\r\n			\'TargetTLSNegotiationErrorCount:Sum\',\r\n			\'TCP_Client_Reset_Count:Sum\',\r\n			\'TCP_ELB_Reset_Count:Sum\',\r\n			\'TCP_Target_Reset_Count:Sum\',\r\n			\'UnhealthyRoutingFlowCount:Sum\'\r\n		],\r\n			regex = /loadbalancer\\/(.+)$/;\r\n\r\n		var metric_payload = [];\r\n		metrics_list.forEach(function (metric, index) {\r\n			var parts = metric.split(\':\', 2);\r\n			metric_payload.push({\r\n				\'Id\': \'m\' + index,\r\n				\'MetricStat\': {\r\n					\'Metric\': {\r\n						\'MetricName\': parts[0],\r\n						\'Namespace\': \'AWS/NetworkELB\',\r\n						\'Dimensions\': [\r\n							{\r\n								\'Name\': \'LoadBalancer\',\r\n								\'Value\': arn.match(regex)[1],\r\n							}\r\n						]\r\n					},\r\n					\'Period\': period,\r\n					\'Stat\': parts[1],\r\n				}\r\n			});\r\n		});\r\n\r\n		return metric_payload;\r\n	},\r\n\r\n	request: function (method, region, service, params, data) {\r\n		if (typeof data === \'undefined\' || data === null) {\r\n			data = JSON.stringify([]);\r\n		}\r\n		else {\r\n			data = JSON.stringify(data)\r\n		}\r\n		var amzdate = (new Date()).toISOString().replace(/\\.\\d+Z/, \'Z\').replace(/[-:]/g, \'\'),\r\n			date = amzdate.replace(/T\\d+Z/, \'\'),\r\n			canonical_uri = \'/\',\r\n			host = service + \'.\' + region + \'.amazonaws.com\',\r\n			canonical_headers = \'content-encoding:amz-1.0\\n\' + \'host:\' + host + \'\\n\' + \'x-amz-date:\' + amzdate + \'\\n\',\r\n			signed_headers = \'content-encoding;host;x-amz-date\',\r\n			canonical_request = method + \'\\n\' + canonical_uri + \'\\n\' + params + \'\\n\' + canonical_headers + \'\\n\' + signed_headers + \'\\n\' + sha256(data),\r\n			credential_scope = date + \'/\' + region + \'/\' + service + \'/\' + \'aws4_request\',\r\n			request_string = \'AWS4-HMAC-SHA256\' + \'\\n\' + amzdate + \'\\n\' + credential_scope + \'\\n\' + sha256(canonical_request),\r\n			key = AWS.sign(\'AWS4\' + AWS.params.SecretAccessKey, date),\r\n			key = AWS.sign(key, region),\r\n			key = AWS.sign(key, service),\r\n			key = AWS.sign(key, \'aws4_request\'),\r\n			request = new HttpRequest(),\r\n			url = \'https://\' + host + canonical_uri + \'?\' + params;\r\n\r\n		if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n			request.setProxy(AWS.params.proxy);\r\n		}\r\n		request.addHeader(\'x-amz-date: \' + amzdate);\r\n		request.addHeader(\'x-amz-content-sha256:\' + sha256(data));\r\n		request.addHeader(\'X-Amz-Target: GraniteServiceVersion20100801.GetMetricData\')\r\n		request.addHeader(\'Accept: application/json\');\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Content-Encoding: amz-1.0\');\r\n		request.addHeader(\'Authorization: \' + \'AWS4-HMAC-SHA256 Credential=\' + AWS.params.AccessKeyId + \'/\' + credential_scope + \', \' + \'SignedHeaders=\' + signed_headers + \', \' + \'Signature=\' + hmac(\'sha256\', key, request_string));\r\n		if (AWS.params.auth_type === \'role_base\' || (AWS.params.auth_type === \'assume_role\' & !params.includes(\'AssumeRole\'))) {\r\n			request.addHeader(\'X-Amz-Security-Token: \' + (AWS.params.auth_type === \'role_base\' ? AWS.params.Token : AWS.params.SessionToken));\r\n		}\r\n\r\n		Zabbix.log(4, \'[ AWS ELB ] Sending request: \' + url);\r\n		response = request.post(url, data);\r\n		Zabbix.log(4, \'[ AWS ELB ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n		if (request.getStatus() !== 200) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		return JSON.parse(response);\r\n	},\r\n\r\n	getMetricsData: function () {\r\n		var end_time = Math.floor((new Date().getTime()) / 1000),\r\n			start_time = end_time - AWS.request_period * 60;\r\n		payload = {\r\n			\'StartTime\': start_time,\r\n			\'EndTime\': end_time,\r\n			\'ScanBy\': \'TimestampDescending\',\r\n			\'MetricDataQueries\': AWS.renderMetricQuery(AWS.request_period, AWS.params.arn)\r\n		};\r\n\r\n		return AWS.getField(AWS.request(\'POST\', AWS.params.region, \'monitoring\', \'\', payload), \'MetricDataResults\');\r\n	}\r\n};\r\n\r\ntry {\r\n	AWS.setParams(JSON.parse(value));\r\n	return JSON.stringify(AWS.getMetricsData());\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ AWS ELB Get metrics] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get ELB Network Load Balancer metrics.\r\nFull metrics list related to Network Load Balancer: https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-cloudwatch-metrics.html','0','7d','0','',NULL,'{$AWS.DATA.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','76d374302b29430c8fe5813656ffd928','0','2','0'),
('47071','21','','10627','Get target groups','aws.elb.nlb.get_target_groups','0s;m/30','0','0','0','4','','','','',NULL,NULL,'var AWS = {\r\n	params: {},\r\n	metadata: \'http://169.254.169.254/latest/\',\r\n\r\n	getField: function (data, path) {\r\n		var steps = path.split(\'.\');\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n\r\n			data = data[step];\r\n		}\r\n\r\n		return data;\r\n	},\r\n\r\n	setParams: function (params) {\r\n		AWS.params[\'proxy\'] = params.proxy;\r\n		switch (AWS.getField(params, \'auth_type\')) {\r\n			case \'role_base\':\r\n				AWS.params[\'auth_type\'] = \'role_base\';\r\n				var request = new HttpRequest();\r\n				if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n					request.setProxy(AWS.params.proxy);\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token-ttl-seconds: 21600\');\r\n				var token = request.put(AWS.metadata + \'api/token\');\r\n\r\n				if (request.getStatus() !== 200 || token === null || token === \'\') {\r\n					throw \'Error getting IMDSv2 session token.\';\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token: \' + token);\r\n				var IamRoleName = request.get(AWS.metadata + \'meta-data/iam/security-credentials\');\r\n\r\n				if (request.getStatus() !== 200 || IamRoleName === null || IamRoleName === \'\') {\r\n					throw \'Error getting security credentials from instance metadata. Role not found.\';\r\n				}\r\n\r\n				credentials = request.get(AWS.metadata + \'meta-data/iam/security-credentials/\' + encodeURI(IamRoleName));\r\n\r\n				if (request.getStatus() !== 200 || credentials === null || credentials === \'\') {\r\n					throw \'Error getting security credentials from instance metadata.\';\r\n				}\r\n\r\n				try {\r\n					credentials = JSON.parse(credentials);\r\n				}\r\n				catch (error) {\r\n					throw \'Failed to parse response received from instance metadata. Check debug log for more information.\';\r\n				}\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'Token\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			case \'assume_role\':\r\n				AWS.params[\'auth_type\'] = \'assume_role\';\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'sts_region\', \'role_arn\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n\r\n				role_arn_regex = /role\\/(.+)$/;\r\n\r\n				var payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': AWS.params.role_arn.match(role_arn_regex)[1] + \'Session\',\r\n				};\r\n\r\n				credentials = AWS.getField(AWS.request(\'GET\', AWS.params.sts_region, \'sts\', AWS.prepareParams(payload), \'\'), \'AssumeRoleResponse.AssumeRoleResult.Credentials\');\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'SessionToken\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			default:\r\n				AWS.params[\'auth_type\'] = \'access_key\';\r\n				[\'AccessKeyId\', \'SecretAccessKey\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n		}\r\n		[\'region\', \'arn\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: "\' + field + \'".\';\r\n			}\r\n			AWS.params[field] = params[field];\r\n		});\r\n	},\r\n\r\n	sign: function (key, message) {\r\n		var hex = hmac(\'sha256\', key, message);\r\n\r\n		if ((hex.length % 2) === 1) {\r\n			throw \'Invalid length of a hex string!\';\r\n		}\r\n\r\n		var result = new Int8Array(hex.length / 2);\r\n		for (var i = 0, b = 0; i < hex.length; i += 2, b++) {\r\n			result[b] = parseInt(hex.substring(i, i + 2), 16);\r\n		}\r\n\r\n		return result;\r\n	},\r\n\r\n	prepareParams: function (params) {\r\n		var result = [];\r\n\r\n		Object.keys(params).sort().forEach(function (key) {\r\n			if (typeof params[key] !== \'object\') {\r\n				result.push(key + \'=\' + encodeURIComponent(params[key]));\r\n			}\r\n			else {\r\n				result.push(prepareObject(key, params[key]));\r\n			}\r\n		});\r\n\r\n		return result.join(\'&\');\r\n	},\r\n\r\n	request: function (method, region, service, params, data) {\r\n		if (typeof data === \'undefined\' || data === null) {\r\n			data = JSON.stringify([]);\r\n		}\r\n		var amzdate = (new Date()).toISOString().replace(/\\.\\d+Z/, \'Z\').replace(/[-:]/g, \'\'),\r\n			date = amzdate.replace(/T\\d+Z/, \'\'),\r\n			canonical_uri = \'/\',\r\n			host = service + \'.\' + region + \'.amazonaws.com\',\r\n			canonical_headers = \'content-encoding:amz-1.0\\n\' + \'host:\' + host + \'\\n\' + \'x-amz-date:\' + amzdate + \'\\n\',\r\n			signed_headers = \'content-encoding;host;x-amz-date\',\r\n			canonical_request = method + \'\\n\' + canonical_uri + \'\\n\' + params + \'\\n\' + canonical_headers + \'\\n\' + signed_headers + \'\\n\' + sha256(data),\r\n			credential_scope = date + \'/\' + region + \'/\' + service + \'/\' + \'aws4_request\',\r\n			request_string = \'AWS4-HMAC-SHA256\' + \'\\n\' + amzdate + \'\\n\' + credential_scope + \'\\n\' + sha256(canonical_request),\r\n			key = AWS.sign(\'AWS4\' + AWS.params.SecretAccessKey, date),\r\n			key = AWS.sign(key, region),\r\n			key = AWS.sign(key, service),\r\n			key = AWS.sign(key, \'aws4_request\'),\r\n			request = new HttpRequest(),\r\n			url = \'https://\' + host + canonical_uri + \'?\' + params;\r\n\r\n		if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n			request.setProxy(AWS.params.proxy);\r\n		}\r\n		request.addHeader(\'x-amz-date: \' + amzdate);\r\n		request.addHeader(\'x-amz-content-sha256:\' + sha256(data));\r\n		request.addHeader(\'Accept: application/json\');\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Content-Encoding: amz-1.0\');\r\n		request.addHeader(\'Authorization: \' + \'AWS4-HMAC-SHA256 Credential=\' + AWS.params.AccessKeyId + \'/\' + credential_scope + \', \' + \'SignedHeaders=\' + signed_headers + \', \' + \'Signature=\' + hmac(\'sha256\', key, request_string));\r\n		if (AWS.params.auth_type === \'role_base\' || (AWS.params.auth_type === \'assume_role\' & !params.includes(\'AssumeRole\'))) {\r\n			request.addHeader(\'X-Amz-Security-Token: \' + (AWS.params.auth_type === \'role_base\' ? AWS.params.Token : AWS.params.SessionToken));\r\n		}\r\n\r\n		Zabbix.log(4, \'[ AWS ELB ] Sending request: \' + url);\r\n		response = request.get(url);\r\n		Zabbix.log(4, \'[ AWS ELB ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n		if (request.getStatus() !== 200) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		return JSON.parse(response);\r\n	},\r\n\r\n	listTargetGroups: function () {\r\n		var lld_array = [],\r\n			regex = /targetgroup\\/(.+)$/,\r\n			payload = {\r\n				\'Action\': \'DescribeTargetGroups\',\r\n				\'LoadBalancerArn\': AWS.params.arn,\r\n				\'Version\': \'2015-12-01\'\r\n			};\r\n		targets = AWS.getField(AWS.request(\'GET\', AWS.params.region, \'elasticloadbalancing\', AWS.prepareParams(payload), \'\'), \'DescribeTargetGroupsResponse.DescribeTargetGroupsResult.TargetGroups\');\r\n\r\n		if (!Array.isArray(targets))\r\n			targets = [targets]\r\n\r\n		targets.forEach(function (targets) {\r\n			lld_array.push(\r\n				{\r\n					target_name: AWS.getField(targets, \'TargetGroupName\'),\r\n					target_arn: AWS.getField(targets, \'TargetGroupArn\').match(regex)[0],\r\n					type: AWS.getField(targets, \'TargetType\'),\r\n					protocol: AWS.getField(targets, \'Protocol\')\r\n				}\r\n			)\r\n		});\r\n\r\n		return lld_array;\r\n	}\r\n};\r\n\r\ntry {\r\n	AWS.setParams(JSON.parse(value));\r\n	return JSON.stringify(AWS.listTargetGroups());\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ AWS ELB Target groups ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get ELB target group.\r\n`DescribeTargetGroups` API method: https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html','0','7d','0','',NULL,'{$AWS.DATA.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','d80c238267744bc9b46de217acd93842','0','2','0'),
('47107','21','','10627','[{#AWS.ELB.TARGET.GROUP.NAME}]: Get metrics','aws.elb.nlb.target_groups.get_metrics["{#AWS.ELB.TARGET.GROUP.NAME}"]','0s;m/5','0','0','0','4','','','','',NULL,NULL,'var AWS = {\r\n	params: {},\r\n	metadata: \'http://169.254.169.254/latest/\',\r\n	request_period: 60,\r\n\r\n	getField: function (data, path) {\r\n		var steps = path.split(\'.\');\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n\r\n			data = data[step];\r\n		}\r\n\r\n		return data;\r\n	},\r\n\r\n	setParams: function (params) {\r\n		AWS.params[\'proxy\'] = params.proxy;\r\n		switch (AWS.getField(params, \'auth_type\')) {\r\n			case \'role_base\':\r\n				AWS.params[\'auth_type\'] = \'role_base\';\r\n				var request = new HttpRequest();\r\n				if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n					request.setProxy(AWS.params.proxy);\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token-ttl-seconds: 21600\');\r\n				var token = request.put(AWS.metadata + \'api/token\');\r\n\r\n				if (request.getStatus() !== 200 || token === null || token === \'\') {\r\n					throw \'Error getting IMDSv2 session token.\';\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token: \' + token);\r\n				var IamRoleName = request.get(AWS.metadata + \'meta-data/iam/security-credentials\');\r\n\r\n				if (request.getStatus() !== 200 || IamRoleName === null || IamRoleName === \'\') {\r\n					throw \'Error getting security credentials from instance metadata. Role not found.\';\r\n				}\r\n\r\n				credentials = request.get(AWS.metadata + \'meta-data/iam/security-credentials/\' + encodeURI(IamRoleName));\r\n\r\n				if (request.getStatus() !== 200 || credentials === null || credentials === \'\') {\r\n					throw \'Error getting security credentials from instance metadata.\';\r\n				}\r\n\r\n				try {\r\n					credentials = JSON.parse(credentials);\r\n				}\r\n				catch (error) {\r\n					throw \'Failed to parse response received from instance metadata. Check debug log for more information.\';\r\n				}\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'Token\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			case \'assume_role\':\r\n				AWS.params[\'auth_type\'] = \'assume_role\';\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'sts_region\', \'role_arn\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n\r\n				role_arn_regex = /role\\/(.+)$/;\r\n\r\n				var payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': AWS.params.role_arn.match(role_arn_regex)[1] + \'Session\',\r\n				};\r\n\r\n				credentials = AWS.getField(AWS.request(\'POST\', AWS.params.sts_region, \'sts\', AWS.prepareParams(payload), \'\'), \'AssumeRoleResponse.AssumeRoleResult.Credentials\');\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'SessionToken\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			default:\r\n				AWS.params[\'auth_type\'] = \'access_key\';\r\n				[\'AccessKeyId\', \'SecretAccessKey\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n		}\r\n		[\'region\', \'arn\', \'target_arn\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: "\' + field + \'".\';\r\n			}\r\n			AWS.params[field] = params[field];\r\n		});\r\n	},\r\n\r\n	sign: function (key, message) {\r\n		var hex = hmac(\'sha256\', key, message);\r\n\r\n		if ((hex.length % 2) === 1) {\r\n			throw \'Invalid length of a hex string!\';\r\n		}\r\n\r\n		var result = new Int8Array(hex.length / 2);\r\n		for (var i = 0, b = 0; i < hex.length; i += 2, b++) {\r\n			result[b] = parseInt(hex.substring(i, i + 2), 16);\r\n		}\r\n\r\n		return result;\r\n	},\r\n\r\n	prepareParams: function (params) {\r\n		var result = [];\r\n\r\n		Object.keys(params).sort().forEach(function (key) {\r\n			if (typeof params[key] !== \'object\') {\r\n				result.push(key + \'=\' + encodeURIComponent(params[key]));\r\n			}\r\n			else {\r\n				result.push(prepareObject(key, params[key]));\r\n			}\r\n		});\r\n\r\n		return result.join(\'&\');\r\n	},\r\n\r\n	renderMetricQuery: function (period, arn, target_arn) {\r\n		var metrics_list = [\r\n			\'HealthyHostCount:Minimum\',\r\n			\'UnHealthyHostCount:Maximum\'\r\n		],\r\n			regex = /loadbalancer\\/(.+)$/;\r\n\r\n		var metric_payload = [];\r\n		metrics_list.forEach(function (metric, index) {\r\n			var parts = metric.split(\':\', 2);\r\n			metric_payload.push({\r\n				\'Id\': \'m\' + index,\r\n				\'MetricStat\': {\r\n					\'Metric\': {\r\n						\'MetricName\': parts[0],\r\n						\'Namespace\': \'AWS/NetworkELB\',\r\n						\'Dimensions\': [\r\n							{\r\n								\'Name\': \'LoadBalancer\',\r\n								\'Value\': arn.match(regex)[1],\r\n							},\r\n							{\r\n								\'Name\': \'TargetGroup\',\r\n								\'Value\': target_arn\r\n							}\r\n						]\r\n					},\r\n					\'Period\': period,\r\n					\'Stat\': parts[1],\r\n				}\r\n			});\r\n		});\r\n\r\n		return metric_payload;\r\n	},\r\n\r\n	request: function (method, region, service, params, data) {\r\n		if (typeof data === \'undefined\' || data === null) {\r\n			data = JSON.stringify([]);\r\n		}\r\n		else {\r\n			data = JSON.stringify(data)\r\n		}\r\n		var amzdate = (new Date()).toISOString().replace(/\\.\\d+Z/, \'Z\').replace(/[-:]/g, \'\'),\r\n			date = amzdate.replace(/T\\d+Z/, \'\'),\r\n			canonical_uri = \'/\',\r\n			host = service + \'.\' + region + \'.amazonaws.com\',\r\n			canonical_headers = \'content-encoding:amz-1.0\\n\' + \'host:\' + host + \'\\n\' + \'x-amz-date:\' + amzdate + \'\\n\',\r\n			signed_headers = \'content-encoding;host;x-amz-date\',\r\n			canonical_request = method + \'\\n\' + canonical_uri + \'\\n\' + params + \'\\n\' + canonical_headers + \'\\n\' + signed_headers + \'\\n\' + sha256(data),\r\n			credential_scope = date + \'/\' + region + \'/\' + service + \'/\' + \'aws4_request\',\r\n			request_string = \'AWS4-HMAC-SHA256\' + \'\\n\' + amzdate + \'\\n\' + credential_scope + \'\\n\' + sha256(canonical_request),\r\n			key = AWS.sign(\'AWS4\' + AWS.params.SecretAccessKey, date),\r\n			key = AWS.sign(key, region),\r\n			key = AWS.sign(key, service),\r\n			key = AWS.sign(key, \'aws4_request\'),\r\n			request = new HttpRequest(),\r\n			url = \'https://\' + host + canonical_uri + \'?\' + params;\r\n\r\n		if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n			request.setProxy(AWS.params.proxy);\r\n		}\r\n		request.addHeader(\'x-amz-date: \' + amzdate);\r\n		request.addHeader(\'x-amz-content-sha256:\' + sha256(data));\r\n		request.addHeader(\'X-Amz-Target: GraniteServiceVersion20100801.GetMetricData\')\r\n		request.addHeader(\'Accept: application/json\');\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Content-Encoding: amz-1.0\');\r\n		request.addHeader(\'Authorization: \' + \'AWS4-HMAC-SHA256 Credential=\' + AWS.params.AccessKeyId + \'/\' + credential_scope + \', \' + \'SignedHeaders=\' + signed_headers + \', \' + \'Signature=\' + hmac(\'sha256\', key, request_string));\r\n		if (AWS.params.auth_type === \'role_base\' || (AWS.params.auth_type === \'assume_role\' & !params.includes(\'AssumeRole\'))) {\r\n			request.addHeader(\'X-Amz-Security-Token: \' + (AWS.params.auth_type === \'role_base\' ? AWS.params.Token : AWS.params.SessionToken));\r\n		}\r\n\r\n		Zabbix.log(4, \'[ AWS ELB ] Sending request: \' + url);\r\n		response = request.post(url, data);\r\n		Zabbix.log(4, \'[ AWS ELB ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n		if (request.getStatus() !== 200) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		return JSON.parse(response);\r\n	},\r\n\r\n	getMetricsData: function () {\r\n		var end_time = Math.floor((new Date().getTime()) / 1000),\r\n			start_time = end_time - AWS.request_period * 60;\r\n		payload = {\r\n			\'StartTime\': start_time,\r\n			\'EndTime\': end_time,\r\n			\'ScanBy\': \'TimestampDescending\',\r\n			\'MetricDataQueries\': AWS.renderMetricQuery(AWS.request_period, AWS.params.arn, AWS.params.target_arn)\r\n		};\r\n\r\n		return AWS.getField(AWS.request(\'POST\', AWS.params.region, \'monitoring\', \'\', payload), \'MetricDataResults\');\r\n	}\r\n};\r\n\r\ntry {\r\n	AWS.setParams(JSON.parse(value));\r\n	return JSON.stringify(AWS.getMetricsData());\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ AWS ELB Get targets group metrics] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','2',NULL,'Get the metrics of the ELB target group `{#AWS.ELB.TARGET.GROUP.NAME}`.\r\nFull list of metrics related to AWS ELB here: https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-cloudwatch-metrics.html#user-authentication-metric-table','0','7d','0','',NULL,'{$AWS.DATA.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','9438a03b48bd4617a2363f83f758f107','0','2','0'),
('47131','22','','10628','Website {$WEBSITE.DOMAIN} Get data','website.get.data','{$WEBSITE.GET.DATA.INTERVAL}','0','0','0','4','','','','',NULL,NULL,'const Website = {\r\n    params: {},\r\n\r\n    setParams(params) {\r\n        [\'scheme\', \'domain\',\'width\', \'height\'].forEach(function (field) {\r\n            if (typeof params !== \'object\' || !params[field]) {\r\n                throw new Error(\'Required param is not set: \' + field + \'.\');\r\n            }\r\n        });\r\n        this.params = params;\r\n    },\r\n\r\n    getOptions(browser) {\r\n        switch ((browser || \'\').trim().toLowerCase()) {\r\n            case \'firefox\':\r\n                return Browser.firefoxOptions();\r\n            case \'safari\':\r\n                return Browser.safariOptions();\r\n            case \'edge\':\r\n                return Browser.edgeOptions();\r\n            default:\r\n                return Browser.chromeOptions();\r\n        }\r\n    },\r\n\r\n    getPerformance() {\r\n        const browser = new Browser(Website.getOptions(Website.params.browser));\r\n        const url = Website.params.scheme + \'://\' + Website.params.domain + \'/\' + Website.params.path\r\n        const screenshot = \'\';\r\n        browser.setScreenSize(Number(Website.params.width), Number(Website.params.height))\r\n        browser.navigate(url);\r\n        browser.collectPerfEntries();\r\n        screenshot = browser.getScreenshot();\r\n        const result = browser.getResult();\r\n        result.screenshot = screenshot;\r\n\r\n        return JSON.stringify(result);\r\n    }\r\n};\r\n\r\ntry {\r\n    Website.setParams(JSON.parse(value));\r\n    return Website.getPerformance();\r\n\r\n} catch (error) {\r\n    error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n    Zabbix.log(3, \'[ Website get metrics] ERROR: \' + error);\r\n    return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Returns the JSON with performance counters of the requested website.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b5d5b396dfdc4fc99e4c2d0216728027','0','2','0'),
('47158','16','','10629','License: Users: Get','jmx.discovery[attributes,"com.atlassian.jira:type=jira.license"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'License data for the discovery rule.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','27334384618d4b2f91d700b188463a56','0','2','0'),
('47159','16','','10629','DB: Connections: Limit','jmx["com.atlassian.jira:name=BasicDataSource,connectionpool=connections",MaxTotal]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'Total allowed database connection count.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','11a89b91831b4b5d899bff63ba935cbb','0','2','0'),
('47160','16','','10629','DB: Connections: Active','jmx["com.atlassian.jira:name=BasicDataSource,connectionpool=connections",NumActive]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'Active database connection count.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f064dbd8781848c09184fb83a3a46097','0','2','0'),
('47161','16','','10629','DB: Reads','jmx["com.atlassian.jira:type=db.reads",invocation\\.count]','1m','31d','365d','0','0','','rps','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'Database read operations from Jira per second.\r\nUnits: rps - read operations per second.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2928e1e3b68940938a0b107eb5d72b95','0','2','0'),
('47162','16','','10629','DB: Writes','jmx["com.atlassian.jira:type=db.writes",invocation\\.count]','1m','31d','365d','0','0','','wps','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'Database write operations from Jira per second.\r\nUnits: wps - write operations per second.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ad5c16fa48864dc6b625a23f95ecf07a','0','2','0'),
('47163','16','','10629','Entity: Attachments','jmx["com.atlassian.jira:type=entity.attachments.total",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The number of attachments.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','942556b043734986a2c5e261e97d5b1c','0','2','0'),
('47164','16','','10629','Entity: Components','jmx["com.atlassian.jira:type=entity.components.total",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The number of components.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','7aa003c53cb14555a88ee02e804ca45f','0','2','0'),
('47165','16','','10629','Entity: Custom fields','jmx["com.atlassian.jira:type=entity.customfields.total",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The number of custom fields.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8ddf2cb59bb44d8a8fe7f2ca9e44ad20','0','2','0'),
('47166','16','','10629','Entity: Filters','jmx["com.atlassian.jira:type=entity.filters.total",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The number of filters.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2c8d303953ed44b6815129a6a77ee5c6','0','2','0'),
('47167','16','','10629','Entity: Issues','jmx["com.atlassian.jira:type=entity.issues.total",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The number of issues.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5d9a669481ab448eb5c9e0b64f3517b0','0','2','0'),
('47168','16','','10629','Entity: Versions created','jmx["com.atlassian.jira:type=entity.versions.total",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The number of versions created.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b6a8a8ed8a9242858560b0743cc955aa','0','2','0'),
('47169','16','','10629','Issue: Created per minute','jmx["com.atlassian.jira:type=issue.created.count",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'Issues created per minute.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2152f7eb0bff4c9888e131634b770673','0','2','0'),
('47170','16','','10629','Issue: Search per minute','jmx["com.atlassian.jira:type=issue.search.count",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'Issue searches performed per minute.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','25fdfd0e3dce4d95ac2cdaed41ba5fb6','0','2','0'),
('47171','16','','10629','Issue: Updates per minute','jmx["com.atlassian.jira:type=issue.updated.count",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'Issue updates performed per minute.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','060d5f5ccf3a4ab197e4b95d9eb88b17','0','2','0'),
('47172','16','','10629','DB: Connections: Failed per minute','jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=failures,name=counter",Count]','0;m0-59','31d','365d','0','0','','fpm','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The count of database connection failures registered in one minute.\r\nUnits: fpm - fails per minute.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','bb565c20d5ad4cf1a94aea5966ec12fa','0','2','0'),
('47173','16','','10629','DB: Connections: Latency','jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=latency,name=value",Value]','1m','31d','365d','0','0','','ms','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The latest measure of latency when querying the database.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8fb52b3e150a4f5fb84e8b527aaaf5a5','0','2','0'),
('47174','16','','10629','DB: Pool: Connections: Active','jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=pool,category03=numActive,name=value",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'Active connection count of the database pool.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2d22d7c78abe40b8a82fb70a8d1091d1','0','2','0'),
('47175','16','','10629','DB: Pool: Connections: Idle','jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=pool,category03=numIdle,name=value",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'Idle connection count of the database pool.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','c18d258cdb8f420e8cb18a9e6e7c2bf8','0','2','0'),
('47176','16','','10629','DB: Connections: State','jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=state,name=value",Value]','1m','31d','365d','0','3','','','','',NULL,'1221','','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The state of the database connection.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','fc7870021dc04bf499db8834be67987e','0','2','0'),
('47177','16','','10629','HTTP: Pool: Connections: Active','jmx["com.atlassian.jira:type=metrics,category00=http,category01=connection,category02=pool,category03=numActive,name=value",Value]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The latest measure of the number of active connections in the HTTP connection pool.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','25d810c7fd5e4116a8e2323b7a2537a0','0','2','0'),
('47178','16','','10629','HTTP: Pool: Connections: Idle','jmx["com.atlassian.jira:type=metrics,category00=http,category01=connection,category02=pool,category03=numIdle,name=value",Value]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The latest measure of the number of idle connections in the HTTP connection pool.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b244d220b7e24d48913f4e8e1b490732','0','2','0'),
('47179','16','','10629','HTTP: Sessions: Active','jmx["com.atlassian.jira:type=metrics,category00=http,category01=connection,category02=sessions,category03=active,name=value",Value]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The latest measure of the number of active user sessions.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','195bc0648f6445bbbe205a5869383c68','0','2','0'),
('47180','16','','10629','HTTP: Requests per minute','jmx["com.atlassian.jira:type=metrics,category00=http,category01=requests,name=value",Value]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The latest measure of the total number of HTTP requests per minute.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','0d5a76f579284baf9eaa47180ed2c3fa','0','2','0'),
('47181','16','','10629','Mail: Queue: Processing state','jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=jobRunning,name=value",Value]','1m','31d','365d','0','0','','','','',NULL,'1223','','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The latest indicator of the state of a mail queue job.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','7029cc0f375740c79790b410b92579a1','0','2','0'),
('47182','16','','10629','Mail: Sent per minute','jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numEmailsSentPerMin,name=value",Value]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The latest measure of the number of emails sent by the SMTP server per minute.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','27f65a6cc7a147c2a95d3348db0cc9eb','0','2','0'),
('47183','16','','10629','Mail: Queue: Error','jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numErrors,name=value",Value]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The latest measure of the number of items in an error mail queue.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ec7e12f99490496c814e9000108ec8c9','0','2','0'),
('47184','16','','10629','Mail: Queue','jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numItems,name=value",Value]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The latest measure of the number of items in a mail queue.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','67789113243b4689af58e42d0a127878','0','2','0'),
('47185','16','','10629','Mail: Processed per minute','jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numItemsProcessedPerMin,name=value",Value]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The latest measure of the number of items processed by a mail queue per minute.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3d311c2e46af4c98b11f5f1a50b5318e','0','2','0'),
('47186','16','','10629','Quicksearch: Concurrent searches','jmx["com.atlassian.jira:type=quicksearch.concurrent.search",Value]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','0',NULL,'The number of concurrent searches that are being performed in real-time by using the quick search.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','6a81cf33cc834115b352324a18355368','0','2','0'),
('47187','16','','10629','Storage discovery','jmx.discovery[beans,"com.atlassian.jira:type=metrics,category00=home,category01=*,category02=write,category03=latency,*,name=value"]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','1',NULL,'Discovery of the Jira storage metrics.','0','7d','1','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','6b671426094e4268b48f51eb97ddd8bf','0','2','0'),
('47188','16','','10629','Indexing latency discovery','jmx.discovery[beans,"com.atlassian.jira:type=metrics,category00=indexing,name=*"]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','1',NULL,'Discovery of the Jira indexing metrics.','0','7d','1','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','886f8b2c518d4f3bb3d4441e29bf13fc','0','2','0'),
('47189','16','','10629','Issue latency discovery','jmx.discovery[beans,"com.atlassian.jira:type=metrics,category00=issue,name=*"]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','1',NULL,'Discovery of the Jira issue latency metrics.','0','7d','1','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','70db70727f824102b769a652713432ad','0','2','0'),
('47190','16','','10629','Mail server discovery','jmx.discovery[beans,"com.atlassian.jira:type=metrics,category00=mail,category01=*,category02=connection,category03=state,name=*"]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','1',NULL,'Discovery of the Jira connected mail servers.','0','7d','1','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2bd3e8ce78f84ccba599137b0e0ab6a0','0','2','0'),
('47192','16','','10629','Storage [{#JMXCATEGORY01}]: Latency','jmx["{#JMXOBJ}",Value]','15m','31d','365d','0','0','','s','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','2',NULL,'The median latency of writing a small file (~30 bytes) to `{#JMXCATEGORY01}`.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','933c9c8b11e848f88775ee9b54f8d292','0','2','0'),
('47193','16','','10629','Indexing [{#JMXNAME}]: Latency','jmx["com.atlassian.jira:type=metrics,category00=indexing,name={#JMXNAME}",Mean]','15m','31d','365d','0','0','','s','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','2',NULL,'Average time spent on indexing operations.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2b02e3232de34ae9803f80ac94ade79c','0','2','0'),
('47194','16','','10629','Issue [{#JMXNAME}]: Latency','jmx["{#JMXOBJ}",Mean]','15m','31d','365d','0','0','','s','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','2',NULL,'Average time spent on issue `{#JMXNAME}` operations.','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','da6d68fa14f24f58bcbe1157b9818321','0','2','0'),
('47195','16','','10629','Mail [{#JMXCATEGORY01},{#JMXNAME}]: Connection state','jmx["{#JMXOBJ}",Connected]','1m','31d','365d','0','3','','','','',NULL,'1221','','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','2',NULL,'Shows connection state of Jira to discovered mail server: `{#JMXCATEGORY01}-{#JMXNAME}`','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5281bee6b829433a875c0e026d805206','0','2','0'),
('47196','16','','10629','Mail [{#JMXCATEGORY01},{#JMXNAME}]: Failures per minute','jmx["{#JMXOBJ}",TotalFailures]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$JMX.USER}','{$JMX.PASSWORD}','','','2',NULL,'Count of failed connections to discovered mail server `{#JMXCATEGORY01}-{#JMXNAME}` per minute','0','7d','0','service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','949854436d6542f9a859a65cec20572d','0','2','0'),
('47199','5','','10048','Utilization of browser poller data collector processes, in %','zabbix[process,browser poller,avg,busy]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'The average percentage of the time during which the browser poller processes have been busy for the last minute.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3ec67d79691b432c8a357fedfec77e6d','0','2','0'),
('47200','5','','10048','Utilization of internal poller data collector processes, in %','zabbix[process,internal poller,avg,busy]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'The average percentage of the time during which the internal poller processes have been busy for the last minute.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','a1278ad64af9401a834cd09b0c2f5766','0','2','0'),
('47203','5','','10047','Utilization of browser poller data collector processes, in %','zabbix[process,browser poller,avg,busy]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'The average percentage of the time during which the browser poller processes have been busy for the last minute.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','dd20332db0c64a63a82378c1e8b2685c','0','2','0'),
('47204','5','','10047','Utilization of configuration syncer worker internal processes, in %','zabbix[process,configuration syncer worker,avg,busy]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'The average percentage of the time during which the configuration syncer worker processes have been busy for the last minute.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','dfb04028770e4e3e8a154304b82284ba','0','2','0'),
('47205','5','','10047','Utilization of internal poller data collector processes, in %','zabbix[process,internal poller,avg,busy]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'The average percentage of the time during which the internal poller processes have been busy for the last minute.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','912dd7b55d244aa9bbc3af17ba168b13','0','2','0'),
('47206','5','','10047','Utilization of proxy group manager internal processes, in %','zabbix[process,proxy group manager,avg,busy]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'The average percentage of the time during which the proxy group manager processes have been busy for the last minute.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','306334d48ce6427d93ca8fbe292b8a11','0','2','0'),
('47215','21','','10630','Get data','azure.scaleset.data.get','1m','0','0','0','4','','','','',NULL,NULL,'var Azure = {\r\n	params: {},\r\n	token: null,\r\n\r\n	setParams: function (params) {\r\n		[\'app_id\', \'password\', \'tenant_id\', \'subscription_id\', \'resource_id\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		Azure.params = params;\r\n	},\r\n\r\n	login: function () {\r\n		var response, login = new HttpRequest();\r\n\r\n		if (typeof Azure.params.proxy !== \'undefined\' && Azure.params.proxy !== \'\') {\r\n			login.setProxy(Azure.params.proxy);\r\n		}\r\n\r\n		login.addHeader(\'Content-Type: application/x-www-form-urlencoded\');\r\n		response = login.post(\r\n			\'https://login.microsoftonline.com/\' + encodeURIComponent(Azure.params.tenant_id) + \'/oauth2/token\',\r\n			\'grant_type=client_credentials&resource=\' + encodeURIComponent(\'https://management.azure.com/\') + \'&client_id=\' + encodeURIComponent(Azure.params.app_id) + \'&client_secret=\' + encodeURIComponent(Azure.params.password)\r\n		);\r\n\r\n		if (login.getStatus() !== 200) {\r\n			throw \'Login failed with status code \' + login.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse login session response.\';\r\n		}\r\n\r\n		if (!response.hasOwnProperty(\'access_token\')) {\r\n			throw \'Authentication response does not contain access token.\';\r\n		}\r\n\r\n		Azure.token = response[\'access_token\'];\r\n	},\r\n\r\n	request: function (url) {\r\n		var response, request = new HttpRequest();\r\n\r\n		if (typeof Azure.params.proxy !== \'undefined\' && Azure.params.proxy !== \'\') {\r\n			request.setProxy(Azure.params.proxy);\r\n		}\r\n\r\n		if (!Azure.token) {\r\n			throw \'Request does not contain access token.\';\r\n		}\r\n\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Authorization: Bearer \' + Azure.token);\r\n		Zabbix.log(4, \'[ AzureVMSS ] request url: \' + url);\r\n\r\n		response = request.get(url);\r\n\r\n		if (request.getStatus() !== 200) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			return JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from API.\';\r\n		}\r\n	},\r\n\r\n	getField: function (data, path) {\r\n		var steps = path.split(\'.\');\r\n\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n			data = data[step];\r\n		}\r\n\r\n		return data;\r\n	},\r\n\r\n	getMetricsData: function () {\r\n		var data = {},\r\n			metric_endpoints = {\r\n				\'main_metrics\': \'/providers/Microsoft.Insights/metrics?metricnames=\' + encodeURIComponent(\'Available Memory Bytes,CPU Credits Consumed,CPU Credits Remaining,Percentage CPU,Inbound Flows,Inbound Flows Maximum Creation Rate,Network In,Network In Total,Network Out,Network Out Total,Outbound Flows,Outbound Flows Maximum Creation Rate,VmAvailabilityMetric\') + \'&api-version=2021-05-01&timespan=PT1M\',\r\n				\'disks_metrics\': \'/providers/Microsoft.Insights/metrics?metricnames=\' + encodeURIComponent(\'Data Disk Bandwidth Consumed Percentage,Data Disk IOPS Consumed Percentage,Data Disk Max Burst Bandwidth,Data Disk Max Burst IOPS,Data Disk Queue Depth,Data Disk Read Bytes/sec,Data Disk Read Operations/Sec,Data Disk Target Bandwidth,Data Disk Target IOPS,Data Disk Used Burst BPS Credits Percentage,Data Disk Used Burst IO Credits Percentage,Data Disk Write Bytes/sec,Data Disk Write Operations/Sec,Disk Read Bytes,Disk Read Operations/Sec,Disk Write Bytes,Disk Write Operations/Sec\') + \'&api-version=2021-05-01&timespan=PT1M\',\r\n				\'os_disk_metrics\': \'/providers/Microsoft.Insights/metrics?metricnames=\' + encodeURIComponent(\'OS Disk Bandwidth Consumed Percentage,OS Disk IOPS Consumed Percentage,OS Disk Max Burst Bandwidth,OS Disk Max Burst IOPS,OS Disk Queue Depth,OS Disk Read Bytes/sec,OS Disk Read Operations/Sec,OS Disk Target Bandwidth,OS Disk Target IOPS,OS Disk Used Burst BPS Credits Percentage,OS Disk Used Burst IO Credits Percentage,OS Disk Write Bytes/sec,OS Disk Write Operations/Sec\') + \'&api-version=2021-05-01&timespan=PT1M\',\r\n				\'premium_and_vm_metrics\': \'/providers/Microsoft.Insights/metrics?metricnames=\' + encodeURIComponent(\'Premium Data Disk Cache Read Hit,Premium Data Disk Cache Read Miss,Premium OS Disk Cache Read Hit,Premium OS Disk Cache Read Miss,VM Cached Bandwidth Consumed Percentage,VM Cached IOPS Consumed Percentage,VM Local Used Burst BPS Credits Percentage,VM Local Used Burst IO Credits Percentage,VM Remote Used Burst BPS Credits Percentage,VM Remote Used Burst IO Credits Percentage,VM Uncached Bandwidth Consumed Percentage,VM Uncached IOPS Consumed Percentage\') + \'&api-version=2021-05-01&timespan=PT1M\'\r\n			};\r\n\r\n		data.metrics = {};\r\n\r\n		Object.keys(metric_endpoints).forEach(function (field) {\r\n			metrics = Azure.getField(Azure.request(\'https://management.azure.com\' + Azure.params.resource_id + metric_endpoints[field]), \'value\');\r\n			for (k in metrics) {\r\n				key = Azure.getField(metrics[k], \'name.value\').replace(/(\\s|\\/)+/g, \'\');\r\n				if (metrics[k].timeseries.length === 0) {\r\n					metrics[k].timeseries.push({ \'data\': [\'nodata\'] })\r\n				}\r\n				data.metrics[key] = Azure.getField(metrics[k], \'timeseries.0.data.0\');\r\n			}\r\n		});\r\n\r\n		data.capacity = Azure.getField(Azure.request(\'https://management.azure.com\' + Azure.params.resource_id + \'?api-version=2024-03-01\'), \'sku.capacity\');\r\n		data.health = Azure.getField(Azure.request(\'https://management.azure.com\' + Azure.params.resource_id + \'/providers/Microsoft.ResourceHealth/availabilityStatuses?api-version=2020-05-01\'), \'value.0.properties\');\r\n\r\n		return data\r\n	}\r\n};\r\n\r\ntry {\r\n	Azure.setParams(JSON.parse(value));\r\n	Azure.login();\r\n	return JSON.stringify(Azure.getMetricsData());\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ AzureVMSS ] ERROR: \' + error);\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Gathers data of the virtual machine scale set.','0','7d','0','',NULL,'{$AZURE.DATA.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','f783d047862144f2baed76bb281cec5b','0','2','0'),
('47282','21','','10632','Get Lambda alarms data','aws.lambda.get_alarms','0s;m/1','0','0','0','4','','','','',NULL,NULL,'var AWS = {\r\n	params: {},\r\n	metadata: \'http://169.254.169.254/latest/\',\r\n\r\n	getField: function (data, path) {\r\n		var steps = path.split(\'.\');\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n\r\n			data = data[step];\r\n		}\r\n\r\n		return data;\r\n	},\r\n\r\n	setParams: function (params) {\r\n		AWS.params[\'proxy\'] = params.proxy;\r\n		switch (AWS.getField(params, \'auth_type\')) {\r\n			case \'role_base\':\r\n				AWS.params[\'auth_type\'] = \'role_base\';\r\n				var request = new HttpRequest();\r\n				if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n					request.setProxy(AWS.params.proxy);\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token-ttl-seconds: 21600\');\r\n				var token = request.put(AWS.metadata + \'api/token\');\r\n\r\n				if (request.getStatus() !== 200 || token === null || token === \'\') {\r\n					throw \'Error getting IMDSv2 session token.\';\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token: \' + token);\r\n				var IamRoleName = request.get(AWS.metadata + \'meta-data/iam/security-credentials\');\r\n\r\n				if (request.getStatus() !== 200 || IamRoleName === null || IamRoleName === \'\') {\r\n					throw \'Error getting security credentials from instance metadata. Role not found.\';\r\n				}\r\n\r\n				credentials = request.get(AWS.metadata + \'meta-data/iam/security-credentials/\' + encodeURI(IamRoleName));\r\n\r\n				if (request.getStatus() !== 200 || credentials === null || credentials === \'\') {\r\n					throw \'Error getting security credentials from instance metadata.\';\r\n				}\r\n\r\n				try {\r\n					credentials = JSON.parse(credentials);\r\n				}\r\n				catch (error) {\r\n					throw \'Failed to parse response received from instance metadata. Check debug log for more information.\';\r\n				}\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'Token\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			case \'assume_role\':\r\n				AWS.params[\'auth_type\'] = \'assume_role\';\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'sts_region\', \'role_arn\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n\r\n				role_arn_regex = /role\\/(.+)$/;\r\n\r\n				var payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': AWS.params.role_arn.match(role_arn_regex)[1] + \'Session\',\r\n				};\r\n\r\n				credentials = AWS.getField(AWS.request(\'GET\', AWS.params.sts_region, \'sts\', AWS.prepareParams(payload), \'\'), \'AssumeRoleResponse.AssumeRoleResult.Credentials\');\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'SessionToken\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			default:\r\n				AWS.params[\'auth_type\'] = \'access_key\';\r\n				[\'AccessKeyId\', \'SecretAccessKey\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n		}\r\n		[\'region\', \'name\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: "\' + field + \'".\';\r\n			}\r\n			AWS.params[field] = params[field];\r\n		});\r\n	},\r\n\r\n	sign: function (key, message) {\r\n		var hex = hmac(\'sha256\', key, message);\r\n\r\n		if ((hex.length % 2) === 1) {\r\n			throw \'Invalid length of a hex string!\';\r\n		}\r\n\r\n		var result = new Int8Array(hex.length / 2);\r\n		for (var i = 0, b = 0; i < hex.length; i += 2, b++) {\r\n			result[b] = parseInt(hex.substring(i, i + 2), 16);\r\n		}\r\n\r\n		return result;\r\n	},\r\n\r\n	prepareParams: function (params) {\r\n		var result = [];\r\n\r\n		Object.keys(params).sort().forEach(function (key) {\r\n			if (typeof params[key] !== \'object\') {\r\n				result.push(key + \'=\' + encodeURIComponent(params[key]));\r\n			}\r\n			else {\r\n				result.push(prepareObject(key, params[key]));\r\n			}\r\n		});\r\n\r\n		return result.join(\'&\');\r\n	},\r\n\r\n	request: function (method, region, service, params, data) {\r\n		if (typeof data === \'undefined\' || data === null) {\r\n			data = \'\';\r\n		}\r\n\r\n		var amzdate = (new Date()).toISOString().replace(/\\.\\d+Z/, \'Z\').replace(/[-:]/g, \'\'),\r\n			date = amzdate.replace(/T\\d+Z/, \'\'),\r\n			host = service + \'.\' + region + \'.amazonaws.com\',\r\n			canonical_uri = \'/\',\r\n			canonical_headers = \'content-encoding:amz-1.0\\n\' + \'host:\' + host + \'\\n\' + \'x-amz-date:\' + amzdate + \'\\n\',\r\n			signed_headers = \'content-encoding;host;x-amz-date\',\r\n			canonical_request = method + \'\\n\' + canonical_uri + \'\\n\' + params + \'\\n\' + canonical_headers + \'\\n\' + signed_headers + \'\\n\' + sha256(data),\r\n			credential_scope = date + \'/\' + region + \'/\' + service + \'/\' + \'aws4_request\',\r\n			request_string = \'AWS4-HMAC-SHA256\' + \'\\n\' + amzdate + \'\\n\' + credential_scope + \'\\n\' + sha256(canonical_request),\r\n			key = AWS.sign(\'AWS4\' + AWS.params.SecretAccessKey, date),\r\n			key = AWS.sign(key, region),\r\n			key = AWS.sign(key, service),\r\n			key = AWS.sign(key, \'aws4_request\'),\r\n			request = new HttpRequest(),\r\n			url = \'https://\' + host + canonical_uri + \'?\' + params;\r\n\r\n		if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n			request.setProxy(AWS.params.proxy);\r\n		}\r\n		request.addHeader(\'x-amz-date: \' + amzdate);\r\n		request.addHeader(\'Accept: application/json\');\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Content-Encoding: amz-1.0\');\r\n		request.addHeader(\'Authorization: \' + \'AWS4-HMAC-SHA256 Credential=\' + AWS.params.AccessKeyId + \'/\' + credential_scope + \', \' + \'SignedHeaders=\' + signed_headers + \', \' + \'Signature=\' + hmac(\'sha256\', key, request_string));\r\n		if (AWS.params.auth_type === \'role_base\' || (AWS.params.auth_type === \'assume_role\' & !params.includes(\'AssumeRole\'))) {\r\n			request.addHeader(\'X-Amz-Security-Token: \' + (AWS.params.auth_type === \'role_base\' ? AWS.params.Token : AWS.params.SessionToken));\r\n		}\r\n\r\n		Zabbix.log(4, \'[ AWS Lambda Alarms ] Sending request: \' + url);\r\n		response = request.get(url);\r\n		Zabbix.log(4, \'[ AWS Lambda Alarms ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() !== 200) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			try {\r\n				response = JSON.parse(XML.toJson(response));\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from AWS CloudWatch API. Check debug log for more information.\';\r\n			}\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	getAlarms: function () {\r\n		var payload = {\r\n			\'Action\': \'DescribeAlarms\',\r\n			\'Version\': \'2010-08-01\',\r\n			\'MaxRecords\': 100\r\n		},\r\n			result = [];\r\n\r\n		while (payload.NextToken !== \'\') {\r\n			var alarms = AWS.getField(AWS.request(\'GET\', AWS.params.region, \'monitoring\', AWS.prepareParams(payload)), \'DescribeAlarmsResponse.DescribeAlarmsResult\');\r\n			payload.NextToken = alarms.NextToken || \'\';\r\n			alarms_list = AWS.getField(alarms, \'MetricAlarms\');\r\n\r\n			if (!Array.isArray(alarms_list))\r\n				alarms_list = [alarms_list];\r\n			alarms_list.forEach(function (alarm) {\r\n				var dimensions = alarm.Dimensions;\r\n\r\n				if (Array.isArray(alarm.Metrics)) {\r\n					alarm.Metrics.forEach(function (metric) {\r\n						if (typeof metric.MetricStat === \'object\' && metric.MetricStat !== null\r\n							&& typeof metric.MetricStat.Metric === \'object\' && metric.MetricStat.Metric !== null\r\n							&& Array.isArray(metric.MetricStat.Metric.Dimensions)) {\r\n							dimensions = dimensions.concat(metric.MetricStat.Metric.Dimensions);\r\n						}\r\n					});\r\n				}\r\n				for (var i in dimensions) {\r\n					if (dimensions[i].Name === \'FunctionName\' && dimensions[i].Value === AWS.params.name) {\r\n						result.push(alarm);\r\n						break;\r\n					}\r\n				}\r\n			});\r\n		}\r\n\r\n		return result;\r\n	}\r\n};\r\n\r\ntry {\r\n	AWS.setParams(JSON.parse(value));\r\n\r\n	return JSON.stringify(AWS.getAlarms());\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ AWS Lambda Alarms ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'`DescribeAlarms` API method: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html','0','7d','0','',NULL,'{$AWS.DATA.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','c80b25e889004287b6131c00000a3ad7','0','2','0'),
('47283','21','','10632','Get metrics data','aws.lambda.get_metrics','0s;m/1','0','0','0','4','','','','',NULL,NULL,'var AWS = {\r\n	params: {},\r\n	metadata: \'http://169.254.169.254/latest/\',\r\n	request_period: 60,\r\n\r\n	getField: function (data, path) {\r\n		var steps = path.split(\'.\');\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n\r\n			data = data[step];\r\n		}\r\n\r\n		return data;\r\n	},\r\n\r\n	setParams: function (params) {\r\n		AWS.params[\'proxy\'] = params.proxy;\r\n		switch (AWS.getField(params, \'auth_type\')) {\r\n			case \'role_base\':\r\n				AWS.params[\'auth_type\'] = \'role_base\';\r\n				var request = new HttpRequest();\r\n				if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n					request.setProxy(AWS.params.proxy);\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token-ttl-seconds: 21600\');\r\n				var token = request.put(AWS.metadata + \'api/token\');\r\n\r\n				if (request.getStatus() !== 200 || token === null || token === \'\') {\r\n					throw \'Error getting IMDSv2 session token.\';\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token: \' + token);\r\n				var IamRoleName = request.get(AWS.metadata + \'meta-data/iam/security-credentials\');\r\n\r\n				if (request.getStatus() !== 200 || IamRoleName === null || IamRoleName === \'\') {\r\n					throw \'Error getting security credentials from instance metadata. Role not found.\';\r\n				}\r\n\r\n				credentials = request.get(AWS.metadata + \'meta-data/iam/security-credentials/\' + encodeURI(IamRoleName));\r\n\r\n				if (request.getStatus() !== 200 || credentials === null || credentials === \'\') {\r\n					throw \'Error getting security credentials from instance metadata.\';\r\n				}\r\n\r\n				try {\r\n					credentials = JSON.parse(credentials);\r\n				}\r\n				catch (error) {\r\n					throw \'Failed to parse response received from instance metadata. Check debug log for more information.\';\r\n				}\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'Token\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			case \'assume_role\':\r\n				AWS.params[\'auth_type\'] = \'assume_role\';\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'sts_region\', \'role_arn\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n\r\n				role_arn_regex = /role\\/(.+)$/;\r\n\r\n				var payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': AWS.params.role_arn.match(role_arn_regex)[1] + \'Session\',\r\n				};\r\n\r\n				credentials = AWS.getField(AWS.request(\'POST\', AWS.params.sts_region, \'sts\', AWS.prepareParams(payload), \'\'), \'AssumeRoleResponse.AssumeRoleResult.Credentials\');\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'SessionToken\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			default:\r\n				AWS.params[\'auth_type\'] = \'access_key\';\r\n				[\'AccessKeyId\', \'SecretAccessKey\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n		}\r\n		[\'region\', \'name\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: "\' + field + \'".\';\r\n			}\r\n			AWS.params[field] = params[field];\r\n		});\r\n\r\n	},\r\n\r\n	sign: function (key, message) {\r\n		var hex = hmac(\'sha256\', key, message);\r\n\r\n		if ((hex.length % 2) === 1) {\r\n			throw \'Invalid length of a hex string!\';\r\n		}\r\n\r\n		var result = new Int8Array(hex.length / 2);\r\n		for (var i = 0, b = 0; i < hex.length; i += 2, b++) {\r\n			result[b] = parseInt(hex.substring(i, i + 2), 16);\r\n		}\r\n\r\n		return result;\r\n	},\r\n\r\n	prepareParams: function (params) {\r\n		var result = [];\r\n\r\n		Object.keys(params).sort().forEach(function (key) {\r\n			if (typeof params[key] !== \'object\') {\r\n				result.push(key + \'=\' + encodeURIComponent(params[key]));\r\n			}\r\n			else {\r\n				result.push(prepareObject(key, params[key]));\r\n			}\r\n		});\r\n\r\n		return result.join(\'&\');\r\n	},\r\n\r\n	renderMetricQuery: function (period, name) {\r\n		var metrics_list = [\r\n			\'AsyncEventsReceived:Average\',\r\n			\'AsyncEventAge:Average\',\r\n			\'AsyncEventsDropped:Average\',\r\n			\'ConcurrentExecutions:Average\',\r\n			\'UnreservedConcurrentExecutions:Sum\',\r\n			\'Invocations:Sum\',\r\n			\'Errors:Sum\',\r\n			\'Throttles:Sum\',\r\n			\'Duration:Average\'\r\n		];\r\n\r\n		var metric_payload = [];\r\n		metrics_list.forEach(function (metric, index) {\r\n			var parts = metric.split(\':\', 2);\r\n			metric_payload.push({\r\n				\'Id\': \'m\' + index,\r\n				\'MetricStat\': {\r\n					\'Metric\': {\r\n						\'MetricName\': parts[0],\r\n						\'Namespace\': \'AWS/Lambda\',\r\n						\'Dimensions\': [\r\n							{\r\n								\'Name\': \'FunctionName\',\r\n								\'Value\': name,\r\n							}\r\n						]\r\n					},\r\n					\'Period\': period,\r\n					\'Stat\': parts[1],\r\n				}\r\n			});\r\n		});\r\n\r\n		return metric_payload;\r\n	},\r\n\r\n	request: function (method, region, service, params, data) {\r\n		if (typeof data === \'undefined\' || data === null) {\r\n			data = JSON.stringify([]);\r\n		}\r\n		else {\r\n			data = JSON.stringify(data)\r\n		}\r\n		var amzdate = (new Date()).toISOString().replace(/\\.\\d+Z/, \'Z\').replace(/[-:]/g, \'\'),\r\n			date = amzdate.replace(/T\\d+Z/, \'\'),\r\n			canonical_uri = \'/\',\r\n			host = service + \'.\' + region + \'.amazonaws.com\',\r\n			canonical_headers = \'content-encoding:amz-1.0\\n\' + \'host:\' + host + \'\\n\' + \'x-amz-date:\' + amzdate + \'\\n\',\r\n			signed_headers = \'content-encoding;host;x-amz-date\',\r\n			canonical_request = method + \'\\n\' + canonical_uri + \'\\n\' + params + \'\\n\' + canonical_headers + \'\\n\' + signed_headers + \'\\n\' + sha256(data),\r\n			credential_scope = date + \'/\' + region + \'/\' + service + \'/\' + \'aws4_request\',\r\n			request_string = \'AWS4-HMAC-SHA256\' + \'\\n\' + amzdate + \'\\n\' + credential_scope + \'\\n\' + sha256(canonical_request),\r\n			key = AWS.sign(\'AWS4\' + AWS.params.SecretAccessKey, date),\r\n			key = AWS.sign(key, region),\r\n			key = AWS.sign(key, service),\r\n			key = AWS.sign(key, \'aws4_request\'),\r\n			request = new HttpRequest(),\r\n			url = \'https://\' + host + canonical_uri + \'?\' + params;\r\n\r\n		if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n			request.setProxy(AWS.params.proxy);\r\n		}\r\n		request.addHeader(\'x-amz-date: \' + amzdate);\r\n		request.addHeader(\'x-amz-content-sha256:\' + sha256(data));\r\n		request.addHeader(\'X-Amz-Target: GraniteServiceVersion20100801.GetMetricData\')\r\n		request.addHeader(\'Accept: application/json\');\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Content-Encoding: amz-1.0\');\r\n		request.addHeader(\'Authorization: \' + \'AWS4-HMAC-SHA256 Credential=\' + AWS.params.AccessKeyId + \'/\' + credential_scope + \', \' + \'SignedHeaders=\' + signed_headers + \', \' + \'Signature=\' + hmac(\'sha256\', key, request_string));\r\n		if (AWS.params.auth_type === \'role_base\' || (AWS.params.auth_type === \'assume_role\' & !params.includes(\'AssumeRole\'))) {\r\n			request.addHeader(\'X-Amz-Security-Token: \' + (AWS.params.auth_type === \'role_base\' ? AWS.params.Token : AWS.params.SessionToken));\r\n		}\r\n\r\n		Zabbix.log(4, \'[ AWS Lambda Get metrics ] Sending request: \' + url);\r\n		response = request.post(url, data);\r\n		Zabbix.log(4, \'[ AWS Lambda Get metrics ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n		if (request.getStatus() !== 200) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		return JSON.parse(response);\r\n	},\r\n\r\n	getMetricsData: function () {\r\n		var end_time = Math.floor((new Date().getTime()) / 1000),\r\n			start_time = end_time - AWS.request_period * 60;\r\n		payload = {\r\n			\'StartTime\': start_time,\r\n			\'EndTime\': end_time,\r\n			\'ScanBy\': \'TimestampDescending\',\r\n			\'MetricDataQueries\': AWS.renderMetricQuery(AWS.request_period, AWS.params.name)\r\n		};\r\n\r\n		return AWS.getField(AWS.request(\'POST\', AWS.params.region, \'monitoring\', \'\', payload), \'MetricDataResults\');\r\n	}\r\n};\r\n\r\ntry {\r\n	AWS.setParams(JSON.parse(value));\r\n	return JSON.stringify(AWS.getMetricsData());\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ AWS Lambda Get metrics ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get Lambda function metrics.\r\nFull metrics list related to the Lambda function: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html','0','7d','0','',NULL,'{$AWS.DATA.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','24c4972d090f4e72abc473752aac27d8','0','2','0'),
('47300','21','','10535','Lambda discovery','aws.lambda.discovery','12h','31d','365d','0','4','','','','',NULL,NULL,'var AWS = {\r\n	params: {},\r\n	metadata: \'http://169.254.169.254/latest/\',\r\n\r\n	getField: function (data, path) {\r\n		var steps = path.split(\'.\');\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n\r\n			data = data[step];\r\n		}\r\n\r\n		return data;\r\n	},\r\n\r\n	setParams: function (params) {\r\n		AWS.params[\'proxy\'] = params.proxy;\r\n		switch (AWS.getField(params, \'auth_type\')) {\r\n			case \'role_base\':\r\n				AWS.params[\'auth_type\'] = \'role_base\';\r\n				var request = new HttpRequest();\r\n				if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n					request.setProxy(AWS.params.proxy);\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token-ttl-seconds: 21600\');\r\n				var token = request.put(AWS.metadata + \'api/token\');\r\n\r\n				if (request.getStatus() !== 200 || token === null || token === \'\') {\r\n					throw \'Error getting IMDSv2 session token.\';\r\n				}\r\n				request.addHeader(\'X-aws-ec2-metadata-token: \' + token);\r\n				var IamRoleName = request.get(AWS.metadata + \'meta-data/iam/security-credentials\');\r\n\r\n				if (request.getStatus() !== 200 || IamRoleName === null || IamRoleName === \'\') {\r\n					throw \'Error getting security credentials from instance metadata. Role not found.\';\r\n				}\r\n\r\n				credentials = request.get(AWS.metadata + \'meta-data/iam/security-credentials/\' + encodeURI(IamRoleName));\r\n\r\n				if (request.getStatus() !== 200 || credentials === null || credentials === \'\') {\r\n					throw \'Error getting security credentials from instance metadata.\';\r\n				}\r\n\r\n				try {\r\n					credentials = JSON.parse(credentials);\r\n				}\r\n				catch (error) {\r\n					throw \'Failed to parse response received from instance metadata. Check debug log for more information.\';\r\n				}\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'Token\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			case \'assume_role\':\r\n				AWS.params[\'auth_type\'] = \'assume_role\';\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'sts_region\', \'role_arn\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n\r\n				role_arn_regex = /role\\/(.+)$/;\r\n\r\n				var payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': AWS.params.role_arn.match(role_arn_regex)[1] + \'Session\',\r\n				};\r\n\r\n				credentials = AWS.getField(AWS.request(\'GET\', AWS.params.sts_region, \'sts\', AWS.prepareParams(payload), \'\', \'\'), \'AssumeRoleResponse.AssumeRoleResult.Credentials\');\r\n\r\n				[\'AccessKeyId\', \'SecretAccessKey\', \'SessionToken\'].forEach(function (field) {\r\n					if (typeof credentials !== \'object\' || typeof credentials[field] === \'undefined\' || credentials[field] === \'\') {\r\n						throw \'Required credentials are not set: "\' + field + \'".\';\r\n					};\r\n					AWS.params[field] = credentials[field];\r\n				});\r\n				break;\r\n			default:\r\n				AWS.params[\'auth_type\'] = \'access_key\';\r\n				[\'AccessKeyId\', \'SecretAccessKey\'].forEach(function (field) {\r\n					if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n						throw \'Required param is not set: "\' + field + \'".\';\r\n					}\r\n					AWS.params[field] = params[field];\r\n				});\r\n		}\r\n		[\'describe_region\', \'region_match\', \'region_not_match\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: "\' + field + \'".\';\r\n			}\r\n			AWS.params[field] = params[field];\r\n		});\r\n	},\r\n\r\n	sign: function (key, message) {\r\n		var hex = hmac(\'sha256\', key, message);\r\n\r\n		if ((hex.length % 2) === 1) {\r\n			throw \'Invalid length of a hex string!\';\r\n		}\r\n\r\n		var result = new Int8Array(hex.length / 2);\r\n		for (var i = 0, b = 0; i < hex.length; i += 2, b++) {\r\n			result[b] = parseInt(hex.substring(i, i + 2), 16);\r\n		}\r\n\r\n		return result;\r\n	},\r\n\r\n	prepareParams: function (params) {\r\n		var result = [];\r\n\r\n		Object.keys(params).sort().forEach(function (key) {\r\n			if (typeof params[key] !== \'object\') {\r\n				result.push(key + \'=\' + encodeURIComponent(params[key]));\r\n			}\r\n			else {\r\n				result.push(prepareObject(key, params[key]));\r\n			}\r\n		});\r\n\r\n		return result.join(\'&\');\r\n	},\r\n\r\n	request: function (method, region, service, params, data, uri) {\r\n		if (typeof data === \'undefined\' || data === null) {\r\n			data = \'\';\r\n		}\r\n\r\n		var amzdate = (new Date()).toISOString().replace(/\\.\\d+Z/, \'Z\').replace(/[-:]/g, \'\'),\r\n			date = amzdate.replace(/T\\d+Z/, \'\'),\r\n			canonical_uri = \'/\' + uri,\r\n			host = service + \'.\' + region + \'.amazonaws.com\',\r\n			canonical_headers = \'content-encoding:amz-1.0\\n\' + \'host:\' + host + \'\\n\' + \'x-amz-date:\' + amzdate + \'\\n\',\r\n			signed_headers = \'content-encoding;host;x-amz-date\',\r\n			canonical_request = method + \'\\n\' + canonical_uri + \'\\n\' + params + \'\\n\' + canonical_headers + \'\\n\' + signed_headers + \'\\n\' + sha256(data),\r\n			credential_scope = date + \'/\' + region + \'/\' + service + \'/\' + \'aws4_request\',\r\n			request_string = \'AWS4-HMAC-SHA256\' + \'\\n\' + amzdate + \'\\n\' + credential_scope + \'\\n\' + sha256(canonical_request),\r\n			key = AWS.sign(\'AWS4\' + AWS.params.SecretAccessKey, date),\r\n			key = AWS.sign(key, region),\r\n			key = AWS.sign(key, service),\r\n			key = AWS.sign(key, \'aws4_request\'),\r\n			request = new HttpRequest(),\r\n			url = \'https://\' + host + canonical_uri + \'?\' + params;\r\n\r\n		if (typeof AWS.params.proxy !== \'undefined\' && AWS.params.proxy !== \'\') {\r\n			request.setProxy(AWS.params.proxy);\r\n		}\r\n		request.addHeader(\'x-amz-date: \' + amzdate);\r\n		request.addHeader(\'x-amz-content-sha256:\' + sha256(data));\r\n		request.addHeader(\'Accept: application/json\');\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Content-Encoding: amz-1.0\');\r\n		request.addHeader(\'Authorization: \' + \'AWS4-HMAC-SHA256 Credential=\' + AWS.params.AccessKeyId + \'/\' + credential_scope + \', \' + \'SignedHeaders=\' + signed_headers + \', \' + \'Signature=\' + hmac(\'sha256\', key, request_string));\r\n		if (AWS.params.auth_type === \'role_base\' || (AWS.params.auth_type === \'assume_role\' & !params.includes(\'AssumeRole\'))) {\r\n			request.addHeader(\'X-Amz-Security-Token: \' + (AWS.params.auth_type === \'role_base\' ? AWS.params.Token : AWS.params.SessionToken));\r\n		}\r\n\r\n		Zabbix.log(4, \'[ AWS Lambda ] Sending request: \' + url);\r\n		response = request.get(url);\r\n		Zabbix.log(4, \'[ AWS Lambda ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() !== 200) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			try {\r\n				response = JSON.parse(XML.toJson(response));\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from AWS API. Check debug log for more information.\';\r\n			}\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	listRegions: function () {\r\n		var payload = {\r\n			\'Action\': \'DescribeRegions\',\r\n			\'Version\': \'2016-11-15\'\r\n		};\r\n\r\n		regions = AWS.getField(AWS.request(\'GET\', AWS.params.describe_region, \'ec2\', AWS.prepareParams(payload), \'\', \'\'), \'DescribeRegionsResponse.regionInfo.item\');\r\n\r\n		if (!Array.isArray(regions))\r\n			regions = [regions]\r\n\r\n		return regions\r\n	},\r\n\r\n	listFunctions: function () {\r\n		var lldArray = [],\r\n			regions = AWS.listRegions();\r\n		payload = {\r\n			\'FunctionVersion\': \'ALL\',\r\n			\'MaxItems\': \'10000\'\r\n		};\r\n\r\n		regions.forEach(function (region) {\r\n			var region_name = AWS.getField(region, \'regionName\');\r\n			if (region_name.match(AWS.params.region_match) === null ||\r\n				region_name.match(AWS.params.region_not_match) !== null)\r\n				return;\r\n			lambdaFunction = AWS.getField(AWS.request(\'GET\', region_name, \'lambda\', AWS.prepareParams(payload), \'\', \'2015-03-31/functions\'), \'Functions\');\r\n			if (!Array.isArray(lambdaFunction))\r\n				lambdaFunction = [lambdaFunction]\r\n\r\n			lambdaFunction.forEach(function (lambdaFunction) {\r\n				lldArray.push(\r\n					{\r\n						name: AWS.getField(lambdaFunction, \'FunctionName\'),\r\n						arn: AWS.getField(lambdaFunction, \'FunctionArn\'),\r\n						runtime: AWS.getField(lambdaFunction, \'Runtime\'),\r\n						version: AWS.getField(lambdaFunction, \'Version\'),\r\n						region: region_name\r\n					}\r\n				)\r\n			});\r\n		});\r\n\r\n		return lldArray;\r\n	}\r\n};\r\n\r\ntry {\r\n	AWS.setParams(JSON.parse(value));\r\n\r\n	return JSON.stringify(AWS.listFunctions());\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ AWS Lambda ] ERROR: \' + error);\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','1',NULL,'Get Lambda functions.','0','7d','1','',NULL,'{$AWS.DATA.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','691d96408dbc4c5c9235932cdbe70648','0','2','0'),
('47301','21','','10634','Get branches','github.repo.branches.get','{$GITHUB.INTERVAL:"get_branches"}','0','0','0','4','','','','',NULL,NULL,'var github = {\r\n	params: {},\r\n\r\n	setParams: function (params, required) {\r\n		required = required || [];\r\n		required.concat([\'api_url\', \'user_agent\', \'api_version\', \'repo_owner\', \'repo_name\', \'pagination_required\', \'api_token\']).forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\'\r\n				|| params[field] === \'\') {\r\n				throw \'Required parameter is not set: "\' + field + \'".\';\r\n			}\r\n		});\r\n\r\n		github.params = params;\r\n\r\n		if (typeof github.params.api_url === \'string\' && !github.params.api_url.endsWith(\'/\')) {\r\n			github.params.api_url += \'/\';\r\n		}\r\n	},\r\n\r\n	apiRequest: function (url, pagination_required) {\r\n		const next_pattern = /<([^>]+)>;\\s*rel="next"/i;\r\n		var request = new HttpRequest(),\r\n			response,\r\n			headers,\r\n			final_data = {\r\n				headers: {},\r\n				data: []\r\n			};\r\n\r\n		pagination_required = (typeof pagination_required !== \'undefined\') ? pagination_required : \'true\';\r\n\r\n		request.addHeader(\'User-Agent: \' + github.params.user_agent);\r\n		request.addHeader(\'Accept: application/vnd.github+json\');\r\n		request.addHeader(\'X-GitHub-Api-Version: \' + github.params.api_version);\r\n		request.addHeader(\'Authorization: Bearer \' + github.params.api_token);\r\n\r\n		if (typeof github.params.http_proxy !== \'undefined\' && github.params.http_proxy !== \'\') {\r\n			request.setProxy(github.params.http_proxy);\r\n			Zabbix.log(4, \'[ GitHub Repo ] Using HTTP proxy: \' + github.params.http_proxy);\r\n		}\r\n\r\n		while (url) {\r\n			Zabbix.log(4, \'[ GitHub Repo ] Sending request: \' + url);\r\n\r\n			response = request.get(url);\r\n\r\n			Zabbix.log(4, \'[ GitHub Repo ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n			if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n				throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n			}\r\n\r\n			try {\r\n				response = JSON.parse(response);\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from API. Check debug log for more information.\';\r\n			}\r\n\r\n			var parsed_data = github.parseData(response);\r\n			final_data.data = final_data.data.concat(parsed_data);\r\n\r\n			headers = request.getHeaders();\r\n\r\n			url = ((headers.link || \'\').match(next_pattern) || [])[1];\r\n\r\n			if (pagination_required === \'false\') {\r\n				url = \'\';\r\n			}\r\n		}\r\n\r\n		final_data.headers = request.getHeaders();\r\n\r\n		delete request;\r\n\r\n		return final_data;\r\n	},\r\n\r\n	parseData: function (response_data) {\r\n		if (!response_data) {\r\n			return [];\r\n		}\r\n\r\n		const normalization_required = "total_count" in response_data && !("url" in response_data);\r\n		if (!normalization_required) return response_data;\r\n\r\n		delete response_data.incomplete_results;\r\n		delete response_data.repository_selection;\r\n		delete response_data.total_count;\r\n\r\n		const namespaceKey = Object.keys(response_data)[0];\r\n		response_data = response_data[namespaceKey];\r\n\r\n		return response_data;\r\n	},\r\n\r\n	itemsCount: function (response_data) {\r\n		const last_page_number = /<[^>]+page=(\\d+)>;\\s*rel="last"/i;\r\n\r\n		if (response_data.headers.link){\r\n			return response_data.headers.link.match(last_page_number)[1];\r\n		}\r\n\r\n		return response_data.data.length;\r\n	}\r\n}\r\n\r\ntry {\r\n	github.setParams(JSON.parse(value), [\'api_query\']);\r\n\r\n	var result = github.apiRequest(github.params.api_url + github.params.api_query + \'?\' + github.params.query_params || \'\', github.params.pagination_required);\r\n\r\n	return JSON.stringify(result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ GitHub Repo ] ERROR: \' + error);\r\n	return JSON.stringify({ error: error });\r\n}','','0','','','','','0',NULL,'Get the repository branches.\r\n\r\nInformation about endpoint:\r\nhttps://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28#list-branches','0','7d','0','',NULL,'{$GITHUB.TIMEOUT:"get_branches"}','','','','200','1','0','','','0','0','0','0','0','0','0','e348ae4bd2c04b5c88df2f5cb422eb61','0','2','0'),
('47302','21','','10634','Get issue count','github.repo.issues.get','{$GITHUB.INTERVAL:"get_issues_count"}','0','0','0','4','','','','',NULL,NULL,'var github = {\r\n	params: {},\r\n\r\n	setParams: function (params, required) {\r\n		required = required || [];\r\n		required.concat([\'api_url\', \'user_agent\', \'api_version\', \'repo_owner\', \'repo_name\', \'pagination_required\', \'api_token\']).forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\'\r\n				|| params[field] === \'\') {\r\n				throw \'Required parameter is not set: "\' + field + \'".\';\r\n			}\r\n		});\r\n\r\n		github.params = params;\r\n\r\n		if (typeof github.params.api_url === \'string\' && !github.params.api_url.endsWith(\'/\')) {\r\n			github.params.api_url += \'/\';\r\n		}\r\n	},\r\n\r\n	apiRequest: function (url, pagination_required) {\r\n		const next_pattern = /<([^>]+)>;\\s*rel="next"/i;\r\n		var request = new HttpRequest(),\r\n			response,\r\n			headers,\r\n			final_data = {\r\n				headers: {},\r\n				data: []\r\n			};\r\n\r\n		pagination_required = (typeof pagination_required !== \'undefined\') ? pagination_required : \'true\';\r\n\r\n		request.addHeader(\'User-Agent: \' + github.params.user_agent);\r\n		request.addHeader(\'Accept: application/vnd.github+json\');\r\n		request.addHeader(\'X-GitHub-Api-Version: \' + github.params.api_version);\r\n		request.addHeader(\'Authorization: Bearer \' + github.params.api_token);\r\n\r\n		if (typeof github.params.http_proxy !== \'undefined\' && github.params.http_proxy !== \'\') {\r\n			request.setProxy(github.params.http_proxy);\r\n			Zabbix.log(4, \'[ GitHub Repo ] Using HTTP proxy: \' + github.params.http_proxy);\r\n		}\r\n\r\n		while (url) {\r\n			Zabbix.log(4, \'[ GitHub Repo ] Sending request: \' + url);\r\n\r\n			response = request.get(url);\r\n\r\n			Zabbix.log(4, \'[ GitHub Repo ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n			if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n				throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n			}\r\n\r\n			try {\r\n				response = JSON.parse(response);\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from API. Check debug log for more information.\';\r\n			}\r\n\r\n			var parsed_data = github.parseData(response);\r\n			final_data.data = final_data.data.concat(parsed_data);\r\n\r\n			headers = request.getHeaders();\r\n\r\n			url = ((headers.link || \'\').match(next_pattern) || [])[1];\r\n\r\n			if (pagination_required === \'false\') {\r\n				url = \'\';\r\n			}\r\n		}\r\n\r\n		final_data.headers = request.getHeaders();\r\n\r\n		delete request;\r\n\r\n		return final_data;\r\n	},\r\n\r\n	parseData: function (response_data) {\r\n		if (!response_data) {\r\n			return [];\r\n		}\r\n\r\n		const normalization_required = "total_count" in response_data && !("url" in response_data);\r\n		if (!normalization_required) return response_data;\r\n\r\n		delete response_data.incomplete_results;\r\n		delete response_data.repository_selection;\r\n		delete response_data.total_count;\r\n\r\n		const namespaceKey = Object.keys(response_data)[0];\r\n		response_data = response_data[namespaceKey];\r\n\r\n		return response_data;\r\n	},\r\n\r\n	itemsCount: function (response_data) {\r\n		const last_page_number = /<[^>]+page=(\\d+)>;\\s*rel="last"/i;\r\n\r\n		if (response_data.headers.link){\r\n			return response_data.headers.link.match(last_page_number)[1];\r\n		}\r\n\r\n		return response_data.data.length;\r\n	}\r\n}\r\n\r\ntry {\r\n	github.setParams(JSON.parse(value));\r\n\r\n	var issues_count,\r\n		issues_count_result = {\r\n			issues: {\r\n				total: 0,\r\n				open: 0,\r\n				closed: 0\r\n			},\r\n			pr: {\r\n				total: 0,\r\n				open: 0,\r\n				closed: 0\r\n			}\r\n		};\r\n\r\n	issues_count = github.apiRequest(github.params.api_url + \'repos/\' + github.params.repo_owner + \'/\' + github.params.repo_name + \'/pulls?state=all&per_page=1\', github.params.pagination_required);\r\n	issues_count_result.pr.total = github.itemsCount(issues_count);\r\n\r\n	issues_count = github.apiRequest(github.params.api_url + \'repos/\' + github.params.repo_owner + \'/\' + github.params.repo_name + \'/pulls?state=open&per_page=1\', github.params.pagination_required);\r\n	issues_count_result.pr.open = github.itemsCount(issues_count);\r\n\r\n	issues_count_result.pr.closed = issues_count_result.pr.total - issues_count_result.pr.open;\r\n\r\n\r\n	issues_count = github.apiRequest(github.params.api_url + \'repos/\' + github.params.repo_owner + \'/\' + github.params.repo_name + \'/issues?state=all&per_page=1\', github.params.pagination_required);\r\n	issues_count_result.issues.total = github.itemsCount(issues_count) - issues_count_result.pr.total;\r\n\r\n	issues_count = github.apiRequest(github.params.api_url + \'repos/\' + github.params.repo_owner + \'/\' + github.params.repo_name + \'/issues?state=open&per_page=1\', github.params.pagination_required);\r\n	issues_count_result.issues.open = github.itemsCount(issues_count) - issues_count_result.pr.open;\r\n\r\n	issues_count_result.issues.closed = issues_count_result.issues.total - issues_count_result.issues.open;\r\n\r\n	return JSON.stringify(issues_count_result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ GitHub Repo ] ERROR: \' + error);\r\n	return JSON.stringify({ error: error });\r\n}','','0','','','','','0',NULL,'Get the count of issues and pull requests in the repository (total, open, closed).\r\n\r\nInformation about endpoint for issues:\r\nhttps://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues\r\n\r\nInformation about endpoint for pull requests:\r\nhttps://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests','0','7d','0','',NULL,'{$GITHUB.TIMEOUT:"get_issues_count"}','','','','200','1','0','','','0','0','0','0','0','0','0','f88f02dc593844a89eb601e833a1a19c','0','2','0'),
('47303','21','','10634','Number of releases','github.repo.releases.count','{$GITHUB.INTERVAL:"get_releases_count"}','31d','365d','0','3','','','','',NULL,NULL,'var github = {\r\n	params: {},\r\n\r\n	setParams: function (params, required) {\r\n		required = required || [];\r\n		required.concat([\'api_url\', \'user_agent\', \'api_version\', \'repo_owner\', \'repo_name\', \'pagination_required\', \'api_token\']).forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\'\r\n				|| params[field] === \'\') {\r\n				throw \'Required parameter is not set: "\' + field + \'".\';\r\n			}\r\n		});\r\n\r\n		github.params = params;\r\n\r\n		if (typeof github.params.api_url === \'string\' && !github.params.api_url.endsWith(\'/\')) {\r\n			github.params.api_url += \'/\';\r\n		}\r\n	},\r\n\r\n	apiRequest: function (url, pagination_required) {\r\n		const next_pattern = /<([^>]+)>;\\s*rel="next"/i;\r\n		var request = new HttpRequest(),\r\n			response,\r\n			headers,\r\n			final_data = {\r\n				headers: {},\r\n				data: []\r\n			};\r\n\r\n		pagination_required = (typeof pagination_required !== \'undefined\') ? pagination_required : \'true\';\r\n\r\n		request.addHeader(\'User-Agent: \' + github.params.user_agent);\r\n		request.addHeader(\'Accept: application/vnd.github+json\');\r\n		request.addHeader(\'X-GitHub-Api-Version: \' + github.params.api_version);\r\n		request.addHeader(\'Authorization: Bearer \' + github.params.api_token);\r\n\r\n		if (typeof github.params.http_proxy !== \'undefined\' && github.params.http_proxy !== \'\') {\r\n			request.setProxy(github.params.http_proxy);\r\n			Zabbix.log(4, \'[ GitHub Repo ] Using HTTP proxy: \' + github.params.http_proxy);\r\n		}\r\n\r\n		while (url) {\r\n			Zabbix.log(4, \'[ GitHub Repo ] Sending request: \' + url);\r\n\r\n			response = request.get(url);\r\n\r\n			Zabbix.log(4, \'[ GitHub Repo ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n			if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n				throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n			}\r\n\r\n			try {\r\n				response = JSON.parse(response);\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from API. Check debug log for more information.\';\r\n			}\r\n\r\n			var parsed_data = github.parseData(response);\r\n			final_data.data = final_data.data.concat(parsed_data);\r\n\r\n			headers = request.getHeaders();\r\n\r\n			url = ((headers.link || \'\').match(next_pattern) || [])[1];\r\n\r\n			if (pagination_required === \'false\') {\r\n				url = \'\';\r\n			}\r\n		}\r\n\r\n		final_data.headers = request.getHeaders();\r\n\r\n		delete request;\r\n\r\n		return final_data;\r\n	},\r\n\r\n	parseData: function (response_data) {\r\n		if (!response_data) {\r\n			return [];\r\n		}\r\n\r\n		const normalization_required = "total_count" in response_data && !("url" in response_data);\r\n		if (!normalization_required) return response_data;\r\n\r\n		delete response_data.incomplete_results;\r\n		delete response_data.repository_selection;\r\n		delete response_data.total_count;\r\n\r\n		const namespaceKey = Object.keys(response_data)[0];\r\n		response_data = response_data[namespaceKey];\r\n\r\n		return response_data;\r\n	},\r\n\r\n	itemsCount: function (response_data) {\r\n		const last_page_number = /<[^>]+page=(\\d+)>;\\s*rel="last"/i;\r\n\r\n		if (response_data.headers.link){\r\n			return response_data.headers.link.match(last_page_number)[1];\r\n		}\r\n\r\n		return response_data.data.length;\r\n	}\r\n}\r\n\r\ntry {\r\n	github.setParams(JSON.parse(value), [\'api_query\']);\r\n\r\n	var result = github.apiRequest(github.params.api_url + github.params.api_query + \'?\' + github.params.query_params || \'\', github.params.pagination_required);\r\n\r\n	return github.itemsCount(result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ GitHub Repo ] ERROR: \' + error);\r\n	return JSON.stringify({ error: error });\r\n}','','0','','','','','0',NULL,'The number of releases in the repository. Note that this number also includes draft releases.\r\n\r\nInformation about endpoint:\r\nhttps://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#list-releases','0','7d','0','',NULL,'{$GITHUB.TIMEOUT:"get_releases_count"}','','','','200','1','0','','','0','0','0','0','0','0','0','0098bfc3ed5c4181a7dcd1eceb8e7251','0','2','0'),
('47304','21','','10634','Get repository','github.repo.repository.get','{$GITHUB.INTERVAL:"get_repo"}','0','0','0','4','','','','',NULL,NULL,'var github = {\r\n	params: {},\r\n\r\n	setParams: function (params, required) {\r\n		required = required || [];\r\n		required.concat([\'api_url\', \'user_agent\', \'api_version\', \'repo_owner\', \'repo_name\', \'pagination_required\', \'api_token\']).forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\'\r\n				|| params[field] === \'\') {\r\n				throw \'Required parameter is not set: "\' + field + \'".\';\r\n			}\r\n		});\r\n\r\n		github.params = params;\r\n\r\n		if (typeof github.params.api_url === \'string\' && !github.params.api_url.endsWith(\'/\')) {\r\n			github.params.api_url += \'/\';\r\n		}\r\n	},\r\n\r\n	apiRequest: function (url, pagination_required) {\r\n		const next_pattern = /<([^>]+)>;\\s*rel="next"/i;\r\n		var request = new HttpRequest(),\r\n			response,\r\n			headers,\r\n			final_data = {\r\n				headers: {},\r\n				data: []\r\n			};\r\n\r\n		pagination_required = (typeof pagination_required !== \'undefined\') ? pagination_required : \'true\';\r\n\r\n		request.addHeader(\'User-Agent: \' + github.params.user_agent);\r\n		request.addHeader(\'Accept: application/vnd.github+json\');\r\n		request.addHeader(\'X-GitHub-Api-Version: \' + github.params.api_version);\r\n		request.addHeader(\'Authorization: Bearer \' + github.params.api_token);\r\n\r\n		if (typeof github.params.http_proxy !== \'undefined\' && github.params.http_proxy !== \'\') {\r\n			request.setProxy(github.params.http_proxy);\r\n			Zabbix.log(4, \'[ GitHub Repo ] Using HTTP proxy: \' + github.params.http_proxy);\r\n		}\r\n\r\n		while (url) {\r\n			Zabbix.log(4, \'[ GitHub Repo ] Sending request: \' + url);\r\n\r\n			response = request.get(url);\r\n\r\n			Zabbix.log(4, \'[ GitHub Repo ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n			if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n				throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n			}\r\n\r\n			try {\r\n				response = JSON.parse(response);\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from API. Check debug log for more information.\';\r\n			}\r\n\r\n			var parsed_data = github.parseData(response);\r\n			final_data.data = final_data.data.concat(parsed_data);\r\n\r\n			headers = request.getHeaders();\r\n\r\n			url = ((headers.link || \'\').match(next_pattern) || [])[1];\r\n\r\n			if (pagination_required === \'false\') {\r\n				url = \'\';\r\n			}\r\n		}\r\n\r\n		final_data.headers = request.getHeaders();\r\n\r\n		delete request;\r\n\r\n		return final_data;\r\n	},\r\n\r\n	parseData: function (response_data) {\r\n		if (!response_data) {\r\n			return [];\r\n		}\r\n\r\n		const normalization_required = "total_count" in response_data && !("url" in response_data);\r\n		if (!normalization_required) return response_data;\r\n\r\n		delete response_data.incomplete_results;\r\n		delete response_data.repository_selection;\r\n		delete response_data.total_count;\r\n\r\n		const namespaceKey = Object.keys(response_data)[0];\r\n		response_data = response_data[namespaceKey];\r\n\r\n		return response_data;\r\n	},\r\n\r\n	itemsCount: function (response_data) {\r\n		const last_page_number = /<[^>]+page=(\\d+)>;\\s*rel="last"/i;\r\n\r\n		if (response_data.headers.link){\r\n			return response_data.headers.link.match(last_page_number)[1];\r\n		}\r\n\r\n		return response_data.data.length;\r\n	}\r\n}\r\n\r\ntry {\r\n	github.setParams(JSON.parse(value), [\'api_query\']);\r\n\r\n	var repo_data = github.apiRequest(github.params.api_url + github.params.api_query);\r\n\r\n	if (repo_data.data[0].fork === false) {\r\n		var repo_community_profile = github.apiRequest(github.params.api_url + github.params.api_query + \'/community/profile\');\r\n\r\n		repo_data.data[0].zbx_community_profile = repo_community_profile.data[0];\r\n	}\r\n\r\n	return JSON.stringify(repo_data);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ GitHub Repo ] ERROR: \' + error);\r\n	return JSON.stringify({ error: error });\r\n}','','0','','','','','0',NULL,'Get the general repository information. If the repository is not a fork, the community profile metrics are also retrieved.\r\n\r\nInformation about endpoint:\r\nhttps://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository\r\n\r\nInformation about community profile metrics:\r\nhttps://docs.github.com/en/rest/metrics/community?apiVersion=2022-11-28#get-community-profile-metrics','0','7d','0','',NULL,'{$GITHUB.TIMEOUT:"get_repo"}','','','','200','1','0','','','0','0','0','0','0','0','0','37e94a93bf924d84bb6609eec47ff081','0','2','0'),
('47305','21','','10634','Get self-hosted runners','github.repo.runners.get','{$GITHUB.INTERVAL:"get_runners"}','0','0','0','4','','','','',NULL,NULL,'var github = {\r\n	params: {},\r\n\r\n	setParams: function (params, required) {\r\n		required = required || [];\r\n		required.concat([\'api_url\', \'user_agent\', \'api_version\', \'repo_owner\', \'repo_name\', \'pagination_required\', \'api_token\']).forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\'\r\n				|| params[field] === \'\') {\r\n				throw \'Required parameter is not set: "\' + field + \'".\';\r\n			}\r\n		});\r\n\r\n		github.params = params;\r\n\r\n		if (typeof github.params.api_url === \'string\' && !github.params.api_url.endsWith(\'/\')) {\r\n			github.params.api_url += \'/\';\r\n		}\r\n	},\r\n\r\n	apiRequest: function (url, pagination_required) {\r\n		const next_pattern = /<([^>]+)>;\\s*rel="next"/i;\r\n		var request = new HttpRequest(),\r\n			response,\r\n			headers,\r\n			final_data = {\r\n				headers: {},\r\n				data: []\r\n			};\r\n\r\n		pagination_required = (typeof pagination_required !== \'undefined\') ? pagination_required : \'true\';\r\n\r\n		request.addHeader(\'User-Agent: \' + github.params.user_agent);\r\n		request.addHeader(\'Accept: application/vnd.github+json\');\r\n		request.addHeader(\'X-GitHub-Api-Version: \' + github.params.api_version);\r\n		request.addHeader(\'Authorization: Bearer \' + github.params.api_token);\r\n\r\n		if (typeof github.params.http_proxy !== \'undefined\' && github.params.http_proxy !== \'\') {\r\n			request.setProxy(github.params.http_proxy);\r\n			Zabbix.log(4, \'[ GitHub Repo ] Using HTTP proxy: \' + github.params.http_proxy);\r\n		}\r\n\r\n		while (url) {\r\n			Zabbix.log(4, \'[ GitHub Repo ] Sending request: \' + url);\r\n\r\n			response = request.get(url);\r\n\r\n			Zabbix.log(4, \'[ GitHub Repo ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n			if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n				throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n			}\r\n\r\n			try {\r\n				response = JSON.parse(response);\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from API. Check debug log for more information.\';\r\n			}\r\n\r\n			var parsed_data = github.parseData(response);\r\n			final_data.data = final_data.data.concat(parsed_data);\r\n\r\n			headers = request.getHeaders();\r\n\r\n			url = ((headers.link || \'\').match(next_pattern) || [])[1];\r\n\r\n			if (pagination_required === \'false\') {\r\n				url = \'\';\r\n			}\r\n		}\r\n\r\n		final_data.headers = request.getHeaders();\r\n\r\n		delete request;\r\n\r\n		return final_data;\r\n	},\r\n\r\n	parseData: function (response_data) {\r\n		if (!response_data) {\r\n			return [];\r\n		}\r\n\r\n		const normalization_required = "total_count" in response_data && !("url" in response_data);\r\n		if (!normalization_required) return response_data;\r\n\r\n		delete response_data.incomplete_results;\r\n		delete response_data.repository_selection;\r\n		delete response_data.total_count;\r\n\r\n		const namespaceKey = Object.keys(response_data)[0];\r\n		response_data = response_data[namespaceKey];\r\n\r\n		return response_data;\r\n	},\r\n\r\n	itemsCount: function (response_data) {\r\n		const last_page_number = /<[^>]+page=(\\d+)>;\\s*rel="last"/i;\r\n\r\n		if (response_data.headers.link){\r\n			return response_data.headers.link.match(last_page_number)[1];\r\n		}\r\n\r\n		return response_data.data.length;\r\n	}\r\n}\r\n\r\ntry {\r\n	github.setParams(JSON.parse(value), [\'api_query\']);\r\n\r\n	var result = github.apiRequest(github.params.api_url + github.params.api_query + \'?\' + github.params.query_params || \'\', github.params.pagination_required);\r\n\r\n	return JSON.stringify(result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ GitHub Repo ] ERROR: \' + error);\r\n	return JSON.stringify({ error: error });\r\n}','','0','','','','','0',NULL,'Get the self-hosted runners of the repository.\r\n\r\nNote that admin access to the repository is required to use this endpoint:\r\nhttps://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository','0','7d','0','',NULL,'{$GITHUB.TIMEOUT:"get_runners"}','','','','200','1','0','','','0','0','0','0','0','0','0','a0ca909d3c734d859594771985a5c302','0','2','0'),
('47306','21','','10634','Number of tags','github.repo.tags.count','{$GITHUB.INTERVAL:"get_tags_count"}','31d','365d','0','3','','','','',NULL,NULL,'var github = {\r\n	params: {},\r\n\r\n	setParams: function (params, required) {\r\n		required = required || [];\r\n		required.concat([\'api_url\', \'user_agent\', \'api_version\', \'repo_owner\', \'repo_name\', \'pagination_required\', \'api_token\']).forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\'\r\n				|| params[field] === \'\') {\r\n				throw \'Required parameter is not set: "\' + field + \'".\';\r\n			}\r\n		});\r\n\r\n		github.params = params;\r\n\r\n		if (typeof github.params.api_url === \'string\' && !github.params.api_url.endsWith(\'/\')) {\r\n			github.params.api_url += \'/\';\r\n		}\r\n	},\r\n\r\n	apiRequest: function (url, pagination_required) {\r\n		const next_pattern = /<([^>]+)>;\\s*rel="next"/i;\r\n		var request = new HttpRequest(),\r\n			response,\r\n			headers,\r\n			final_data = {\r\n				headers: {},\r\n				data: []\r\n			};\r\n\r\n		pagination_required = (typeof pagination_required !== \'undefined\') ? pagination_required : \'true\';\r\n\r\n		request.addHeader(\'User-Agent: \' + github.params.user_agent);\r\n		request.addHeader(\'Accept: application/vnd.github+json\');\r\n		request.addHeader(\'X-GitHub-Api-Version: \' + github.params.api_version);\r\n		request.addHeader(\'Authorization: Bearer \' + github.params.api_token);\r\n\r\n		if (typeof github.params.http_proxy !== \'undefined\' && github.params.http_proxy !== \'\') {\r\n			request.setProxy(github.params.http_proxy);\r\n			Zabbix.log(4, \'[ GitHub Repo ] Using HTTP proxy: \' + github.params.http_proxy);\r\n		}\r\n\r\n		while (url) {\r\n			Zabbix.log(4, \'[ GitHub Repo ] Sending request: \' + url);\r\n\r\n			response = request.get(url);\r\n\r\n			Zabbix.log(4, \'[ GitHub Repo ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n			if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n				throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n			}\r\n\r\n			try {\r\n				response = JSON.parse(response);\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from API. Check debug log for more information.\';\r\n			}\r\n\r\n			var parsed_data = github.parseData(response);\r\n			final_data.data = final_data.data.concat(parsed_data);\r\n\r\n			headers = request.getHeaders();\r\n\r\n			url = ((headers.link || \'\').match(next_pattern) || [])[1];\r\n\r\n			if (pagination_required === \'false\') {\r\n				url = \'\';\r\n			}\r\n		}\r\n\r\n		final_data.headers = request.getHeaders();\r\n\r\n		delete request;\r\n\r\n		return final_data;\r\n	},\r\n\r\n	parseData: function (response_data) {\r\n		if (!response_data) {\r\n			return [];\r\n		}\r\n\r\n		const normalization_required = "total_count" in response_data && !("url" in response_data);\r\n		if (!normalization_required) return response_data;\r\n\r\n		delete response_data.incomplete_results;\r\n		delete response_data.repository_selection;\r\n		delete response_data.total_count;\r\n\r\n		const namespaceKey = Object.keys(response_data)[0];\r\n		response_data = response_data[namespaceKey];\r\n\r\n		return response_data;\r\n	},\r\n\r\n	itemsCount: function (response_data) {\r\n		const last_page_number = /<[^>]+page=(\\d+)>;\\s*rel="last"/i;\r\n\r\n		if (response_data.headers.link){\r\n			return response_data.headers.link.match(last_page_number)[1];\r\n		}\r\n\r\n		return response_data.data.length;\r\n	}\r\n}\r\n\r\ntry {\r\n	github.setParams(JSON.parse(value), [\'api_query\']);\r\n\r\n	var result = github.apiRequest(github.params.api_url + github.params.api_query + \'?\' + github.params.query_params || \'\', github.params.pagination_required);\r\n\r\n	return github.itemsCount(result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ GitHub Repo ] ERROR: \' + error);\r\n	return JSON.stringify({ error: error });\r\n}','','0','','','','','0',NULL,'The number of tags in the repository.\r\n\r\nInformation about endpoint:\r\nhttps://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repository-tags','0','7d','0','',NULL,'{$GITHUB.TIMEOUT:"get_tags_count"}','','','','200','1','0','','','0','0','0','0','0','0','0','49d81fc72a6a455ebee7304592056930','0','2','0'),
('47307','21','','10634','Get workflows','github.repo.workflows.get','{$GITHUB.INTERVAL:"get_workflows"}','0','0','0','4','','','','',NULL,NULL,'var github = {\r\n	params: {},\r\n\r\n	setParams: function (params, required) {\r\n		required = required || [];\r\n		required.concat([\'api_url\', \'user_agent\', \'api_version\', \'repo_owner\', \'repo_name\', \'pagination_required\', \'api_token\']).forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\'\r\n				|| params[field] === \'\') {\r\n				throw \'Required parameter is not set: "\' + field + \'".\';\r\n			}\r\n		});\r\n\r\n		github.params = params;\r\n\r\n		if (typeof github.params.api_url === \'string\' && !github.params.api_url.endsWith(\'/\')) {\r\n			github.params.api_url += \'/\';\r\n		}\r\n	},\r\n\r\n	apiRequest: function (url, pagination_required) {\r\n		const next_pattern = /<([^>]+)>;\\s*rel="next"/i;\r\n		var request = new HttpRequest(),\r\n			response,\r\n			headers,\r\n			final_data = {\r\n				headers: {},\r\n				data: []\r\n			};\r\n\r\n		pagination_required = (typeof pagination_required !== \'undefined\') ? pagination_required : \'true\';\r\n\r\n		request.addHeader(\'User-Agent: \' + github.params.user_agent);\r\n		request.addHeader(\'Accept: application/vnd.github+json\');\r\n		request.addHeader(\'X-GitHub-Api-Version: \' + github.params.api_version);\r\n		request.addHeader(\'Authorization: Bearer \' + github.params.api_token);\r\n\r\n		if (typeof github.params.http_proxy !== \'undefined\' && github.params.http_proxy !== \'\') {\r\n			request.setProxy(github.params.http_proxy);\r\n			Zabbix.log(4, \'[ GitHub Repo ] Using HTTP proxy: \' + github.params.http_proxy);\r\n		}\r\n\r\n		while (url) {\r\n			Zabbix.log(4, \'[ GitHub Repo ] Sending request: \' + url);\r\n\r\n			response = request.get(url);\r\n\r\n			Zabbix.log(4, \'[ GitHub Repo ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n			if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n				throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n			}\r\n\r\n			try {\r\n				response = JSON.parse(response);\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from API. Check debug log for more information.\';\r\n			}\r\n\r\n			var parsed_data = github.parseData(response);\r\n			final_data.data = final_data.data.concat(parsed_data);\r\n\r\n			headers = request.getHeaders();\r\n\r\n			url = ((headers.link || \'\').match(next_pattern) || [])[1];\r\n\r\n			if (pagination_required === \'false\') {\r\n				url = \'\';\r\n			}\r\n		}\r\n\r\n		final_data.headers = request.getHeaders();\r\n\r\n		delete request;\r\n\r\n		return final_data;\r\n	},\r\n\r\n	parseData: function (response_data) {\r\n		if (!response_data) {\r\n			return [];\r\n		}\r\n\r\n		const normalization_required = "total_count" in response_data && !("url" in response_data);\r\n		if (!normalization_required) return response_data;\r\n\r\n		delete response_data.incomplete_results;\r\n		delete response_data.repository_selection;\r\n		delete response_data.total_count;\r\n\r\n		const namespaceKey = Object.keys(response_data)[0];\r\n		response_data = response_data[namespaceKey];\r\n\r\n		return response_data;\r\n	},\r\n\r\n	itemsCount: function (response_data) {\r\n		const last_page_number = /<[^>]+page=(\\d+)>;\\s*rel="last"/i;\r\n\r\n		if (response_data.headers.link){\r\n			return response_data.headers.link.match(last_page_number)[1];\r\n		}\r\n\r\n		return response_data.data.length;\r\n	}\r\n}\r\n\r\ntry {\r\n	github.setParams(JSON.parse(value), [\'api_query\']);\r\n\r\n	var repo_data = github.apiRequest(github.params.api_url + github.params.api_query);\r\n\r\n	if (repo_data.data[0].fork === false) {\r\n		var repo_community_profile = github.apiRequest(github.params.api_url + github.params.api_query + \'/community/profile\');\r\n\r\n		repo_data.data[0].zbx_community_profile = repo_community_profile.data[0];\r\n	}\r\n\r\n	return JSON.stringify(repo_data);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ GitHub Repo ] ERROR: \' + error);\r\n	return JSON.stringify({ error: error });\r\n}','','0','','','','','0',NULL,'Get the repository workflows.\r\n\r\nInformation about endpoint:\r\nhttps://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#list-repository-workflows','0','7d','0','',NULL,'{$GITHUB.TIMEOUT:"get_workflows"}','','','','200','1','0','','','0','0','0','0','0','0','0','d45dbcb0493d4258ac2cdba10648b3b3','0','2','0'),
('47328','21','','10634','Branch [{#BRANCH_NAME}]: Number of commits','github.repo.branches.commits.total[{#BRANCH_NAME}]','{$GITHUB.INTERVAL:"get_commits_count:{#BRANCH_NAME}"}','31d','365d','0','3','','','','',NULL,NULL,'var github = {\r\n	params: {},\r\n\r\n	setParams: function (params, required) {\r\n		required = required || [];\r\n		required.concat([\'api_url\', \'user_agent\', \'api_version\', \'repo_owner\', \'repo_name\', \'pagination_required\', \'api_token\']).forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\'\r\n				|| params[field] === \'\') {\r\n				throw \'Required parameter is not set: "\' + field + \'".\';\r\n			}\r\n		});\r\n\r\n		github.params = params;\r\n\r\n		if (typeof github.params.api_url === \'string\' && !github.params.api_url.endsWith(\'/\')) {\r\n			github.params.api_url += \'/\';\r\n		}\r\n	},\r\n\r\n	apiRequest: function (url, pagination_required) {\r\n		const next_pattern = /<([^>]+)>;\\s*rel="next"/i;\r\n		var request = new HttpRequest(),\r\n			response,\r\n			headers,\r\n			final_data = {\r\n				headers: {},\r\n				data: []\r\n			};\r\n\r\n		pagination_required = (typeof pagination_required !== \'undefined\') ? pagination_required : \'true\';\r\n\r\n		request.addHeader(\'User-Agent: \' + github.params.user_agent);\r\n		request.addHeader(\'Accept: application/vnd.github+json\');\r\n		request.addHeader(\'X-GitHub-Api-Version: \' + github.params.api_version);\r\n		request.addHeader(\'Authorization: Bearer \' + github.params.api_token);\r\n\r\n		if (typeof github.params.http_proxy !== \'undefined\' && github.params.http_proxy !== \'\') {\r\n			request.setProxy(github.params.http_proxy);\r\n			Zabbix.log(4, \'[ GitHub Repo ] Using HTTP proxy: \' + github.params.http_proxy);\r\n		}\r\n\r\n		while (url) {\r\n			Zabbix.log(4, \'[ GitHub Repo ] Sending request: \' + url);\r\n\r\n			response = request.get(url);\r\n\r\n			Zabbix.log(4, \'[ GitHub Repo ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n			if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n				throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n			}\r\n\r\n			try {\r\n				response = JSON.parse(response);\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from API. Check debug log for more information.\';\r\n			}\r\n\r\n			var parsed_data = github.parseData(response);\r\n			final_data.data = final_data.data.concat(parsed_data);\r\n\r\n			headers = request.getHeaders();\r\n\r\n			url = ((headers.link || \'\').match(next_pattern) || [])[1];\r\n\r\n			if (pagination_required === \'false\') {\r\n				url = \'\';\r\n			}\r\n		}\r\n\r\n		final_data.headers = request.getHeaders();\r\n\r\n		delete request;\r\n\r\n		return final_data;\r\n	},\r\n\r\n	parseData: function (response_data) {\r\n		if (!response_data) {\r\n			return [];\r\n		}\r\n\r\n		const normalization_required = "total_count" in response_data && !("url" in response_data);\r\n		if (!normalization_required) return response_data;\r\n\r\n		delete response_data.incomplete_results;\r\n		delete response_data.repository_selection;\r\n		delete response_data.total_count;\r\n\r\n		const namespaceKey = Object.keys(response_data)[0];\r\n		response_data = response_data[namespaceKey];\r\n\r\n		return response_data;\r\n	},\r\n\r\n	itemsCount: function (response_data) {\r\n		const last_page_number = /<[^>]+page=(\\d+)>;\\s*rel="last"/i;\r\n\r\n		if (response_data.headers.link){\r\n			return response_data.headers.link.match(last_page_number)[1];\r\n		}\r\n\r\n		return response_data.data.length;\r\n	}\r\n}\r\n\r\ntry {\r\n	github.setParams(JSON.parse(value), [\'api_query\']);\r\n\r\n	var result = github.apiRequest(github.params.api_url + github.params.api_query + \'?\' + github.params.query_params || \'\', github.params.pagination_required);\r\n\r\n	return github.itemsCount(result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ GitHub Repo ] ERROR: \' + error);\r\n	return JSON.stringify({ error: error });\r\n}','','0','','','','','2',NULL,'Get the number of commits in the branch.\r\n\r\nInformation about endpoint:\r\nhttps://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits','0','7d','0','',NULL,'{$GITHUB.TIMEOUT:"get_commits_count:{#BRANCH_NAME}"}','','','','200','1','0','','','0','0','0','0','0','0','0','927ef4806cc4460a8882c204a9e94817','0','2','0'),
('47329','21','','10634','Workflow [{#WORKFLOW_NAME}]: Get last run','github.repo.workflows.last_run.get[{#WORKFLOW_NAME}]','{$GITHUB.INTERVAL:"get_last_run:{#WORKFLOW_NAME}"}','0','0','0','4','','','','',NULL,NULL,'var github = {\r\n	params: {},\r\n\r\n	setParams: function (params, required) {\r\n		required = required || [];\r\n		required.concat([\'api_url\', \'user_agent\', \'api_version\', \'repo_owner\', \'repo_name\', \'pagination_required\', \'api_token\']).forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\'\r\n				|| params[field] === \'\') {\r\n				throw \'Required parameter is not set: "\' + field + \'".\';\r\n			}\r\n		});\r\n\r\n		github.params = params;\r\n\r\n		if (typeof github.params.api_url === \'string\' && !github.params.api_url.endsWith(\'/\')) {\r\n			github.params.api_url += \'/\';\r\n		}\r\n	},\r\n\r\n	apiRequest: function (url, pagination_required) {\r\n		const next_pattern = /<([^>]+)>;\\s*rel="next"/i;\r\n		var request = new HttpRequest(),\r\n			response,\r\n			headers,\r\n			final_data = {\r\n				headers: {},\r\n				data: []\r\n			};\r\n\r\n		pagination_required = (typeof pagination_required !== \'undefined\') ? pagination_required : \'true\';\r\n\r\n		request.addHeader(\'User-Agent: \' + github.params.user_agent);\r\n		request.addHeader(\'Accept: application/vnd.github+json\');\r\n		request.addHeader(\'X-GitHub-Api-Version: \' + github.params.api_version);\r\n		request.addHeader(\'Authorization: Bearer \' + github.params.api_token);\r\n\r\n		if (typeof github.params.http_proxy !== \'undefined\' && github.params.http_proxy !== \'\') {\r\n			request.setProxy(github.params.http_proxy);\r\n			Zabbix.log(4, \'[ GitHub Repo ] Using HTTP proxy: \' + github.params.http_proxy);\r\n		}\r\n\r\n		while (url) {\r\n			Zabbix.log(4, \'[ GitHub Repo ] Sending request: \' + url);\r\n\r\n			response = request.get(url);\r\n\r\n			Zabbix.log(4, \'[ GitHub Repo ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n			if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n				throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n			}\r\n\r\n			try {\r\n				response = JSON.parse(response);\r\n			}\r\n			catch (error) {\r\n				throw \'Failed to parse response received from API. Check debug log for more information.\';\r\n			}\r\n\r\n			var parsed_data = github.parseData(response);\r\n			final_data.data = final_data.data.concat(parsed_data);\r\n\r\n			headers = request.getHeaders();\r\n\r\n			url = ((headers.link || \'\').match(next_pattern) || [])[1];\r\n\r\n			if (pagination_required === \'false\') {\r\n				url = \'\';\r\n			}\r\n		}\r\n\r\n		final_data.headers = request.getHeaders();\r\n\r\n		delete request;\r\n\r\n		return final_data;\r\n	},\r\n\r\n	parseData: function (response_data) {\r\n		if (!response_data) {\r\n			return [];\r\n		}\r\n\r\n		const normalization_required = "total_count" in response_data && !("url" in response_data);\r\n		if (!normalization_required) return response_data;\r\n\r\n		delete response_data.incomplete_results;\r\n		delete response_data.repository_selection;\r\n		delete response_data.total_count;\r\n\r\n		const namespaceKey = Object.keys(response_data)[0];\r\n		response_data = response_data[namespaceKey];\r\n\r\n		return response_data;\r\n	},\r\n\r\n	itemsCount: function (response_data) {\r\n		const last_page_number = /<[^>]+page=(\\d+)>;\\s*rel="last"/i;\r\n\r\n		if (response_data.headers.link){\r\n			return response_data.headers.link.match(last_page_number)[1];\r\n		}\r\n\r\n		return response_data.data.length;\r\n	}\r\n}\r\n\r\ntry {\r\n	github.setParams(JSON.parse(value), [\'api_query\']);\r\n\r\n	var result = github.apiRequest(github.params.api_url + github.params.api_query + \'?\' + github.params.query_params || \'\', github.params.pagination_required);\r\n\r\n	return JSON.stringify(result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ GitHub Repo ] ERROR: \' + error);\r\n	return JSON.stringify({ error: error });\r\n}','','0','','','','','2',NULL,'Get the data about the last workflow run.\r\n\r\nInformation about endpoint:\r\nhttps://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow','0','7d','0','',NULL,'{$GITHUB.TIMEOUT:"get_last_run:{#WORKFLOW_NAME}"}','','','','200','1','0','','','0','0','0','0','0','0','0','32311fa69236401388321fad4ae183d6','0','2','0'),
('47338','21','','10635','Apps: Get reports','ms365.apps.reports.get','6h','0','0','0','4','','','','',NULL,NULL,'const ms365 = {\r\n	params: {},\r\n	token: null,\r\n\r\n	setParams: function (params) {\r\n		[\'app_id\', \'password\', \'tenant_id\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		ms365.params = params;\r\n	},\r\n\r\n	login: function () {\r\n		const response = new HttpRequest(),\r\n			login = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			login.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		login.addHeader(\'Content-Type: application/x-www-form-urlencoded\');\r\n\r\n		response = login.post(\r\n			\'https://login.microsoftonline.com/\' + encodeURIComponent(ms365.params.tenant_id) + \'/oauth2/v2.0/token\',\r\n			\'grant_type=client_credentials&scope=https://graph.microsoft.com/.default&client_id=\' + encodeURIComponent(ms365.params.app_id) + \'&client_secret=\' + encodeURIComponent(ms365.params.password)\r\n		);\r\n\r\n		if (login.getStatus() < 200 || login.getStatus() >= 300) {\r\n			throw \'Login failed with status code \' + login.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse login session response.\';\r\n		}\r\n\r\n		if (!response.hasOwnProperty(\'access_token\')) {\r\n			throw \'Authentication response does not contain access token.\';\r\n		}\r\n\r\n		ms365.token = response[\'access_token\'];\r\n	},\r\n\r\n	request: function (url) {\r\n		const response = new HttpRequest(),\r\n			request = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			request.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		if (!ms365.token) {\r\n			throw \'Request does not contain access token.\';\r\n		}\r\n\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Authorization: Bearer \' + ms365.token);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Request url: \' + url);\r\n\r\n		response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			return JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from API.\';\r\n		}\r\n	},\r\n\r\n	getField: function (data, path) {\r\n		const steps = path.split(\'.\');\r\n\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n			data = data[step];\r\n		}\r\n\r\n		return ms365.nullToZero(data);\r\n	},\r\n\r\n	nullToZero: function (data) {\r\n		Object.keys(data).forEach(function (key) {\r\n			if (data[key] === null) {\r\n				data[key] = 0;\r\n			} else if (typeof data[key] === \'object\') {\r\n				ms365.nullToZero(data[key]);\r\n			}\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getMetricsData: function (endpoints) {\r\n		const data = {};\r\n\r\n		data.metrics = {};\r\n		endpoints.forEach(function (field) {\r\n			link = \'https://graph.microsoft.com/beta/reports/\' + field + \'(period=\\\'D7\\\')?$format=application/json\';\r\n			answer = ms365.getField(ms365.request(link), \'value\');\r\n\r\n			data.metrics[field] = answer;\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getServiceData: function () {\r\n		var data = {},\r\n\r\n		link = \'https://graph.microsoft.com/beta/admin/serviceAnnouncement/healthOverviews/\';\r\n		data.services = ms365.request(link);\r\n\r\n		return data;\r\n	}\r\n};\r\n\r\n\r\nendpoints = [\r\n	\'getOffice365ActiveUserCounts\',\r\n	\'getOffice365ServicesUserCounts\',\r\n	\'getM365AppUserCounts\',\r\n	\'getM365AppPlatformUserCounts\'\r\n];\r\n\r\ntry {\r\n	ms365.setParams(JSON.parse(value));\r\n	ms365.login();\r\n	return JSON.stringify(ms365.getMetricsData(endpoints));\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ Microsoft 365 ] ERROR: \' + error);\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Accumulated data from the Microsoft Graph API "reports" endpoints.\r\nMore information:\r\nhttps://learn.microsoft.com/en-us/graph/api/resources/report?view=graph-rest-beta','0','7d','0','',NULL,'{$MS365.API.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','f694dc8e49084d3a961c7124cb712c43','0','2','0'),
('47339','21','','10635','OneDrive: Get reports','ms365.onedrive.reports.get','6h','0','0','0','4','','','','',NULL,NULL,'const ms365 = {\r\n	params: {},\r\n	token: null,\r\n\r\n	setParams: function (params) {\r\n		[\'app_id\', \'password\', \'tenant_id\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		ms365.params = params;\r\n	},\r\n\r\n	login: function () {\r\n		const response = new HttpRequest(),\r\n			login = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			login.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		login.addHeader(\'Content-Type: application/x-www-form-urlencoded\');\r\n\r\n		response = login.post(\r\n			\'https://login.microsoftonline.com/\' + encodeURIComponent(ms365.params.tenant_id) + \'/oauth2/v2.0/token\',\r\n			\'grant_type=client_credentials&scope=https://graph.microsoft.com/.default&client_id=\' + encodeURIComponent(ms365.params.app_id) + \'&client_secret=\' + encodeURIComponent(ms365.params.password)\r\n		);\r\n\r\n		if (login.getStatus() < 200 || login.getStatus() >= 300) {\r\n			throw \'Login failed with status code \' + login.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse login session response.\';\r\n		}\r\n\r\n		if (!response.hasOwnProperty(\'access_token\')) {\r\n			throw \'Authentication response does not contain access token.\';\r\n		}\r\n\r\n		ms365.token = response[\'access_token\'];\r\n	},\r\n\r\n	request: function (url) {\r\n		const response = new HttpRequest(),\r\n			request = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			request.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		if (!ms365.token) {\r\n			throw \'Request does not contain access token.\';\r\n		}\r\n\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Authorization: Bearer \' + ms365.token);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Request url: \' + url);\r\n\r\n		response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			return JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from API.\';\r\n		}\r\n	},\r\n\r\n	getField: function (data, path) {\r\n		const steps = path.split(\'.\');\r\n\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n			data = data[step];\r\n		}\r\n\r\n		return ms365.nullToZero(data);\r\n	},\r\n\r\n	nullToZero: function (data) {\r\n		Object.keys(data).forEach(function (key) {\r\n			if (data[key] === null) {\r\n				data[key] = 0;\r\n			} else if (typeof data[key] === \'object\') {\r\n				ms365.nullToZero(data[key]);\r\n			}\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getMetricsData: function (endpoints) {\r\n		const data = {};\r\n\r\n		data.metrics = {};\r\n		endpoints.forEach(function (field) {\r\n			link = \'https://graph.microsoft.com/beta/reports/\' + field + \'(period=\\\'D7\\\')?$format=application/json\';\r\n			answer = ms365.getField(ms365.request(link), \'value\');\r\n\r\n			data.metrics[field] = answer;\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getServiceData: function () {\r\n		var data = {},\r\n\r\n		link = \'https://graph.microsoft.com/beta/admin/serviceAnnouncement/healthOverviews/\';\r\n		data.services = ms365.request(link);\r\n\r\n		return data;\r\n	}\r\n};\r\n\r\n\r\nconst endpoints = [\r\n	\'getOneDriveActivityUserCounts\',\r\n	\'getOneDriveActivityFileCounts\',\r\n	\'getOneDriveUsageAccountCounts\',\r\n	\'getOneDriveUsageFileCounts\',\r\n	\'getOneDriveUsageStorage\'\r\n];\r\n\r\ntry {\r\n	ms365.setParams(JSON.parse(value));\r\n	ms365.login();\r\n	return JSON.stringify(ms365.getMetricsData(endpoints));\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ Microsoft 365 ] ERROR: \' + error);\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Accumulated data from the Microsoft Graph API "reports" endpoints.\r\nMore information:\r\nhttps://learn.microsoft.com/en-us/graph/api/resources/report?view=graph-rest-beta','0','7d','0','',NULL,'{$MS365.API.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','31b78185119446f397404ae7abf05684','0','2','0'),
('47340','21','','10635','Outlook: Get reports','ms365.outlook.reports.get','6h','0','0','0','4','','','','',NULL,NULL,'const ms365 = {\r\n	params: {},\r\n	token: null,\r\n\r\n	setParams: function (params) {\r\n		[\'app_id\', \'password\', \'tenant_id\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		ms365.params = params;\r\n	},\r\n\r\n	login: function () {\r\n		const response = new HttpRequest(),\r\n			login = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			login.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		login.addHeader(\'Content-Type: application/x-www-form-urlencoded\');\r\n\r\n		response = login.post(\r\n			\'https://login.microsoftonline.com/\' + encodeURIComponent(ms365.params.tenant_id) + \'/oauth2/v2.0/token\',\r\n			\'grant_type=client_credentials&scope=https://graph.microsoft.com/.default&client_id=\' + encodeURIComponent(ms365.params.app_id) + \'&client_secret=\' + encodeURIComponent(ms365.params.password)\r\n		);\r\n\r\n		if (login.getStatus() < 200 || login.getStatus() >= 300) {\r\n			throw \'Login failed with status code \' + login.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse login session response.\';\r\n		}\r\n\r\n		if (!response.hasOwnProperty(\'access_token\')) {\r\n			throw \'Authentication response does not contain access token.\';\r\n		}\r\n\r\n		ms365.token = response[\'access_token\'];\r\n	},\r\n\r\n	request: function (url) {\r\n		const response = new HttpRequest(),\r\n			request = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			request.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		if (!ms365.token) {\r\n			throw \'Request does not contain access token.\';\r\n		}\r\n\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Authorization: Bearer \' + ms365.token);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Request url: \' + url);\r\n\r\n		response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			return JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from API.\';\r\n		}\r\n	},\r\n\r\n	getField: function (data, path) {\r\n		const steps = path.split(\'.\');\r\n\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n			data = data[step];\r\n		}\r\n\r\n		return ms365.nullToZero(data);\r\n	},\r\n\r\n	nullToZero: function (data) {\r\n		Object.keys(data).forEach(function (key) {\r\n			if (data[key] === null) {\r\n				data[key] = 0;\r\n			} else if (typeof data[key] === \'object\') {\r\n				ms365.nullToZero(data[key]);\r\n			}\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getMetricsData: function (endpoints) {\r\n		const data = {};\r\n\r\n		data.metrics = {};\r\n		endpoints.forEach(function (field) {\r\n			link = \'https://graph.microsoft.com/beta/reports/\' + field + \'(period=\\\'D7\\\')?$format=application/json\';\r\n			answer = ms365.getField(ms365.request(link), \'value\');\r\n\r\n			data.metrics[field] = answer;\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getServiceData: function () {\r\n		var data = {},\r\n\r\n		link = \'https://graph.microsoft.com/beta/admin/serviceAnnouncement/healthOverviews/\';\r\n		data.services = ms365.request(link);\r\n\r\n		return data;\r\n	}\r\n};\r\n\r\n\r\nendpoints = [\r\n	\'getEmailActivityCounts\',\r\n	\'getEmailActivityUserCounts\',\r\n	\'getEmailAppUsageUserCounts\',\r\n	\'getMailboxUsageMailboxCounts\',\r\n	\'getMailboxUsageStorage\'\r\n];\r\n\r\ntry {\r\n	ms365.setParams(JSON.parse(value));\r\n	ms365.login();\r\n	return JSON.stringify(ms365.getMetricsData(endpoints));\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ Microsoft 365 ] ERROR: \' + error);\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Accumulated data from the Microsoft Graph API "reports" endpoints.\r\nMore information:\r\nhttps://learn.microsoft.com/en-us/graph/api/resources/report?view=graph-rest-beta','0','7d','0','',NULL,'{$MS365.API.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','4e4d78bd44db421a908288031489c3d4','0','2','0'),
('47341','21','','10635','Services: Get services','ms365.services.get','6h','0','0','0','4','','','','',NULL,NULL,'const ms365 = {\r\n	params: {},\r\n	token: null,\r\n\r\n	setParams: function (params) {\r\n		[\'app_id\', \'password\', \'tenant_id\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		ms365.params = params;\r\n	},\r\n\r\n	login: function () {\r\n		const response = new HttpRequest(),\r\n			login = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			login.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		login.addHeader(\'Content-Type: application/x-www-form-urlencoded\');\r\n\r\n		response = login.post(\r\n			\'https://login.microsoftonline.com/\' + encodeURIComponent(ms365.params.tenant_id) + \'/oauth2/v2.0/token\',\r\n			\'grant_type=client_credentials&scope=https://graph.microsoft.com/.default&client_id=\' + encodeURIComponent(ms365.params.app_id) + \'&client_secret=\' + encodeURIComponent(ms365.params.password)\r\n		);\r\n\r\n		if (login.getStatus() < 200 || login.getStatus() >= 300) {\r\n			throw \'Login failed with status code \' + login.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse login session response.\';\r\n		}\r\n\r\n		if (!response.hasOwnProperty(\'access_token\')) {\r\n			throw \'Authentication response does not contain access token.\';\r\n		}\r\n\r\n		ms365.token = response[\'access_token\'];\r\n	},\r\n\r\n	request: function (url) {\r\n		const response = new HttpRequest(),\r\n			request = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			request.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		if (!ms365.token) {\r\n			throw \'Request does not contain access token.\';\r\n		}\r\n\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Authorization: Bearer \' + ms365.token);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Request url: \' + url);\r\n\r\n		response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			return JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from API.\';\r\n		}\r\n	},\r\n\r\n	getField: function (data, path) {\r\n		const steps = path.split(\'.\');\r\n\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n			data = data[step];\r\n		}\r\n\r\n		return ms365.nullToZero(data);\r\n	},\r\n\r\n	nullToZero: function (data) {\r\n		Object.keys(data).forEach(function (key) {\r\n			if (data[key] === null) {\r\n				data[key] = 0;\r\n			} else if (typeof data[key] === \'object\') {\r\n				ms365.nullToZero(data[key]);\r\n			}\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getMetricsData: function (endpoints) {\r\n		const data = {};\r\n\r\n		data.metrics = {};\r\n		endpoints.forEach(function (field) {\r\n			link = \'https://graph.microsoft.com/beta/reports/\' + field + \'(period=\\\'D7\\\')?$format=application/json\';\r\n			answer = ms365.getField(ms365.request(link), \'value\');\r\n\r\n			data.metrics[field] = answer;\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getServiceData: function () {\r\n		var data = {},\r\n\r\n		link = \'https://graph.microsoft.com/beta/admin/serviceAnnouncement/healthOverviews/\';\r\n		data.services = ms365.request(link);\r\n\r\n		return data;\r\n	}\r\n};\r\n\r\n\r\ntry {\r\n	ms365.setParams(JSON.parse(value));\r\n	ms365.login();\r\n	return JSON.stringify(ms365.getServiceData());\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ Microsoft 365 ] ERROR: \' + error);\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'The list of Microsoft cloud services and their health statuses subscribed by a tenant.\r\nMore information:\r\nhttps://learn.microsoft.com/en-us/graph/api/servicehealth-get?view=graph-rest-beta&tabs=http','0','7d','0','',NULL,'{$MS365.API.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','53c72fa948454b998f612c4d099dd440','0','2','0'),
('47342','21','','10635','SharePoint: Get reports','ms365.sharepoint.reports.get','6h','0','0','0','4','','','','',NULL,NULL,'const ms365 = {\r\n	params: {},\r\n	token: null,\r\n\r\n	setParams: function (params) {\r\n		[\'app_id\', \'password\', \'tenant_id\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		ms365.params = params;\r\n	},\r\n\r\n	login: function () {\r\n		const response = new HttpRequest(),\r\n			login = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			login.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		login.addHeader(\'Content-Type: application/x-www-form-urlencoded\');\r\n\r\n		response = login.post(\r\n			\'https://login.microsoftonline.com/\' + encodeURIComponent(ms365.params.tenant_id) + \'/oauth2/v2.0/token\',\r\n			\'grant_type=client_credentials&scope=https://graph.microsoft.com/.default&client_id=\' + encodeURIComponent(ms365.params.app_id) + \'&client_secret=\' + encodeURIComponent(ms365.params.password)\r\n		);\r\n\r\n		if (login.getStatus() < 200 || login.getStatus() >= 300) {\r\n			throw \'Login failed with status code \' + login.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse login session response.\';\r\n		}\r\n\r\n		if (!response.hasOwnProperty(\'access_token\')) {\r\n			throw \'Authentication response does not contain access token.\';\r\n		}\r\n\r\n		ms365.token = response[\'access_token\'];\r\n	},\r\n\r\n	request: function (url) {\r\n		const response = new HttpRequest(),\r\n			request = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			request.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		if (!ms365.token) {\r\n			throw \'Request does not contain access token.\';\r\n		}\r\n\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Authorization: Bearer \' + ms365.token);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Request url: \' + url);\r\n\r\n		response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			return JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from API.\';\r\n		}\r\n	},\r\n\r\n	getField: function (data, path) {\r\n		const steps = path.split(\'.\');\r\n\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n			data = data[step];\r\n		}\r\n\r\n		return ms365.nullToZero(data);\r\n	},\r\n\r\n	nullToZero: function (data) {\r\n		Object.keys(data).forEach(function (key) {\r\n			if (data[key] === null) {\r\n				data[key] = 0;\r\n			} else if (typeof data[key] === \'object\') {\r\n				ms365.nullToZero(data[key]);\r\n			}\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getMetricsData: function (endpoints) {\r\n		const data = {};\r\n\r\n		data.metrics = {};\r\n		endpoints.forEach(function (field) {\r\n			link = \'https://graph.microsoft.com/beta/reports/\' + field + \'(period=\\\'D7\\\')?$format=application/json\';\r\n			answer = ms365.getField(ms365.request(link), \'value\');\r\n\r\n			data.metrics[field] = answer;\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getServiceData: function () {\r\n		var data = {},\r\n\r\n		link = \'https://graph.microsoft.com/beta/admin/serviceAnnouncement/healthOverviews/\';\r\n		data.services = ms365.request(link);\r\n\r\n		return data;\r\n	}\r\n};\r\n\r\n\r\nendpoints = [\r\n	\'getSharePointActivityFileCounts\',\r\n	\'getSharePointActivityUserCounts\',\r\n	\'getSharePointActivityPages\',\r\n	\'getSharePointSiteUsageFileCounts\',\r\n	\'getSharePointSiteUsageSiteCounts\',\r\n	\'getSharePointSiteUsageStorage\',\r\n	\'getSharePointSiteUsagePages\'\r\n];\r\n\r\ntry {\r\n	ms365.setParams(JSON.parse(value));\r\n	ms365.login();\r\n	return JSON.stringify(ms365.getMetricsData(endpoints));\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ Microsoft 365 ] ERROR: \' + error);\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Accumulated data from the Microsoft Graph API "reports" endpoints.\r\nMore information:\r\nhttps://learn.microsoft.com/en-us/graph/api/resources/report?view=graph-rest-beta','0','7d','0','',NULL,'{$MS365.API.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','fd2cb544cfd744c1a94a1d32243978e6','0','2','0'),
('47343','21','','10635','Teams: Get reports','ms365.teams.reports.get','6h','0','0','0','4','','','','',NULL,NULL,'const ms365 = {\r\n	params: {},\r\n	token: null,\r\n\r\n	setParams: function (params) {\r\n		[\'app_id\', \'password\', \'tenant_id\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		ms365.params = params;\r\n	},\r\n\r\n	login: function () {\r\n		const response = new HttpRequest(),\r\n			login = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			login.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		login.addHeader(\'Content-Type: application/x-www-form-urlencoded\');\r\n\r\n		response = login.post(\r\n			\'https://login.microsoftonline.com/\' + encodeURIComponent(ms365.params.tenant_id) + \'/oauth2/v2.0/token\',\r\n			\'grant_type=client_credentials&scope=https://graph.microsoft.com/.default&client_id=\' + encodeURIComponent(ms365.params.app_id) + \'&client_secret=\' + encodeURIComponent(ms365.params.password)\r\n		);\r\n\r\n		if (login.getStatus() < 200 || login.getStatus() >= 300) {\r\n			throw \'Login failed with status code \' + login.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse login session response.\';\r\n		}\r\n\r\n		if (!response.hasOwnProperty(\'access_token\')) {\r\n			throw \'Authentication response does not contain access token.\';\r\n		}\r\n\r\n		ms365.token = response[\'access_token\'];\r\n	},\r\n\r\n	request: function (url) {\r\n		const response = new HttpRequest(),\r\n			request = new HttpRequest();\r\n\r\n		if (typeof ms365.params.http_proxy !== \'undefined\' && ms365.params.http_proxy !== \'\') {\r\n			request.setProxy(ms365.params.http_proxy);\r\n			Zabbix.log(4, \'[ Microsoft 365 ] Using HTTP proxy: \' + ms365.params.http_proxy);\r\n		}\r\n\r\n		if (!ms365.token) {\r\n			throw \'Request does not contain access token.\';\r\n		}\r\n\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Authorization: Bearer \' + ms365.token);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Request url: \' + url);\r\n\r\n		response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Microsoft 365 ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			return JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from API.\';\r\n		}\r\n	},\r\n\r\n	getField: function (data, path) {\r\n		const steps = path.split(\'.\');\r\n\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n			data = data[step];\r\n		}\r\n\r\n		return ms365.nullToZero(data);\r\n	},\r\n\r\n	nullToZero: function (data) {\r\n		Object.keys(data).forEach(function (key) {\r\n			if (data[key] === null) {\r\n				data[key] = 0;\r\n			} else if (typeof data[key] === \'object\') {\r\n				ms365.nullToZero(data[key]);\r\n			}\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getMetricsData: function (endpoints) {\r\n		const data = {};\r\n\r\n		data.metrics = {};\r\n		endpoints.forEach(function (field) {\r\n			link = \'https://graph.microsoft.com/beta/reports/\' + field + \'(period=\\\'D7\\\')?$format=application/json\';\r\n			answer = ms365.getField(ms365.request(link), \'value\');\r\n\r\n			data.metrics[field] = answer;\r\n		});\r\n\r\n		return data;\r\n	},\r\n\r\n	getServiceData: function () {\r\n		var data = {},\r\n\r\n		link = \'https://graph.microsoft.com/beta/admin/serviceAnnouncement/healthOverviews/\';\r\n		data.services = ms365.request(link);\r\n\r\n		return data;\r\n	}\r\n};\r\n\r\n\r\nendpoints = [\r\n	\'getTeamsDeviceUsageDistributionUserCounts\',\r\n	\'getTeamsDeviceUsageDistributionTotalUserCounts\',\r\n	\'getTeamsUserActivityTotalDistributionCounts\',\r\n	\'getTeamsUserActivityDistributionUserCounts\',\r\n	\'getTeamsUserActivityDistributionTotalUserCounts\',\r\n	\'getTeamsTeamActivityDistributionCounts\'\r\n];\r\n\r\ntry {\r\n	ms365.setParams(JSON.parse(value));\r\n	ms365.login();\r\n	return JSON.stringify(ms365.getMetricsData(endpoints));\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ Microsoft 365 ] ERROR: \' + error);\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Accumulated data from the Microsoft Graph API "reports" endpoints.\r\nMore information:\r\nhttps://learn.microsoft.com/en-us/graph/api/resources/report?view=graph-rest-beta','0','7d','0','',NULL,'{$MS365.API.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','a77e654c05ec44ed991a36c6b1df472f','0','2','0'),
('47515','3','','10173','Get alarms','vmware.alarms.get[{$VMWARE.URL}]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'Get alarm status.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5a0c711cae454f0e92a492dd1718101f','0','2','0'),
('47516','21','','10173','Get Overall Health VC State','vmware.health.get','1m','0','0','0','4','','','','',NULL,NULL,'var Vcenter = {\r\n	 params: {},\r\n	 vmware_api_session_id: \'\',\r\n	 health_status: \'\',\r\n	 error_msg: \'\',\r\n\r\n	 setParams: function (params) {\r\n		  [\'url\', \'username\', \'password\'].forEach(function (field) {\r\n			  if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				  throw \'Required param is not set: \' + field + \'.\';\r\n			  }\r\n		  });\r\n\r\n		  if (params[\'url\'].endsWith(\'/\')) {\r\n			   params[\'url\'] = params[\'url\'].slice(0,-1);\r\n		  }\r\n		  params[\'url\'] = params[\'url\'].replace(\'/sdk\',\'\');\r\n\r\n		  Vcenter.params = params;\r\n	 },\r\n\r\n	 isGtOrEqVersion: function (first_version, second_version) {\r\n		  var first = first_version.split(\'.\').map(Number),\r\n			  second = second_version.split(\'.\').map(Number);\r\n\r\n		  if (first.length > second.length) {\r\n			  const max_componens_length = first.length\r\n		  }\r\n		  else {\r\n			  const max_componens_length = second.length\r\n		  }\r\n\r\n		  var num_components = first.length;\r\n		  while (num_components < max_componens_length) {\r\n			  first.push(0);\r\n			  num_components = num_components +1;\r\n		  }\r\n\r\n		  var num_components = second.length;\r\n		  while (num_components < max_componens_length) {\r\n			  second.push(0);\r\n			  num_components = num_components +1;\r\n		  }\r\n\r\n		  if (first[0] > second[0] ||\r\n			  (first[0] === second[0] && first[1] > second[1]) ||\r\n			  (first[0] === second[0] && first[1] === second[1] && first[2] >= second[2])) {\r\n			  return true;\r\n		  }\r\n\r\n		  return false;\r\n	  },\r\n\r\n	 login: function () {\r\n		  var response, request = new HttpRequest();\r\n		  request.setHttpAuth(HTTPAUTH_BASIC, Vcenter.params.username, Vcenter.params.password);\r\n		  request.addHeader(\'Accept: application/json\');\r\n		  request.addHeader(\'Content-Type: application/json\');\r\n\r\n		  response = request.post(Vcenter.params.url + \'/api/session\', \'\');\r\n		  if (request.getStatus() >= 200 && request.getStatus() < 300 && (!JSON.parse(response).error)) {\r\n			   Vcenter.vmware_api_session_id = Vcenter.removeQuotes(response);\r\n			   return true;\r\n		  }\r\n\r\n		  response = request.post(Vcenter.params.url + \'/rest/com/vmware/cis/session\', \'\');\r\n		  if (request.getStatus() >= 200 && request.getStatus() < 300) {\r\n			   Vcenter.vmware_api_session_id = JSON.parse(response).value;\r\n			   return true;\r\n		  }\r\n\r\n		  return false;\r\n	 },\r\n\r\n	 logout: function () {\r\n		  path = \'/rest/com/vmware/cis/session\';\r\n		  if (Vcenter.vmware_api_version && Vcenter.isGtOrEqVersion(Vcenter.vmware_api_version, \'7.0.2\')) {\r\n			   path = \'/api/session\';\r\n		  }\r\n\r\n		  Vcenter.request(Vcenter.params.url + path, \'delete\');\r\n	 },\r\n\r\n	 get_version: function () {\r\n		  path = \'/rest/appliance/system/version\';\r\n\r\n		  try {\r\n			   Vcenter.vmware_api_version = Vcenter.request(Vcenter.params.url + path, \'get\').version;\r\n			   return true;\r\n		  }\r\n		  catch (error) {\r\n			   return false;\r\n		  }\r\n	 },\r\n\r\n	 removeQuotes: function (str){\r\n		  if (str.startsWith(\'"\') && str.endsWith(\'"\')) {\r\n			  return str.slice(1, -1);\r\n		  }\r\n\r\n		  return str;\r\n	 },\r\n\r\n	 getHealthStatus: function () {\r\n		  path = \'/api/appliance/health/system\';\r\n		  if (!Vcenter.isGtOrEqVersion(Vcenter.vmware_api_version, \'7.0.2\')) {\r\n			   path = \'/rest/appliance/health/system\';\r\n		  }\r\n\r\n		  result = Vcenter.removeQuotes(Vcenter.request(Vcenter.params.url + path, \'get\'));\r\n\r\n		  const idx = [\r\n			   \'green\',\r\n			   \'yellow\',\r\n			   \'orange\',\r\n			   \'red\',\r\n			   \'gray\'\r\n			   ].indexOf(result.toLowerCase());\r\n		  Vcenter.health_status = idx !== -1 ? idx : 5;\r\n	 },\r\n\r\n	 request: function (url, method) {\r\n		  var response, request = new HttpRequest();\r\n\r\n		  if (typeof Vcenter.params.proxy !== \'undefined\' && Vcenter.params.proxy !== \'\') {\r\n			   request.setProxy(Vcenter.params.proxy);\r\n		  }\r\n\r\n		  request.setHttpAuth(HTTPAUTH_NONE);\r\n		  request.addHeader("Cookie: vmware-api-session-id=" + Vcenter.vmware_api_session_id);\r\n\r\n		  Zabbix.log(4, \'[ VMware vCenter ] Sending request: \' + url);\r\n\r\n		  switch (method) {\r\n			   case \'get\':\r\n				   response = request.get(url);\r\n				   break;\r\n\r\n			   case \'post\':\r\n				   response = request.post(url);\r\n				   break;\r\n\r\n			   case \'delete\':\r\n					response = request.delete(url);\r\n					break;\r\n\r\n			   default:\r\n				   throw \'Unsupported HTTP request method: \' + method;\r\n		  }\r\n\r\n		  Zabbix.log(4, \'[ VMware vCenter ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		  if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			   throw \'Cannot connect to VMware vCenter. Check debug log for more information.\';\r\n		  }\r\n\r\n		  if (method !== \'delete\' && JSON.parse(response).value) {\r\n			   return JSON.parse(response).value;\r\n		  }\r\n		  else {\r\n			   return response;\r\n		  }\r\n	 }\r\n};\r\n\r\ntry {\r\n	 Vcenter.setParams(JSON.parse(value));\r\n	 \r\n	 if (Vcenter.login() && Vcenter.get_version() && Vcenter.isGtOrEqVersion(Vcenter.vmware_api_version, \'6.5.0\')) {\r\n		  Vcenter.getHealthStatus();\r\n	 }\r\n	 else {\r\n		  Vcenter.health_status = 6;\r\n	 }\r\n\r\n	 if (Vcenter.vmware_api_session_id) {\r\n		  Vcenter.logout();\r\n	 }\r\n}\r\ncatch (error) {\r\n	 Zabbix.log(3, \'[ VMware vCenter ] ERROR: \' + error);\r\n	 Vcenter.error_msg = \'Failed to get data from API:\' + error;\r\n}\r\n\r\nreturn JSON.stringify({\'health\': Vcenter.health_status, \'error\': Vcenter.error_msg});','','0','','','','','0',NULL,'Gets overall health of the system. This item works only with VMware vCenter versions above 6.5.','0','7d','0','',NULL,'10','','','','200','1','0','','','0','0','0','0','0','0','0','889333d3225147e1b1604119050a121f','0','2','0'),
('47517','3','','10174','Snapshot consolidation needed','vmware.vm.consolidationneeded[{$VMWARE.URL},{$VMWARE.VM.UUID}]','1m','31d','365d','0','3','','','','',NULL,'1231','','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'Displays whether snapshot consolidation is needed or not. One of the following:\r\n- True;\r\n- False.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','20332e3c1ea54266a02ad500bc9ec1ca','0','2','0'),
('47518','3','','10174','Get snapshots','vmware.vm.snapshot.get[{$VMWARE.URL},{$VMWARE.VM.UUID}]','1h','0','0','0','4','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'Snapshots of the guest VM.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','550350d76aa346c49ef828418ebc53be','0','2','0'),
('47519','3','','10174','VM state','vmware.vm.state[{$VMWARE.URL},{$VMWARE.VM.UUID}]','1m','31d','365d','0','3','','','','',NULL,'1233','','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'VMware virtual machine state. One of the following:\r\n- Not running;\r\n- Resetting;\r\n- Running;\r\n- Shutting down;\r\n- Standby;\r\n- Unknown.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2e68d5709d4f46b49b62d37a890e4193','0','2','0'),
('47520','3','','10174','VMware Tools status','vmware.vm.tools[{$VMWARE.URL},{$VMWARE.VM.UUID},status]','1m','31d','365d','0','3','','','','',NULL,'1232','','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'Monitoring of VMware Tools. One of the following:\r\n- Guest tools executing scripts: VMware Tools is starting.\r\n- Guest tools not running: VMware Tools is not running.\r\n- Guest tools running: VMware Tools is running.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','6089b7822620423aa2b2e66066d33217','0','2','0'),
('47521','3','','10174','VMware Tools version','vmware.vm.tools[{$VMWARE.URL},{$VMWARE.VM.UUID},version]','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'Monitoring of the VMware Tools version.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3870a0d8bfd1474db6e096a1a9a246b3','0','2','0'),
('47522','3','','10175','Connection state','vmware.hv.connectionstate[{$VMWARE.URL},{$VMWARE.HV.UUID}]','1m','31d','365d','0','3','','','','',NULL,'1234','','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'VMware hypervisor connection state. One of the following:\r\n- Connected;\r\n- Disconnected;\r\n- Not responding.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','0e9fd4e6d6e446f08afe7b4b9431bc62','0','2','0'),
('47523','3','','10175','Number of broadcasts received','vmware.hv.network.in[{$VMWARE.URL},{$VMWARE.HV.UUID},broadcast]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'VMware hypervisor network input statistics (broadcasts).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8f935e9718294cd4a67d02f4723a1713','0','2','0'),
('47524','3','','10175','Number of dropped received packets','vmware.hv.network.in[{$VMWARE.URL},{$VMWARE.HV.UUID},dropped]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'VMware hypervisor network input statistics (packets dropped).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','720c58685828440bacda845bfd848d6a','0','2','0'),
('47525','3','','10175','Number of errors received','vmware.hv.network.in[{$VMWARE.URL},{$VMWARE.HV.UUID},errors]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'VMware hypervisor network input statistics (errors).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','0084eb8fd76241b8938bb1dad5a3f160','0','2','0'),
('47526','3','','10175','Number of broadcasts transmitted','vmware.hv.network.out[{$VMWARE.URL},{$VMWARE.HV.UUID},broadcast]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'VMware hypervisor network output statistics (broadcasts).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','16496c407daa43b9863c05416b294992','0','2','0'),
('47527','3','','10175','Number of dropped transmitted packets','vmware.hv.network.out[{$VMWARE.URL},{$VMWARE.HV.UUID},dropped]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'VMware hypervisor network output statistics (packets dropped).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f001256bbfc34cc0898c5eaef422973e','0','2','0'),
('47528','3','','10175','Number of errors transmitted','vmware.hv.network.out[{$VMWARE.URL},{$VMWARE.HV.UUID},errors]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'VMware hypervisor network output statistics (errors).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5f549d8708f24160b04a4a74db29042a','0','2','0'),
('47534','3','','10175','Network interface discovery','vmware.hv.net.if.discovery[{$VMWARE.URL},{$VMWARE.HV.UUID}]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','1',NULL,'Discovery of VMware hypervisor network interfaces.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','cabe1fbdd4e04ef396afaa5dfd1a3423','0','2','0'),
('47536','3','','10173','Average read IOPS of the datastore [{#DATASTORE}]','vmware.datastore.read[{$VMWARE.URL},{#DATASTORE},rps]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','2',NULL,'IOPS for a read operation from the datastore (milliseconds).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','54c2631edeb04ef39701ad3bf03be1af','0','2','0'),
('47537','3','','10173','Average write IOPS of the datastore [{#DATASTORE}]','vmware.datastore.write[{$VMWARE.URL},{#DATASTORE},rps]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','2',NULL,'IOPS for a write operation to the datastore (milliseconds).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','0026edd933404faf992d08628c9ab364','0','2','0'),
('47538','3','','10175','Average read IOPS of the datastore [{#DATASTORE}]','vmware.hv.datastore.read[{$VMWARE.URL},{$VMWARE.HV.UUID},{#DATASTORE},rps]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','2',NULL,'Average IOPS for a read operation from the datastore.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','1d7761e9ad0c48c1a3f6b1b48290c16b','0','2','0'),
('47539','3','','10175','Average write IOPS of the datastore [{#DATASTORE}]','vmware.hv.datastore.write[{$VMWARE.URL},{$VMWARE.HV.UUID},{#DATASTORE},rps]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','2',NULL,'Average IOPS for a write operation to the datastore (milliseconds).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','4514c4ccf00142e48b243f69dee0b533','0','2','0'),
('47540','3','','10175','[{#IFNAME}] network interface speed','vmware.hv.network.linkspeed[{$VMWARE.URL},{$VMWARE.HV.UUID},{#IFNAME}]','1m','31d','365d','0','3','','bps','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','2',NULL,'VMware hypervisor network interface speed.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','706acba4535e4135b824d53763868a5f','0','2','0'),
('47541','3','','10175','Serial number','vmware.hv.hw.serialnumber[{$VMWARE.URL},{#VMWARE.HV.UUID}]','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','2',NULL,'VMware hypervisor serial number.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','fcd12a13f97848b78b610e86a24417b2','0','2','0'),
('47543','3','','10366','Get alarms','vmware.alarms.get[{$VMWARE.URL}]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'Get alarm status.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b9e3684632314721aed3119df6a06976','0','2','0'),
('47544','21','','10366','Get Overall Health VC State','vmware.health.get','1m','0','0','0','4','','','','',NULL,NULL,'var Vcenter = {\r\n	 params: {},\r\n	 vmware_api_session_id: \'\',\r\n	 health_status: \'\',\r\n	 error_msg: \'\',\r\n\r\n	 setParams: function (params) {\r\n		  [\'url\', \'username\', \'password\'].forEach(function (field) {\r\n			  if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				  throw \'Required param is not set: \' + field + \'.\';\r\n			  }\r\n		  });\r\n\r\n		  if (params[\'url\'].endsWith(\'/\')) {\r\n			   params[\'url\'] = params[\'url\'].slice(0,-1);\r\n		  }\r\n		  params[\'url\'] = params[\'url\'].replace(\'/sdk\',\'\');\r\n\r\n		  Vcenter.params = params;\r\n	 },\r\n\r\n	 isGtOrEqVersion: function (first_version, second_version) {\r\n		  var first = first_version.split(\'.\').map(Number),\r\n			  second = second_version.split(\'.\').map(Number);\r\n\r\n		  if (first.length > second.length) {\r\n			  const max_componens_length = first.length\r\n		  }\r\n		  else {\r\n			  const max_componens_length = second.length\r\n		  }\r\n\r\n		  var num_components = first.length;\r\n		  while (num_components < max_componens_length) {\r\n			  first.push(0);\r\n			  num_components = num_components +1;\r\n		  }\r\n\r\n		  var num_components = second.length;\r\n		  while (num_components < max_componens_length) {\r\n			  second.push(0);\r\n			  num_components = num_components +1;\r\n		  }\r\n\r\n		  if (first[0] > second[0] ||\r\n			  (first[0] === second[0] && first[1] > second[1]) ||\r\n			  (first[0] === second[0] && first[1] === second[1] && first[2] >= second[2])) {\r\n			  return true;\r\n		  }\r\n\r\n		  return false;\r\n	  },\r\n\r\n	 login: function () {\r\n		  var response, request = new HttpRequest();\r\n		  request.setHttpAuth(HTTPAUTH_BASIC, Vcenter.params.username, Vcenter.params.password);\r\n		  request.addHeader(\'Accept: application/json\');\r\n		  request.addHeader(\'Content-Type: application/json\');\r\n\r\n		  response = request.post(Vcenter.params.url + \'/api/session\', \'\');\r\n		  if (request.getStatus() >= 200 && request.getStatus() < 300 && (!JSON.parse(response).error)) {\r\n			   Vcenter.vmware_api_session_id = Vcenter.removeQuotes(response);\r\n			   return true;\r\n		  }\r\n\r\n		  response = request.post(Vcenter.params.url + \'/rest/com/vmware/cis/session\', \'\');\r\n		  if (request.getStatus() >= 200 && request.getStatus() < 300) {\r\n			   Vcenter.vmware_api_session_id = JSON.parse(response).value;\r\n			   return true;\r\n		  }\r\n\r\n		  return false;\r\n	 },\r\n\r\n	 logout: function () {\r\n		  path = \'/rest/com/vmware/cis/session\';\r\n		  if (Vcenter.vmware_api_version && Vcenter.isGtOrEqVersion(Vcenter.vmware_api_version, \'7.0.2\')) {\r\n			   path = \'/api/session\';\r\n		  }\r\n\r\n		  Vcenter.request(Vcenter.params.url + path, \'delete\');\r\n	 },\r\n\r\n	 get_version: function () {\r\n		  path = \'/rest/appliance/system/version\';\r\n\r\n		  try {\r\n			   Vcenter.vmware_api_version = Vcenter.request(Vcenter.params.url + path, \'get\').version;\r\n			   return true;\r\n		  }\r\n		  catch (error) {\r\n			   return false;\r\n		  }\r\n	 },\r\n\r\n	 removeQuotes: function (str){\r\n		  if (str.startsWith(\'"\') && str.endsWith(\'"\')) {\r\n			  return str.slice(1, -1);\r\n		  }\r\n\r\n		  return str;\r\n	 },\r\n\r\n	 getHealthStatus: function () {\r\n		  path = \'/api/appliance/health/system\';\r\n		  if (!Vcenter.isGtOrEqVersion(Vcenter.vmware_api_version, \'7.0.2\')) {\r\n			   path = \'/rest/appliance/health/system\';\r\n		  }\r\n\r\n		  result = Vcenter.removeQuotes(Vcenter.request(Vcenter.params.url + path, \'get\'));\r\n\r\n		  const idx = [\r\n			   \'green\',\r\n			   \'yellow\',\r\n			   \'orange\',\r\n			   \'red\',\r\n			   \'gray\'\r\n			   ].indexOf(result.toLowerCase());\r\n		  Vcenter.health_status = idx !== -1 ? idx : 5;\r\n	 },\r\n\r\n	 request: function (url, method) {\r\n		  var response, request = new HttpRequest();\r\n\r\n		  if (typeof Vcenter.params.proxy !== \'undefined\' && Vcenter.params.proxy !== \'\') {\r\n			   request.setProxy(Vcenter.params.proxy);\r\n		  }\r\n\r\n		  request.setHttpAuth(HTTPAUTH_NONE);\r\n		  request.addHeader("Cookie: vmware-api-session-id=" + Vcenter.vmware_api_session_id);\r\n\r\n		  Zabbix.log(4, \'[ VMware vCenter ] Sending request: \' + url);\r\n\r\n		  switch (method) {\r\n			   case \'get\':\r\n				   response = request.get(url);\r\n				   break;\r\n\r\n			   case \'post\':\r\n				   response = request.post(url);\r\n				   break;\r\n\r\n			   case \'delete\':\r\n					response = request.delete(url);\r\n					break;\r\n\r\n			   default:\r\n				   throw \'Unsupported HTTP request method: \' + method;\r\n		  }\r\n\r\n		  Zabbix.log(4, \'[ VMware vCenter ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		  if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			   throw \'Cannot connect to VMware vCenter. Check debug log for more information.\';\r\n		  }\r\n\r\n		  if (method !== \'delete\' && JSON.parse(response).value) {\r\n			   return JSON.parse(response).value;\r\n		  }\r\n		  else {\r\n			   return response;\r\n		  }\r\n	 }\r\n};\r\n\r\ntry {\r\n	 Vcenter.setParams(JSON.parse(value));\r\n	 \r\n	 if (Vcenter.login() && Vcenter.get_version() && Vcenter.isGtOrEqVersion(Vcenter.vmware_api_version, \'6.5.0\')) {\r\n		  Vcenter.getHealthStatus();\r\n	 }\r\n	 else {\r\n		  Vcenter.health_status = 6;\r\n	 }\r\n\r\n	 if (Vcenter.vmware_api_session_id) {\r\n		  Vcenter.logout();\r\n	 }\r\n}\r\ncatch (error) {\r\n	 Zabbix.log(3, \'[ VMware vCenter ] ERROR: \' + error);\r\n	 Vcenter.error_msg = \'Failed to get data from API:\' + error;\r\n}\r\n\r\nreturn JSON.stringify({\'health\': Vcenter.health_status, \'error\': Vcenter.error_msg});','','0','','','','','0',NULL,'Gets overall health of the system. This item works only with VMware vCenter versions above 6.5.','0','7d','0','',NULL,'10','','','','200','1','0','','','0','0','0','0','0','0','0','7445c01436234092ad5d093d872b0682','0','2','0'),
('47548','3','','10366','Average read IOPS of the datastore [{#DATASTORE}]','vmware.datastore.read[{$VMWARE.URL},{#DATASTORE},rps]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','2',NULL,'IOPS for a read operation from the datastore (milliseconds).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','c2687322c7914ec3b5519b73f1723aeb','0','2','0'),
('47549','3','','10366','Average write IOPS of the datastore [{#DATASTORE}]','vmware.datastore.write[{$VMWARE.URL},{#DATASTORE},rps]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','2',NULL,'IOPS for a write operation to the datastore (milliseconds).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','a72c4a6247be4f968c1740de556732bd','0','2','0'),
('47551','5','','10047','Zabbix proxy groups stats','zabbix[proxy group,discovery]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'The master item of Zabbix proxy groups\' statistics.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','efba7193b9aa48c385e98c9babfaa689','0','2','0'),
('47569','20','walk[1.3.6.1.4.1.34774.4.1.23.5.5.1.1,1.3.6.1.4.1.34774.4.1.23.5.5.1.2,1.3.6.1.4.1.34774.4.1.23.5.5.1.3,1.3.6.1.4.1.34774.4.1.23.5.5.1.4]','10636','BBU SNMP walk','huawei.oceanstor.v6.bbu.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Discovery of device backup battery units.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b1b27fc308a643c080ca461aa43ac155','0','2','0'),
('47570','20','get[1.3.6.1.4.1.34774.4.1.1.5.0]','10636','Capacity total','huawei.oceanstor.v6.capacity.total','1m','31d','365d','0','3','','B','','',NULL,NULL,'','','0','','','','','0',NULL,'Total capacity of a device.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5966b59ae96c4044a2c53d84728aa385','0','2','0'),
('47571','20','get[1.3.6.1.4.1.34774.4.1.1.4.0]','10636','Capacity used','huawei.oceanstor.v6.capacity.used','1m','31d','365d','0','3','','B','','',NULL,NULL,'','','0','','','','','0',NULL,'Used capacity of a device.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','0bb56fda578e44b28dfaca63e37c6026','0','2','0'),
('47572','20','walk[1.3.6.1.4.1.34774.4.1.23.5.2.1.1,1.3.6.1.4.1.34774.4.1.23.5.2.1.8,1.3.6.1.4.1.34774.4.1.23.5.2.1.9,1.3.6.1.4.1.34774.4.1.23.5.2.1.2,1.3.6.1.4.1.34774.4.1.23.5.2.1.3,1.3.6.1.4.1.34774.4.1.23.5.2.1.6]','10636','Controller SNMP walk','huawei.oceanstor.v6.controller.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Discovery of device controllers.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','251875b1bf7f4aea800eebdf826c92cc','0','2','0'),
('47573','20','walk[1.3.6.1.4.1.34774.4.1.23.5.1.1.1,1.3.6.1.4.1.34774.4.1.23.5.1.1.12,1.3.6.1.4.1.34774.4.1.23.5.1.1.4,1.3.6.1.4.1.34774.4.1.23.5.1.1.2,1.3.6.1.4.1.34774.4.1.23.5.1.1.3,1.3.6.1.4.1.34774.4.1.23.5.1.1.11]','10636','Disk SNMP walk','huawei.oceanstor.v6.disk.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Discovery of device disks.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','502c0446b3ac4c7c91fb81076e8fded0','0','2','0'),
('47574','20','walk[1.3.6.1.4.1.34774.4.1.23.5.6.1.2,1.3.6.1.4.1.34774.4.1.23.5.6.1.4,1.3.6.1.4.1.34774.4.1.23.5.6.1.5,1.3.6.1.4.1.34774.4.1.23.5.6.1.8]','10636','Enclosure SNMP walk','huawei.oceanstor.v6.enclosure.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Discovery of device enclosures.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','dc3f094725ff4794844687d4037ea2c2','0','2','0'),
('47575','20','walk[1.3.6.1.4.1.34774.4.1.23.5.4.1.1,1.3.6.1.4.1.34774.4.1.23.5.4.1.2,1.3.6.1.4.1.34774.4.1.23.5.4.1.3,1.3.6.1.4.1.34774.4.1.23.5.4.1.4]','10636','Fan SNMP walk','huawei.oceanstor.v6.fan.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Discovery of device fans.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','fe922a88992f49f9a6bf4ed080c880d7','0','2','0'),
('47576','20','walk[1.3.6.1.4.1.34774.4.1.19.9.4.1.2,1.3.6.1.4.1.34774.4.1.19.9.4.1.11,1.3.6.1.4.1.34774.4.1.21.4.1.13,1.3.6.1.4.1.34774.4.1.21.4.1.15,1.3.6.1.4.1.34774.4.1.21.4.1.16,1.3.6.1.4.1.34774.4.1.21.4.1.3,1.3.6.1.4.1.34774.4.1.21.4.1.4,1.3.6.1.4.1.34774.4.1.21.4.1.5,1.3.6.1.4.1.34774.4.1.21.4.1.6,1.3.6.1.4.1.34774.4.1.21.4.1.7,1.3.6.1.4.1.34774.4.1.21.4.1.8,1.3.6.1.4.1.34774.4.1.19.9.4.1.5]','10636','LUN SNMP walk','huawei.oceanstor.v6.lun.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Discovery of device logical unit numbers.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','269a95fbb3ce4f1eb9dc684777875d87','0','2','0'),
('47577','20','walk[1.3.6.1.4.1.34774.4.1.21.3.1.1,1.3.6.1.4.1.34774.4.1.21.3.1.2,1.3.6.1.4.1.34774.4.1.21.3.1.5,1.3.6.1.4.1.34774.4.1.21.3.1.6,1.3.6.1.4.1.34774.4.1.21.3.1.7,1.3.6.1.4.1.34774.4.1.21.3.1.8,1.3.6.1.4.1.34774.4.1.21.3.1.9,1.3.6.1.4.1.34774.4.1.21.3.1.10]','10636','Node SNMP walk','huawei.oceanstor.v6.node.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Discovery of device nodes.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2170d4e5ca684e579dd511e59e5e9828','0','2','0'),
('47578','20','walk[1.3.6.1.4.1.34774.4.1.23.4.2.1.2,1.3.6.1.4.1.34774.4.1.23.4.2.1.14,1.3.6.1.4.1.34774.4.1.23.4.2.1.5,1.3.6.1.4.1.34774.4.1.23.4.2.1.6,1.3.6.1.4.1.34774.4.1.23.4.2.1.7,1.3.6.1.4.1.34774.4.1.23.4.2.1.9]','10636','Storage pool SNMP walk','huawei.oceanstor.v6.pool.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Discovery of device storage pools.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5daf9372f493406c818b27f5149dcff3','0','2','0'),
('47579','20','get[1.3.6.1.4.1.34774.4.1.1.3.0]','10636','Status','huawei.oceanstor.v6.status','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','0',NULL,'System status.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','4ad5a10227d74eaaaaf3678a6884b67d','0','2','0'),
('47580','20','get[1.3.6.1.4.1.34774.4.1.1.6.0]','10636','Version','huawei.oceanstor.v6.version','1m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'The device version.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3ed972a612394bf285f816debcd8e89a','0','2','0'),
('47581','3','','10636','ICMP ping','icmpping','1m','31d','365d','0','3','','','','',NULL,'1242','','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','590714e7fb3f4d468c19385146f76433','0','2','0'),
('47582','3','','10636','ICMP loss','icmppingloss','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3bcc87c0fee74e64be9b66cc9080008e','0','2','0'),
('47583','3','','10636','ICMP response time','icmppingsec','1m','31d','365d','0','0','','s','','',NULL,NULL,'','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','137b8177ba0b4949a895be9dde23400c','0','2','0'),
('47584','17','','10636','SNMP traps (fallback)','snmptrap.fallback','0','31d','0','0','2','','','','hh:mm:sszyyyy/MM/dd',NULL,NULL,'','','0','','','','','0',NULL,'The item is used to collect all SNMP traps unmatched by other snmptrap items','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2959893b639d457abb18a2b7e9abda23','0','2','0'),
('47585','20','1.3.6.1.2.1.1.4.0','10636','System contact details','system.contact[sysContact.0]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nThe textual identification of the contact person for this managed node, together with information on how to contact this person.  If no contact information is known, the value is the zero-length string.','23','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f80391019ebb4b18beb7a987c3a20830','0','2','0'),
('47586','20','1.3.6.1.2.1.1.1.0','10636','System description','system.descr[sysDescr.0]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nA textual description of the entity. This value should\r\ninclude the full name and version identification of the system\'s hardware type, software operating-system, and\r\nnetworking software.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','e7ddfe4774ad4ed7959d2e2200b50e8f','0','2','0'),
('47587','20','1.3.6.1.2.1.25.1.1.0','10636','Uptime (hardware)','system.hw.uptime[hrSystemUptime.0]','30s','31d','0','0','3','','uptime','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: HOST-RESOURCES-MIB\r\nThe amount of time since this host was last initialized. Note that this is different from sysUpTime in the SNMPv2-MIB [RFC1907] because sysUpTime is the uptime of the network management portion of the system.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','35b225e3dff343b0a0b82b8239d6bea3','0','2','0'),
('47588','20','1.3.6.1.2.1.1.6.0','10636','System location','system.location[sysLocation.0]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nPhysical location of the node (e.g., `equipment room`, `3rd floor`). If not provided, the value is a zero-length string.','24','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f0fa4b45ea2b41d0b0f40630680fb532','0','2','0'),
('47589','20','1.3.6.1.2.1.1.5.0','10636','System name','system.name','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nAn administratively-assigned name for this managed node.By convention, this is the node\'s fully-qualified domain name.  If the name is unknown, the value is the zero-length string.','3','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','494d880ba7be4d9fb641b148597f805d','0','2','0'),
('47590','20','1.3.6.1.2.1.1.3.0','10636','Uptime (network)','system.net.uptime[sysUpTime.0]','30s','31d','0','0','3','','uptime','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nTime (in hundredths of a second) since the network management portion of the system was last re-initialized.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','4371c836612f4456a6ce191af79a23a2','0','2','0'),
('47591','20','1.3.6.1.2.1.1.2.0','10636','System object ID','system.objectid[sysObjectID.0]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nThe vendor\'s authoritative identification of the network management subsystem contained in the entity.  This value is allocated within the SMI enterprises subtree (1.3.6.1.4.1) and provides an easy and unambiguous means for determining`what kind of box\' is being managed.  For example, if vendor`Flintstones, Inc.\' was assigned the subtree1.3.6.1.4.1.4242, it could assign the identifier 1.3.6.1.4.1.4242.1.1 to its `Fred Router\'.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','634f6b6a4e724c158ba4726f063a1684','0','2','0'),
('47592','5','','10636','SNMP agent availability','zabbix[host,snmp,available]','1m','31d','365d','0','3','','','','',NULL,'1243','','','0','','','','','0',NULL,'Availability of SNMP checks on the host. The value of this item corresponds to availability icons in the host list.\r\nPossible values:\r\n0 - not available\r\n1 - available\r\n2 - unknown','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','6816cad193a64edcbcf3f09d736eab9b','0','2','0'),
('47638','7','','10637','Service response time','net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"]','1m','31d','365d','0','0','','s','','',NULL,NULL,'','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3ac09d338f0847288eda20732bf5aa10','0','2','0'),
('47639','7','','10637','Service ping','net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"]','1m','31d','365d','0','3','','','','',NULL,'1244','','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','e4252071d0864fd5bf7c60c4d6e4915d','0','2','0'),
('47640','7','','10637','Get processes summary','proc.get[{$APACHE.PROCESS.NAME.PARAMETER},,,summary]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'The aggregated data of summary metrics for all processes.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','37f15f5a28364399aa66aad31d0acc08','0','2','0'),
('47641','7','','10637','Get status','web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]','1m','1h','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Getting data from a machine-readable version of the Apache status page.\r\nFor more information see Apache Module [mod_status](https://httpd.apache.org/docs/current/mod/mod_status.html).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','d103e519e5044dfd982d535a0981bc84','0','2','0'),
('47663','7','','10637','CPU utilization','proc.cpu.util[{#APACHE.NAME}]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','2',NULL,'The percentage of the CPU utilization by a process {#APACHE.NAME}.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b1e48077179f4e439e2d3c3b918c9a03','0','2','0'),
('47675','7','','10638','Get','web.certificate.get[{$CERT.WEBSITE.HOSTNAME},{$CERT.WEBSITE.PORT},{$CERT.WEBSITE.IP}]','15m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Returns the JSON with attributes of a certificate of the requested site.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','cfc056393df34d3ab8f66f1d1bfc7c0b','0','2','0'),
('47688','7','','10639','Service response time','net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"]','1m','31d','365d','0','0','','s','','',NULL,NULL,'','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','09762f260f544f57afa5157c6bc632a3','0','2','0'),
('47689','7','','10639','Service status','net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"]','1m','31d','365d','0','3','','','','',NULL,'1245','','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b68e4123d7c9483c9f77bc9c27fd0e7c','0','2','0'),
('47690','7','','10639','Get processes summary','proc.get[{$NGINX.PROCESS.NAME.PARAMETER},,,summary]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'The aggregated data of summary metrics for all processes.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','94bb17445cf14e909fede8b7060c0211','0','2','0'),
('47691','7','','10639','Get stub status page','web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]','1m','1h','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'The following status information is provided:\r\n`Active connections` - the current number of active client connections including waiting connections.\r\n`Accepted` - the total number of accepted client connections.\r\n`Handled` - the total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the `worker_connections` limit).\r\n`Requests` - the total number of client requests.\r\n`Reading` - the current number of connections where Nginx is reading the request header.\r\n`Writing` - the current number of connections where Nginx is writing a response back to the client.\r\n`Waiting` - the current number of idle client connections waiting for a request.\r\n\r\nSee also [Module ngx_http_stub_status_module](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','04ed4f82a84b4a81aa8d1682e7a70b5f','0','2','0'),
('47703','7','','10639','CPU utilization','proc.cpu.util[{#NGINX.NAME}]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','2',NULL,'The percentage of the CPU utilization by a process {#NGINX.NAME}.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','6045ce9aba4747f2a6a1475fc3f8b428','0','2','0'),
('47709','21','','10640','Get alert','nutanix.cluster.alert.get','1m','0','0','0','4','','','','',NULL,NULL,'var Nutanix = {\r\n	params: {},\r\n\r\n	setParams: function (requiredParams, allParams) {\r\n		requiredParams.forEach(function (field) {\r\n			if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		Nutanix.params = params;\r\n	},\r\n\r\n	request: function (url) {\r\n\r\n		var request = new HttpRequest();\r\n\r\n		if (typeof Nutanix.params.proxy !== \'undefined\' && Nutanix.params.proxy !== \'\') {\r\n			request.setProxy(Nutanix.params.proxy);\r\n		}\r\n\r\n		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Sending request: \' + url);\r\n\r\n		const response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.\';\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	deduplicateAlerts: function (full_data) {\r\n		const severity_mapping = [\r\n			\'kinfo\',\r\n			\'kwarning\',\r\n			\'kcritical\'\r\n		]\r\n\r\n		var output_data = {};\r\n		for (var entity in full_data.entities) {\r\n	\r\n			if (Nutanix.params.api_method === \'clusters\') {\r\n				if (result.entities[entity].node_uuid.split(\'-\').length == 5) continue;\r\n			}\r\n\r\n			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),\r\n				message = full_data.entities[entity].message,\r\n				title = full_data.entities[entity].alert_title;\r\n	\r\n			full_data.entities[entity].context_types.forEach(function(context, index) {\r\n				message = message.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n				title = title.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n			});\r\n	\r\n			key = md5(title + message);\r\n			if (key in output_data) {\r\n				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {\r\n					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;\r\n					output_data[key].severity = severity !== -1 ? severity : 3;\r\n					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;\r\n					output_data[key].message = full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message;\r\n					output_data[key].last_id = full_data.entities[entity].id;\r\n				}\r\n				output_data[key].count += 1;\r\n			} else {\r\n				output_data[key] = {\r\n					"name": title + \' - \' + message,\r\n					"title": title != \'\' ? title : message,\r\n					"created": full_data.entities[entity].created_time_stamp_in_usecs,\r\n					"severity": severity !== -1 ? severity : 3,\r\n					"state": full_data.entities[entity].resolved ? 0 : 1,\r\n					"message": full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message,\r\n					"last_id": full_data.entities[entity].id,\r\n					"count": 1\r\n				}\r\n			}\r\n		}\r\n\r\n		return output_data;\r\n	},\r\n\r\n	cleanUnsupported: function (full_stat) {\r\n		var output_stat = {};\r\n		for (var element in full_stat) {\r\n			if (full_stat[element] !== \'-1\') {\r\n				output_stat[element] = full_stat[element];\r\n			}\r\n		};\r\n		\r\n		return output_stat;\r\n	}\r\n};\r\n\r\ntry {\r\n	const params = JSON.parse(value);\r\n	Nutanix.setParams([\'endpoint_host\', \'endpoint_port\', \'username\', \'password\', \'auth_type\', \'api_method\', \'target_uuid\'], params);\r\n\r\n	const url = \'https://\' + Nutanix.params.endpoint_host + \':\' + Nutanix.params.endpoint_port + \'/PrismGateway/services/rest/v2.0/\' + Nutanix.params.api_method + \'/\' + Nutanix.params.target_uuid + \'/alerts\',\r\n		result = Nutanix.request(url);\r\n\r\n	return JSON.stringify(Nutanix.deduplicateAlerts(result));\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(4, \'[ Nutanix ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get data about alerts.','0','7d','0','',NULL,'{$NUTANIX.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','3761d4da912749c7a84f11a5cfbcf761','0','2','0'),
('47710','21','','10640','Get metric','nutanix.cluster.metric.get','1m','0','0','0','4','','','','',NULL,NULL,'var Nutanix = {\r\n	params: {},\r\n\r\n	setParams: function (requiredParams, allParams) {\r\n		requiredParams.forEach(function (field) {\r\n			if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		Nutanix.params = params;\r\n	},\r\n\r\n	request: function (url) {\r\n\r\n		var request = new HttpRequest();\r\n\r\n		if (typeof Nutanix.params.proxy !== \'undefined\' && Nutanix.params.proxy !== \'\') {\r\n			request.setProxy(Nutanix.params.proxy);\r\n		}\r\n\r\n		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Sending request: \' + url);\r\n\r\n		const response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.\';\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	deduplicateAlerts: function (full_data) {\r\n		const severity_mapping = [\r\n			\'kinfo\',\r\n			\'kwarning\',\r\n			\'kcritical\'\r\n		]\r\n\r\n		var output_data = {};\r\n		for (var entity in full_data.entities) {\r\n	\r\n			if (Nutanix.params.api_method === \'clusters\') {\r\n				if (result.entities[entity].node_uuid.split(\'-\').length == 5) continue;\r\n			}\r\n\r\n			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),\r\n				message = full_data.entities[entity].message,\r\n				title = full_data.entities[entity].alert_title;\r\n	\r\n			full_data.entities[entity].context_types.forEach(function(context, index) {\r\n				message = message.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n				title = title.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n			});\r\n	\r\n			key = md5(title + message);\r\n			if (key in output_data) {\r\n				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {\r\n					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;\r\n					output_data[key].severity = severity !== -1 ? severity : 3;\r\n					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;\r\n					output_data[key].message = full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message;\r\n					output_data[key].last_id = full_data.entities[entity].id;\r\n				}\r\n				output_data[key].count += 1;\r\n			} else {\r\n				output_data[key] = {\r\n					"name": title + \' - \' + message,\r\n					"title": title != \'\' ? title : message,\r\n					"created": full_data.entities[entity].created_time_stamp_in_usecs,\r\n					"severity": severity !== -1 ? severity : 3,\r\n					"state": full_data.entities[entity].resolved ? 0 : 1,\r\n					"message": full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message,\r\n					"last_id": full_data.entities[entity].id,\r\n					"count": 1\r\n				}\r\n			}\r\n		}\r\n\r\n		return output_data;\r\n	},\r\n\r\n	cleanUnsupported: function (full_stat) {\r\n		var output_stat = {};\r\n		for (var element in full_stat) {\r\n			if (full_stat[element] !== \'-1\') {\r\n				output_stat[element] = full_stat[element];\r\n			}\r\n		};\r\n		\r\n		return output_stat;\r\n	}\r\n};\r\n\r\ntry {\r\n	const params = JSON.parse(value);\r\n	Nutanix.setParams([\'endpoint_host\', \'endpoint_port\', \'username\', \'password\', \'auth_type\', \'api_method\', \'target_uuid\'], params);\r\n\r\n	const url = \'https://\' + Nutanix.params.endpoint_host + \':\' + Nutanix.params.endpoint_port + \'/PrismGateway/services/rest/v2.0/\' + Nutanix.params.api_method + \'/\' + Nutanix.params.target_uuid;\r\n	var result = Nutanix.request(url);\r\n\r\n	result.stats = Nutanix.cleanUnsupported(result.stats);\r\n\r\n	return JSON.stringify(result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(4, \'[ Nutanix ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get data about basic metrics.','0','7d','0','',NULL,'{$NUTANIX.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','95a5fd893da84a7098cba12ffa1743ca','0','2','0'),
('47711','21','','10641','Get alert','nutanix.host.alert.get','1m','0','0','0','4','','','','',NULL,NULL,'var Nutanix = {\r\n	params: {},\r\n\r\n	setParams: function (requiredParams, allParams) {\r\n		requiredParams.forEach(function (field) {\r\n			if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		Nutanix.params = params;\r\n	},\r\n\r\n	request: function (url) {\r\n\r\n		var request = new HttpRequest();\r\n\r\n		if (typeof Nutanix.params.proxy !== \'undefined\' && Nutanix.params.proxy !== \'\') {\r\n			request.setProxy(Nutanix.params.proxy);\r\n		}\r\n\r\n		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Sending request: \' + url);\r\n\r\n		const response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.\';\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	deduplicateAlerts: function (full_data) {\r\n		const severity_mapping = [\r\n			\'kinfo\',\r\n			\'kwarning\',\r\n			\'kcritical\'\r\n		]\r\n\r\n		var output_data = {};\r\n		for (var entity in full_data.entities) {\r\n	\r\n			if (Nutanix.params.api_method === \'clusters\') {\r\n				if (result.entities[entity].node_uuid.split(\'-\').length == 5) continue;\r\n			}\r\n\r\n			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),\r\n				message = full_data.entities[entity].message,\r\n				title = full_data.entities[entity].alert_title;\r\n	\r\n			full_data.entities[entity].context_types.forEach(function(context, index) {\r\n				message = message.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n				title = title.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n			});\r\n	\r\n			key = md5(title + message);\r\n			if (key in output_data) {\r\n				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {\r\n					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;\r\n					output_data[key].severity = severity !== -1 ? severity : 3;\r\n					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;\r\n					output_data[key].message = full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message;\r\n					output_data[key].last_id = full_data.entities[entity].id;\r\n				}\r\n				output_data[key].count += 1;\r\n			} else {\r\n				output_data[key] = {\r\n					"name": title + \' - \' + message,\r\n					"title": title != \'\' ? title : message,\r\n					"created": full_data.entities[entity].created_time_stamp_in_usecs,\r\n					"severity": severity !== -1 ? severity : 3,\r\n					"state": full_data.entities[entity].resolved ? 0 : 1,\r\n					"message": full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message,\r\n					"last_id": full_data.entities[entity].id,\r\n					"count": 1\r\n				}\r\n			}\r\n		}\r\n\r\n		return output_data;\r\n	},\r\n\r\n	cleanUnsupported: function (full_stat) {\r\n		var output_stat = {};\r\n		for (var element in full_stat) {\r\n			if (full_stat[element] !== \'-1\') {\r\n				output_stat[element] = full_stat[element];\r\n			}\r\n		};\r\n		\r\n		return output_stat;\r\n	}\r\n};\r\n\r\ntry {\r\n	const params = JSON.parse(value);\r\n	Nutanix.setParams([\'endpoint_host\', \'endpoint_port\', \'username\', \'password\', \'auth_type\', \'api_method\', \'target_uuid\'], params);\r\n\r\n	const url = \'https://\' + Nutanix.params.endpoint_host + \':\' + Nutanix.params.endpoint_port + \'/PrismGateway/services/rest/v2.0/\' + Nutanix.params.api_method + \'/\' + Nutanix.params.target_uuid + \'/alerts\',\r\n		result = Nutanix.request(url);\r\n\r\n	return JSON.stringify(Nutanix.deduplicateAlerts(result));\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(4, \'[ Nutanix ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get data about alerts.','0','7d','0','',NULL,'{$NUTANIX.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','48c5f1f6ea454fd69756268cd613129e','0','2','0'),
('47712','21','','10641','Get disk','nutanix.host.disk.get','1m','0','0','0','4','','','','',NULL,NULL,'var Nutanix = {\r\n	params: {},\r\n\r\n	setParams: function (requiredParams, allParams) {\r\n		requiredParams.forEach(function (field) {\r\n			if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		Nutanix.params = params;\r\n	},\r\n\r\n	request: function (url) {\r\n\r\n		var request = new HttpRequest();\r\n\r\n		if (typeof Nutanix.params.proxy !== \'undefined\' && Nutanix.params.proxy !== \'\') {\r\n			request.setProxy(Nutanix.params.proxy);\r\n		}\r\n\r\n		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Sending request: \' + url);\r\n\r\n		const response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.\';\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	deduplicateAlerts: function (full_data) {\r\n		const severity_mapping = [\r\n			\'kinfo\',\r\n			\'kwarning\',\r\n			\'kcritical\'\r\n		]\r\n\r\n		var output_data = {};\r\n		for (var entity in full_data.entities) {\r\n	\r\n			if (Nutanix.params.api_method === \'clusters\') {\r\n				if (result.entities[entity].node_uuid.split(\'-\').length == 5) continue;\r\n			}\r\n\r\n			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),\r\n				message = full_data.entities[entity].message,\r\n				title = full_data.entities[entity].alert_title;\r\n	\r\n			full_data.entities[entity].context_types.forEach(function(context, index) {\r\n				message = message.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n				title = title.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n			});\r\n	\r\n			key = md5(title + message);\r\n			if (key in output_data) {\r\n				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {\r\n					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;\r\n					output_data[key].severity = severity !== -1 ? severity : 3;\r\n					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;\r\n					output_data[key].message = full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message;\r\n					output_data[key].last_id = full_data.entities[entity].id;\r\n				}\r\n				output_data[key].count += 1;\r\n			} else {\r\n				output_data[key] = {\r\n					"name": title + \' - \' + message,\r\n					"title": title != \'\' ? title : message,\r\n					"created": full_data.entities[entity].created_time_stamp_in_usecs,\r\n					"severity": severity !== -1 ? severity : 3,\r\n					"state": full_data.entities[entity].resolved ? 0 : 1,\r\n					"message": full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message,\r\n					"last_id": full_data.entities[entity].id,\r\n					"count": 1\r\n				}\r\n			}\r\n		}\r\n\r\n		return output_data;\r\n	},\r\n\r\n	cleanUnsupported: function (full_stat) {\r\n		var output_stat = {};\r\n		for (var element in full_stat) {\r\n			if (full_stat[element] !== \'-1\') {\r\n				output_stat[element] = full_stat[element];\r\n			}\r\n		};\r\n		\r\n		return output_stat;\r\n	}\r\n};\r\n\r\ntry {\r\n	const params = JSON.parse(value);\r\n	Nutanix.setParams([\'endpoint_host\', \'endpoint_port\', \'username\', \'password\', \'auth_type\', \'api_method\', \'target_uuid\'], params);\r\n\r\n	const url = \'https://\' + Nutanix.params.endpoint_host + \':\' + Nutanix.params.endpoint_port + \'/PrismGateway/services/rest/v2.0/\' + Nutanix.params.api_method + \'?search_attribute_list=node_uuid&search_string=\' + Nutanix.params.target_uuid,\r\n		result = Nutanix.request(url);\r\n\r\n	var output_data = {};\r\n	for (var entity in result.entities) {\r\n		output_data[result.entities[entity].id] = result.entities[entity]\r\n	}\r\n\r\n	return JSON.stringify(output_data);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(4, \'[ Nutanix ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get data about installed disks.','0','7d','0','',NULL,'{$NUTANIX.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','a3a11c42c9da4eecb0aefa20792d4514','0','2','0'),
('47713','21','','10641','Get metric','nutanix.host.metric.get','1m','0','0','0','4','','','','',NULL,NULL,'var Nutanix = {\r\n	params: {},\r\n\r\n	setParams: function (requiredParams, allParams) {\r\n		requiredParams.forEach(function (field) {\r\n			if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		Nutanix.params = params;\r\n	},\r\n\r\n	request: function (url) {\r\n\r\n		var request = new HttpRequest();\r\n\r\n		if (typeof Nutanix.params.proxy !== \'undefined\' && Nutanix.params.proxy !== \'\') {\r\n			request.setProxy(Nutanix.params.proxy);\r\n		}\r\n\r\n		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Sending request: \' + url);\r\n\r\n		const response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.\';\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	deduplicateAlerts: function (full_data) {\r\n		const severity_mapping = [\r\n			\'kinfo\',\r\n			\'kwarning\',\r\n			\'kcritical\'\r\n		]\r\n\r\n		var output_data = {};\r\n		for (var entity in full_data.entities) {\r\n	\r\n			if (Nutanix.params.api_method === \'clusters\') {\r\n				if (result.entities[entity].node_uuid.split(\'-\').length == 5) continue;\r\n			}\r\n\r\n			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),\r\n				message = full_data.entities[entity].message,\r\n				title = full_data.entities[entity].alert_title;\r\n	\r\n			full_data.entities[entity].context_types.forEach(function(context, index) {\r\n				message = message.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n				title = title.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n			});\r\n	\r\n			key = md5(title + message);\r\n			if (key in output_data) {\r\n				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {\r\n					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;\r\n					output_data[key].severity = severity !== -1 ? severity : 3;\r\n					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;\r\n					output_data[key].message = full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message;\r\n					output_data[key].last_id = full_data.entities[entity].id;\r\n				}\r\n				output_data[key].count += 1;\r\n			} else {\r\n				output_data[key] = {\r\n					"name": title + \' - \' + message,\r\n					"title": title != \'\' ? title : message,\r\n					"created": full_data.entities[entity].created_time_stamp_in_usecs,\r\n					"severity": severity !== -1 ? severity : 3,\r\n					"state": full_data.entities[entity].resolved ? 0 : 1,\r\n					"message": full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message,\r\n					"last_id": full_data.entities[entity].id,\r\n					"count": 1\r\n				}\r\n			}\r\n		}\r\n\r\n		return output_data;\r\n	},\r\n\r\n	cleanUnsupported: function (full_stat) {\r\n		var output_stat = {};\r\n		for (var element in full_stat) {\r\n			if (full_stat[element] !== \'-1\') {\r\n				output_stat[element] = full_stat[element];\r\n			}\r\n		};\r\n		\r\n		return output_stat;\r\n	}\r\n};\r\n\r\ntry {\r\n	const params = JSON.parse(value);\r\n	Nutanix.setParams([\'endpoint_host\', \'endpoint_port\', \'username\', \'password\', \'auth_type\', \'api_method\', \'target_uuid\'], params);\r\n\r\n	const url = \'https://\' + Nutanix.params.endpoint_host + \':\' + Nutanix.params.endpoint_port + \'/PrismGateway/services/rest/v2.0/\' + Nutanix.params.api_method + \'/\' + Nutanix.params.target_uuid;\r\n	var result = Nutanix.request(url);\r\n\r\n	result.stats = Nutanix.cleanUnsupported(result.stats);\r\n\r\n	return JSON.stringify(result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(4, \'[ Nutanix ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get data about basic metrics.','0','7d','0','',NULL,'{$NUTANIX.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','30b4da75a8f54b5385310b43fa6a2a7a','0','2','0'),
('47714','21','','10642','Get cluster','nutanix.cluster.get','10m','0','0','0','4','','','','',NULL,NULL,'var Nutanix = {\r\n	params: {},\r\n\r\n	setParams: function (requiredParams, allParams) {\r\n		requiredParams.forEach(function (field) {\r\n			if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		Nutanix.params = params;\r\n	},\r\n\r\n	request: function (url) {\r\n\r\n		var request = new HttpRequest();\r\n\r\n		if (typeof Nutanix.params.proxy !== \'undefined\' && Nutanix.params.proxy !== \'\') {\r\n			request.setProxy(Nutanix.params.proxy);\r\n		}\r\n\r\n		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Sending request: \' + url);\r\n\r\n		const response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.\';\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	deduplicateAlerts: function (full_data) {\r\n		const severity_mapping = [\r\n			\'kinfo\',\r\n			\'kwarning\',\r\n			\'kcritical\'\r\n		]\r\n\r\n		var output_data = {};\r\n		for (var entity in full_data.entities) {\r\n	\r\n			if (Nutanix.params.api_method === \'clusters\') {\r\n				if (result.entities[entity].node_uuid.split(\'-\').length == 5) continue;\r\n			}\r\n\r\n			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),\r\n				message = full_data.entities[entity].message,\r\n				title = full_data.entities[entity].alert_title;\r\n	\r\n			full_data.entities[entity].context_types.forEach(function(context, index) {\r\n				message = message.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n				title = title.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n			});\r\n	\r\n			key = md5(title + message);\r\n			if (key in output_data) {\r\n				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {\r\n					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;\r\n					output_data[key].severity = severity !== -1 ? severity : 3;\r\n					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;\r\n					output_data[key].message = full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message;\r\n					output_data[key].last_id = full_data.entities[entity].id;\r\n				}\r\n				output_data[key].count += 1;\r\n			} else {\r\n				output_data[key] = {\r\n					"name": title + \' - \' + message,\r\n					"title": title != \'\' ? title : message,\r\n					"created": full_data.entities[entity].created_time_stamp_in_usecs,\r\n					"severity": severity !== -1 ? severity : 3,\r\n					"state": full_data.entities[entity].resolved ? 0 : 1,\r\n					"message": full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message,\r\n					"last_id": full_data.entities[entity].id,\r\n					"count": 1\r\n				}\r\n			}\r\n		}\r\n\r\n		return output_data;\r\n	},\r\n\r\n	cleanUnsupported: function (full_stat) {\r\n		var output_stat = {};\r\n		for (var element in full_stat) {\r\n			if (full_stat[element] !== \'-1\') {\r\n				output_stat[element] = full_stat[element];\r\n			}\r\n		};\r\n		\r\n		return output_stat;\r\n	}\r\n};\r\n\r\ntry {\r\n	const params = JSON.parse(value);\r\n	Nutanix.setParams([\'endpoint_host\', \'endpoint_port\', \'username\', \'password\', \'auth_type\', \'api_method\'], params);\r\n\r\n	const url = \'https://\' + Nutanix.params.endpoint_host + \':\' + Nutanix.params.endpoint_port + \'/PrismGateway/services/rest/v2.0/\' + Nutanix.params.api_method,\r\n		result = Nutanix.request(url);\r\n\r\n	return JSON.stringify(result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(4, \'[ Nutanix ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get the available clusters.','0','7d','0','',NULL,'10s','','','','200','1','0','','','0','0','0','0','0','0','0','0c073836f90a4072be7acfc5d1a96b9e','0','2','0'),
('47715','21','','10642','Get host','nutanix.host.get','10m','0','0','0','4','','','','',NULL,NULL,'var Nutanix = {\r\n	params: {},\r\n\r\n	setParams: function (requiredParams, allParams) {\r\n		requiredParams.forEach(function (field) {\r\n			if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		Nutanix.params = params;\r\n	},\r\n\r\n	request: function (url) {\r\n\r\n		var request = new HttpRequest();\r\n\r\n		if (typeof Nutanix.params.proxy !== \'undefined\' && Nutanix.params.proxy !== \'\') {\r\n			request.setProxy(Nutanix.params.proxy);\r\n		}\r\n\r\n		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Sending request: \' + url);\r\n\r\n		const response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.\';\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	deduplicateAlerts: function (full_data) {\r\n		const severity_mapping = [\r\n			\'kinfo\',\r\n			\'kwarning\',\r\n			\'kcritical\'\r\n		]\r\n\r\n		var output_data = {};\r\n		for (var entity in full_data.entities) {\r\n	\r\n			if (Nutanix.params.api_method === \'clusters\') {\r\n				if (result.entities[entity].node_uuid.split(\'-\').length == 5) continue;\r\n			}\r\n\r\n			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),\r\n				message = full_data.entities[entity].message,\r\n				title = full_data.entities[entity].alert_title;\r\n	\r\n			full_data.entities[entity].context_types.forEach(function(context, index) {\r\n				message = message.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n				title = title.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n			});\r\n	\r\n			key = md5(title + message);\r\n			if (key in output_data) {\r\n				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {\r\n					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;\r\n					output_data[key].severity = severity !== -1 ? severity : 3;\r\n					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;\r\n					output_data[key].message = full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message;\r\n					output_data[key].last_id = full_data.entities[entity].id;\r\n				}\r\n				output_data[key].count += 1;\r\n			} else {\r\n				output_data[key] = {\r\n					"name": title + \' - \' + message,\r\n					"title": title != \'\' ? title : message,\r\n					"created": full_data.entities[entity].created_time_stamp_in_usecs,\r\n					"severity": severity !== -1 ? severity : 3,\r\n					"state": full_data.entities[entity].resolved ? 0 : 1,\r\n					"message": full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message,\r\n					"last_id": full_data.entities[entity].id,\r\n					"count": 1\r\n				}\r\n			}\r\n		}\r\n\r\n		return output_data;\r\n	},\r\n\r\n	cleanUnsupported: function (full_stat) {\r\n		var output_stat = {};\r\n		for (var element in full_stat) {\r\n			if (full_stat[element] !== \'-1\') {\r\n				output_stat[element] = full_stat[element];\r\n			}\r\n		};\r\n		\r\n		return output_stat;\r\n	}\r\n};\r\n\r\ntry {\r\n	const params = JSON.parse(value);\r\n	Nutanix.setParams([\'endpoint_host\', \'endpoint_port\', \'username\', \'password\', \'auth_type\', \'api_method\'], params);\r\n\r\n	const url = \'https://\' + Nutanix.params.endpoint_host + \':\' + Nutanix.params.endpoint_port + \'/PrismGateway/services/rest/v2.0/\' + Nutanix.params.api_method,\r\n		result = Nutanix.request(url);\r\n\r\n	return JSON.stringify(result);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(4, \'[ Nutanix ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get the available hosts.','0','7d','0','',NULL,'10s','','','','200','1','0','','','0','0','0','0','0','0','0','06ce8fe78e9642cfb2064ad2aa25b50e','0','2','0'),
('47716','21','','10642','Get storage container','nutanix.storage.container.get','10m','0','0','0','4','','','','',NULL,NULL,'var Nutanix = {\r\n	params: {},\r\n\r\n	setParams: function (requiredParams, allParams) {\r\n		requiredParams.forEach(function (field) {\r\n			if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		Nutanix.params = params;\r\n	},\r\n\r\n	request: function (url) {\r\n\r\n		var request = new HttpRequest();\r\n\r\n		if (typeof Nutanix.params.proxy !== \'undefined\' && Nutanix.params.proxy !== \'\') {\r\n			request.setProxy(Nutanix.params.proxy);\r\n		}\r\n\r\n		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Sending request: \' + url);\r\n\r\n		const response = request.get(url);\r\n\r\n		Zabbix.log(4, \'[ Nutanix ] Received response with status code \' + request.getStatus() + \': \' + response);\r\n\r\n		if (request.getStatus() < 200 || request.getStatus() >= 300) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.\';\r\n		}\r\n\r\n		return response;\r\n	},\r\n\r\n	deduplicateAlerts: function (full_data) {\r\n		const severity_mapping = [\r\n			\'kinfo\',\r\n			\'kwarning\',\r\n			\'kcritical\'\r\n		]\r\n\r\n		var output_data = {};\r\n		for (var entity in full_data.entities) {\r\n	\r\n			if (Nutanix.params.api_method === \'clusters\') {\r\n				if (result.entities[entity].node_uuid.split(\'-\').length == 5) continue;\r\n			}\r\n\r\n			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),\r\n				message = full_data.entities[entity].message,\r\n				title = full_data.entities[entity].alert_title;\r\n	\r\n			full_data.entities[entity].context_types.forEach(function(context, index) {\r\n				message = message.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n				title = title.replace(\'{\' + context + \'}\', full_data.entities[entity].context_values[index]);\r\n			});\r\n	\r\n			key = md5(title + message);\r\n			if (key in output_data) {\r\n				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {\r\n					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;\r\n					output_data[key].severity = severity !== -1 ? severity : 3;\r\n					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;\r\n					output_data[key].message = full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message;\r\n					output_data[key].last_id = full_data.entities[entity].id;\r\n				}\r\n				output_data[key].count += 1;\r\n			} else {\r\n				output_data[key] = {\r\n					"name": title + \' - \' + message,\r\n					"title": title != \'\' ? title : message,\r\n					"created": full_data.entities[entity].created_time_stamp_in_usecs,\r\n					"severity": severity !== -1 ? severity : 3,\r\n					"state": full_data.entities[entity].resolved ? 0 : 1,\r\n					"message": full_data.entities[entity].detailed_message != \'\' ? full_data.entities[entity].detailed_message : message,\r\n					"last_id": full_data.entities[entity].id,\r\n					"count": 1\r\n				}\r\n			}\r\n		}\r\n\r\n		return output_data;\r\n	},\r\n\r\n	cleanUnsupported: function (full_stat) {\r\n		var output_stat = {};\r\n		for (var element in full_stat) {\r\n			if (full_stat[element] !== \'-1\') {\r\n				output_stat[element] = full_stat[element];\r\n			}\r\n		};\r\n		\r\n		return output_stat;\r\n	}\r\n};\r\n\r\ntry {\r\n	const params = JSON.parse(value);\r\n	Nutanix.setParams([\'endpoint_host\', \'endpoint_port\', \'username\', \'password\', \'auth_type\', \'api_method\'], params);\r\n\r\n	const url = \'https://\' + Nutanix.params.endpoint_host + \':\' + Nutanix.params.endpoint_port + \'/PrismGateway/services/rest/v2.0/\' + Nutanix.params.api_method,\r\n		result = Nutanix.request(url);\r\n\r\n	var output_data = {};\r\n	for (var entity in result.entities) {\r\n		output_data[result.entities[entity].storage_container_uuid] = result.entities[entity]\r\n	}\r\n\r\n	return JSON.stringify(output_data);\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(4, \'[ Nutanix ] ERROR: \' + error);\r\n\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Get the available storage containers.','0','7d','0','',NULL,'10s','','','','200','1','0','','','0','0','0','0','0','0','0','10cd43e73f1146cf8eb4bffd33978344','0','2','0'),
('47958','15','','10645','Queue usage','php-fpm.listen_queue_usage','1m','31d','365d','0','0','','%','','',NULL,NULL,'last(//php-fpm.listen_queue)/(last(//php-fpm.listen_queue_len)+(last(//php-fpm.listen_queue_len)=0))*100','','0','','','','','0',NULL,'The utilization of the queue.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','bea3630fd88448228cd3e6b5808bac5f','0','2','0'),
('47959','7','','10645','Get processes summary','proc.get[{$PHP_FPM.PROCESS.NAME.PARAMETER},,,summary]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'The aggregated data of summary metrics for all processes.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2e72b191ec3b481f800e100e69a85691','0','2','0'),
('47960','7','','10645','php-fpm_ping','web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ca300d24e4434dd8bc5e86ea859eb9f6','0','2','0'),
('47961','7','','10645','Get status page','web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','de356fd730494b27a701cb900cd5c9b1','0','2','0'),
('47979','7','','10645','CPU utilization','proc.cpu.util[{#PHP_FPM.NAME}]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','2',NULL,'The percentage of the CPU utilization by a process `{#PHP_FPM.NAME}`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','65c8bd5634d84552b401c15237b74de8','0','2','0'),
('47987','15','','10646','Buffer pool efficiency','mysql.buffer_pool_efficiency','1m','31d','365d','0','0','','%','','',NULL,NULL,'last(//mysql.innodb_buffer_pool_reads) / \r\n( last(//mysql.innodb_buffer_pool_read_requests) + \r\n( last(//mysql.innodb_buffer_pool_read_requests) = 0 ) ) * 100 * \r\n( last(//mysql.innodb_buffer_pool_read_requests) > 0 )','','0','','','','','0',NULL,'The item shows how effectively the buffer pool is serving reads.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','82d31eef03914d4abde2448691d89a7a','0','2','0'),
('47988','15','','10646','Buffer pool utilization','mysql.buffer_pool_utilization','1m','31d','365d','0','0','','%','','',NULL,NULL,'( last(//mysql.innodb_buffer_pool_pages_total) - \r\nlast(//mysql.innodb_buffer_pool_pages_free) ) / \r\n( last(//mysql.innodb_buffer_pool_pages_total) + \r\n( last(//mysql.innodb_buffer_pool_pages_total) = 0 ) ) * 100 * \r\n( last(//mysql.innodb_buffer_pool_pages_total) > 0 )','','0','','','','','0',NULL,'Ratio of used to total pages in the buffer pool.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','9fa2d2ebecaa4ff4bf2ec01a68cdf2a2','0','2','0'),
('47989','7','','10646','Get status variables','mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Gets server global status information.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b942938fd6564e3cbcc37c11f59b2bed','0','2','0'),
('47990','15','','10646','Calculated value of innodb_log_file_size','mysql.innodb_log_file_size','1m','31d','365d','0','0','','','','',NULL,NULL,'(last(//mysql.innodb_os_log_written) - last(//mysql.innodb_os_log_written,#1:now-1h)) / {$MYSQL.INNODB_LOG_FILES}','','0','','','','','0',NULL,'`Innodb_log_file_size` is calculated as: (`innodb_os_log_written`-`innodb_os_log_written`(time shift -1h))/`{$MYSQL.INNODB_LOG_FILES}`. `Innodb_log_file_size` is the size in bytes of the each InnoDB redo log file in the log group. The combined size can be no more than 512 GB. Larger values mean less disk I/O due to less flushing checkpoint activity, but also slower recovery from a crash.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','c9e2183fde7d4fff96bd837c362c43e6','0','2','0'),
('47991','7','','10646','Status','mysql.ping["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]','1m','31d','365d','0','3','','','','',NULL,'1259','','','0','','','','','0',NULL,'MySQL server status.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','338507e500574423915f798234c7f239','0','2','0'),
('47992','7','','10646','Version','mysql.version["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MySQL server version.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','674df57b5295448c89a7265902cc94ec','0','2','0'),
('48035','7','','10646','Database discovery','mysql.db.discovery["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','','','','','1',NULL,'Scanning databases in DBMS.','0','7d','1','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','1d8d7069e0064521b52b388e0c6bc0a7','0','2','0'),
('48037','7','','10646','Replication discovery','mysql.replication.discovery["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','','','','','1',NULL,'If "show slave status" returns Master_Host, "Replication: *" items are created.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','aaf6d2423fb34bef850be2d1be3fc36a','0','2','0'),
('48038','7','','10646','Size of database {#DATABASE}','mysql.db.size["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#DATABASE}"]','5m','31d','365d','0','3','','B','','',NULL,NULL,'','','0','','','','','2',NULL,'Database size.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f69eb8da26de4abb92cec75161e703f3','0','2','0'),
('48039','7','','10646','Replication Slave status {#MASTER_HOST}','mysql.replication.get_slave_status["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#MASTER_HOST}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','2',NULL,'The item gets status information on the essential parameters of the slave threads.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','6284876731214fb8bf51f09dd40cf5fe','0','2','0'),
('48049','15','','10647','Buffer pool efficiency','mysql.buffer_pool_efficiency','1m','31d','365d','0','0','','%','','',NULL,NULL,'last(//mysql.innodb_buffer_pool_reads) / \r\n( last(//mysql.innodb_buffer_pool_read_requests) + \r\n( last(//mysql.innodb_buffer_pool_read_requests) = 0 ) ) * 100 * \r\n( last(//mysql.innodb_buffer_pool_read_requests) > 0 )','','0','','','','','0',NULL,'The item shows how effectively the buffer pool is serving reads.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','6179105b341e41e892398649eec227bb','0','2','0'),
('48050','15','','10647','Buffer pool utilization','mysql.buffer_pool_utilization','1m','31d','365d','0','0','','%','','',NULL,NULL,'( last(//mysql.innodb_buffer_pool_pages_total) - \r\nlast(//mysql.innodb_buffer_pool_pages_free) ) / \r\n( last(//mysql.innodb_buffer_pool_pages_total) + \r\n( last(//mysql.innodb_buffer_pool_pages_total) = 0 ) ) * 100 * \r\n( last(//mysql.innodb_buffer_pool_pages_total) > 0 )','','0','','','','','0',NULL,'Ratio of used to total pages in the buffer pool.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','427ee34312ca4fb595b71db9a350b1fc','0','2','0'),
('48051','7','','10647','Get status variables','mysql.get_status_variables["{$MYSQL.HOST}","{$MYSQL.PORT}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Gets server global status information.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','202cc1174b7f4b63a8c90bdc54ec2bb2','0','2','0'),
('48052','15','','10647','Calculated value of innodb_log_file_size','mysql.innodb_log_file_size','1m','31d','365d','0','0','','','','',NULL,NULL,'(last(//mysql.innodb_os_log_written) - last(//mysql.innodb_os_log_written,#1:now-1h)) / {$MYSQL.INNODB_LOG_FILES}','','0','','','','','0',NULL,'`Innodb_log_file_size` is calculated as: (`innodb_os_log_written`-`innodb_os_log_written`(time shift -1h))/`{$MYSQL.INNODB_LOG_FILES}`. `Innodb_log_file_size` is the size in bytes of the each InnoDB redo log file in the log group. The combined size can be no more than 512 GB. Larger values mean less disk I/O due to less flushing checkpoint activity, but also slower recovery from a crash.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8ce62d571e854df187d201bd4a7ccce1','0','2','0'),
('48053','7','','10647','Status','mysql.ping["{$MYSQL.HOST}","{$MYSQL.PORT}"]','1m','31d','365d','0','3','','','','',NULL,'1260','','','0','','','','','0',NULL,'MySQL server status.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ca43acd282a8435884b33af454b207fb','0','2','0'),
('48054','7','','10647','Version','mysql.version["{$MYSQL.HOST}","{$MYSQL.PORT}"]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MySQL server version.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2071500ce5ac486fa322fbab8acac046','0','2','0'),
('48097','7','','10647','Database discovery','mysql.db.discovery["{$MYSQL.HOST}","{$MYSQL.PORT}"]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','','','','','1',NULL,'Scanning databases in DBMS.','0','7d','1','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5f6d9b9473494b6d8a9bd0f75211ffac','0','2','0'),
('48099','7','','10647','Replication discovery','mysql.replication.discovery["{$MYSQL.HOST}","{$MYSQL.PORT}"]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','','','','','1',NULL,'If "show slave status" returns Master_Host, "Replication: *" items are created.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','af8c7f2a0fe7405194887397ee722e47','0','2','0'),
('48100','7','','10647','Size of database {#DBNAME}','mysql.dbsize["{$MYSQL.HOST}","{$MYSQL.PORT}","{#DBNAME}"]','5m','31d','365d','0','3','','B','','',NULL,NULL,'','','0','','','','','2',NULL,'Database size.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','def6d1e8f3584454b70fb11d99cb30d0','0','2','0'),
('48101','7','','10647','Replication Slave status {#MASTER_HOST}','mysql.slave_status["{$MYSQL.HOST}","{$MYSQL.PORT}","{#MASTER_HOST}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','2',NULL,'The item gets status information on the essential parameters of the slave threads.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2a9a2449f0b945afb2b16a1f744ffaef','0','2','0'),
('48111','7','','10648','Get archive','pgsql.archive["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect archive status metrics.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','218b03c8bfb84b07ae0ec9ba0932fff3','0','2','0'),
('48112','7','','10648','Count of autovacuum workers','pgsql.autovacuum.count["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Number of autovacuum workers.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','bc14c8544eed47ce9510a803be5708d7','0','2','0'),
('48113','7','','10648','Get bgwriter','pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics from pg_stat_bgwriter:\r\nhttps://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-BGWRITER-VIEW','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8d0dd45f06974d6b8be9cc11404ac1c3','0','2','0'),
('48114','15','','10648','Cache hit ratio, %','pgsql.cache.hit','1m','31d','365d','0','0','','%','','',NULL,NULL,'last(//pgsql.dbstat.sum.blks_hit.rate) * 100 / (last(//pgsql.dbstat.sum.blks_hit.rate) + last(//pgsql.dbstat.sum.blks_read.rate))','','0','','','','','0',NULL,'Cache hit ratio.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','7b701ad8f20a44958956a6cbfd4e5da2','0','2','0'),
('48115','7','','10648','Get connections sum','pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics from pg_stat_activity:\r\nhttps://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','52d9d2342b9c40a2b279dcbe4bcff023','0','2','0'),
('48116','7','','10648','Custom queries','pgsql.custom.query["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}",""]','1m','1h','0','1','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Execute custom queries from file *.sql (check for option Plugins.Postgres.CustomQueriesPath at agent configuration).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','defcba230619484db1a7d6faace8b33d','0','2','0'),
('48117','7','','10648','Get dbstat sum','pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics from pg_stat_database as sums for all databases:\r\nhttps://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8d84c4ec8d05427f9da4b9a1904a0af4','0','2','0'),
('48118','7','','10648','Get dbstat','pgsql.dbstat["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics from pg_stat_database per database:\r\nhttps://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','e36f2b3e33e2435d9b95472a7844a1a4','0','2','0'),
('48119','7','','10648','Get locks','pgsql.locks["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics from pg_locks per database:\r\nhttps://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','df19db910015411996e25ea5b48f0742','0','2','0'),
('48120','7','','10648','Age of oldest xid','pgsql.oldest.xid["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','0','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Age of oldest xid.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','1a32b0308496460b83ad2698edb21420','0','2','0'),
('48121','7','','10648','Ping','pgsql.ping["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,'1264','','','0','','','','','0',NULL,'Used to test a connection to see if it is alive. It is set to 0 if the query is unsuccessful.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','52edd592df6f49df9bf46b5e93689a1a','0','2','0'),
('48122','7','','10648','Get queries','pgsql.queries["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}","{$PG.QUERY_ETIME.MAX.WARN}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics by query execution time.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','060c0efaf60944538bf5fb6ca2828dc6','0','2','0'),
('48123','7','','10648','Replication: Standby count','pgsql.replication.count["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Number of standby servers.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f15d0758764c4bd6b607335d9d57b76b','0','2','0'),
('48124','7','','10648','Replication: Lag in bytes','pgsql.replication.lag.b["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','B','','',NULL,NULL,'','','0','','','','','0',NULL,'Replication lag with master, in bytes.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','a3297ef8198145848d4e3b16b7b8eb8b','0','2','0'),
('48125','7','','10648','Replication: Lag in seconds','pgsql.replication.lag.sec["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','s','','',NULL,NULL,'','','0','','','','','0',NULL,'Replication lag with master, in seconds.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','142e93b332e24ecfbd50465bb4af91e7','0','2','0'),
('48126','7','','10648','Get replication','pgsql.replication.process["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect metrics from the pg_stat_replication, which contains information about the WAL sender process, showing statistics about replication to that sender\'s connected standby server.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','aa03fb9cabd8459ea5f5efb90c9e1051','0','2','0'),
('48127','7','','10648','Replication: Recovery role','pgsql.replication.recovery_role["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,'1262','','','0','','','','','0',NULL,'Replication role: 1 — recovery is still in progress (standby mode), 0 — master mode.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','226bcc226ffc487ba90d998a03692404','0','2','0'),
('48128','7','','10648','Replication: Status','pgsql.replication.status["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,'1263','','','0','','','','','0',NULL,'Replication status: 0 — streaming is down, 1 — streaming is up, 2 — master mode.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ef2ac5eaf73c40e09af41bba03b4fac8','0','2','0'),
('48129','7','','10648','Uptime','pgsql.uptime["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','0','','s','','',NULL,NULL,'','','0','','','','','0',NULL,'Time since the server started.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','46b53fcf97a74619a03c2490fe9b71ea','0','2','0'),
('48130','7','','10648','Version','pgsql.version["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'PostgreSQL version.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','7a96feee8118450e83e994be87bc5eea','0','2','0'),
('48131','7','','10648','Get WAL','pgsql.wal.stat["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','5m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect write-ahead log (WAL) metrics.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','cb2a0f990a39411e9d3c7d95cc7504ee','0','2','0'),
('48176','7','','10648','Database discovery','pgsql.db.discovery["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','','','','','1',NULL,'Discovers databases (DB) in the database management system (DBMS), except:\r\n- templates;\r\n- DBs that do not allow connections.','0','7d','1','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','c5a95125be304bbeba407ce926ad7816','0','2','0'),
('48177','7','','10648','Replication discovery','pgsql.replication.process.discovery["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','15m','31d','365d','0','4','','','','',NULL,NULL,'','','0','','','','','1',NULL,'Discovers replication lag metrics.','0','7d','1','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','92ba6c1b038a454d8d8d40399d0967d8','0','2','0'),
('48178','7','','10648','DB [{#DBNAME}]: Database age','pgsql.db.age["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]','10m','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','2',NULL,'Database age.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','7df48c3384b14356903c38b3b0e1c435','0','2','0'),
('48179','7','','10648','DB [{#DBNAME}]: Bloating tables','pgsql.db.bloating_tables["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','2',NULL,'Number of bloating tables.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','cd5516d8ea994a9e86aff2081d611176','0','2','0'),
('48180','7','','10648','DB [{#DBNAME}]: Database size','pgsql.db.size["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]','5m','31d','365d','0','3','','B','','',NULL,NULL,'','','0','','','','','2',NULL,'Database size.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f2d58306483d4bb4a215e245f133b4ad','0','2','0'),
('48223','7','','10649','Get bgwriter','pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','1h','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics from pg_stat_bgwriter:\r\nhttps://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-BGWRITER-VIEW','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','08043026cea14053a0addd4bdb7b7b8d','0','2','0'),
('48224','7','','10649','Cache hit ratio, %','pgsql.cache.hit["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'Cache hit ratio.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','934e6647557f41cba46532a5a5c5d2ea','0','2','0'),
('48225','7','','10649','Config hash','pgsql.config.hash["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','15m','31d','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'PostgreSQL configuration hash.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2d028578428949da8fa05d1f62f9f615','0','2','0'),
('48226','7','','10649','Get connections sum','pgsql.connections.sum["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics from pg_stat_activity:\r\nhttps://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','13cce1cb170f4c9db977cb49fc603f79','0','2','0'),
('48227','7','','10649','Get dbstat','pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics from pg_stat_database per database:\r\nhttps://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','bea2e947b16b4a3dac660e664a505904','0','2','0'),
('48228','7','','10649','Get locks','pgsql.locks["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics from pg_locks per database:\r\nhttps://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','e5adbe1c2fc74943926cf45ff5efbff3','0','2','0'),
('48229','7','','10649','Ping time','pgsql.ping.time["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','0','','s','','',NULL,NULL,'','','0','','','','','0',NULL,'Used to get the `SELECT 1` query execution time.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2ab77e9548014233b0945bdeb9c134bd','0','2','0'),
('48230','7','','10649','Ping','pgsql.ping["{$PG.HOST}","{$PG.PORT}"]','1m','31d','365d','0','3','','','','',NULL,'1267','','','0','','','','','0',NULL,'Used to test a connection to see if it is alive. It is set to 0 if the instance doesn\'t accept the connections.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','058b3cd8308b4692a5cb3e89a47886bd','0','2','0'),
('48231','7','','10649','Get queries','pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}","{$PG.QUERY_ETIME.MAX.WARN}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect all metrics by query execution time.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2a4de36d7b434260b264a63ab444a430','0','2','0'),
('48232','7','','10649','Replication: Standby count','pgsql.replication.count["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Number of standby servers.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','401331b4eab0439ca954551bce2f0c2e','0','2','0'),
('48233','7','','10649','Replication: Lag in seconds','pgsql.replication.lag.sec["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','s','','',NULL,NULL,'','','0','','','','','0',NULL,'Replication lag with master, in seconds.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2005dff88ab64458b3970a40e5bf0aff','0','2','0'),
('48234','7','','10649','Replication: Recovery role','pgsql.replication.recovery_role["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,'1265','','','0','','','','','0',NULL,'Replication role: 1 — recovery is still in progress (standby mode), 0 — master mode.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','808f71865b934ac68512a3d6fa8b4aab','0','2','0'),
('48235','7','','10649','Replication: Status','pgsql.replication.status["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,'1266','','','0','','','','','0',NULL,'Replication status: 0 — streaming is down, 1 — streaming is up, 2 — master mode.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5c4061c4081d41fa86741a296378d031','0','2','0'),
('48236','7','','10649','Get transactions','pgsql.transactions["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect metrics by transaction execution time.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b22ed1707bd84c4faa010803b2c594fa','0','2','0'),
('48237','7','','10649','Uptime','pgsql.uptime["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','uptime','','',NULL,NULL,'','','0','','','','','0',NULL,'Time since the server started.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','d310b47d3e38466a980494fb0f9dfb01','0','2','0'),
('48238','7','','10649','Version','pgsql.version["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'PostgreSQL version.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','9798496e21914a8cbdee1cd85decf3e8','0','2','0'),
('48239','7','','10649','Get WAL','pgsql.wal.stat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','5m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Collect write-ahead log (WAL) metrics.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','9ca8653ea8304b5392d1c39111381751','0','2','0'),
('48263','7','','10649','Database discovery','pgsql.discovery.db["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1h','31d','365d','0','4','','','','',NULL,NULL,'','','0','','','','','1',NULL,'Discovers databases (DB) in the database management system (DBMS), except:\r\n- templates;\r\n- default "postgres" DB;\r\n- DBs that do not allow connections.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','d9625ea888804a8b82d395e1e002c6cd','0','2','0'),
('48264','7','','10649','DB [{#DBNAME}]: Database size','pgsql.db.size["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}","{#DBNAME}"]','15m','31d','365d','0','3','','B','','',NULL,NULL,'','','0','','','','','2',NULL,'Database size.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f8d430b69f4f4f2aa04e2906cc4ab3cd','0','2','0'),
('48265','7','','10649','DB [{#DBNAME}]: Get frozen XID','pgsql.frozenxid["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','2',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2e0e02f98b3c45d195f93e1ed8ec343d','0','2','0'),
('48266','7','','10649','DB [{#DBNAME}]: Get scans','pgsql.scans["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','2',NULL,'Number of scans done for table/index in this database.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8ee891f2e0ae4c74a24ebffc67380f01','0','2','0'),
('48296','3','','10650','ICMP ping','icmpping','1m','31d','365d','0','3','','','','',NULL,'1278','','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2af50dac1b3245a9b6c350c1096209b6','0','2','0'),
('48297','3','','10650','ICMP loss','icmppingloss','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','250e30e7298444df8208e15c6a32a1c5','0','2','0'),
('48298','3','','10650','ICMP response time','icmppingsec','1m','31d','365d','0','0','','s','','',NULL,NULL,'','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8b40a9b8da8546e2a0b593e7dbb72537','0','2','0'),
('48299','20','walk[ 1.3.6.1.4.1.2636.5.1.1.2.1.1.1.3, 1.3.6.1.4.1.2636.5.1.1.2.4.1.1.1, 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.2, 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.7, 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.8, 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.10, 1.3.6.1.4.1.2636.5.1.1.2.1.1.1.2, 1.3.6.1.4.1.2636.5.1.1.2.1.1.1.11, 1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14, 1.3.6.1.4.1.2636.5.1.1.2.1.1.1.13]','10650','SNMP walk BGP Peer','juniper.mx.bgp.peer.data.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning `BGP4-V2-MIB-JUNIPER::jnxBgpM2PeerData` for BGP Peer Data.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','0335221808684100bd1e062a730a909d','0','2','0'),
('48300','20','walk[ 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.1, 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.2, 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.7, 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.8, 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.9, 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.10, 1.3.6.1.4.1.2636.5.1.1.2.6.2.1.11]','10650','SNMP walk BGP Prefix Counters','juniper.mx.bgp.prefix.counters.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning `BGP4-V2-MIB-JUNIPER::jnxBgpM2PrefixCountersTable` for Prefix Counters.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','a6bab1f7b7bd45cf9dcfbb309957cf91','0','2','0'),
('48301','20','walk[1.3.6.1.4.1.2636.3.60.1.2.1.1.1, 1.3.6.1.4.1.2636.3.60.1.2.1.1.2, 1.3.6.1.4.1.2636.3.60.1.2.1.1.4, 1.3.6.1.4.1.2636.3.60.1.2.1.1.6, 1.3.6.1.4.1.2636.3.60.1.2.1.1.8, 1.3.6.1.4.1.2636.3.60.1.2.1.1.9, 1.3.6.1.4.1.2636.3.60.1.1.1.1.8, 1.3.6.1.4.1.2636.3.60.1.1.1.1.30, 1.3.6.1.2.1.2.2.1.8, 1.3.6.1.2.1.2.2.1.7, 1.3.6.1.2.1.31.1.1.1.18, 1.3.6.1.2.1.31.1.1.1.1, 1.3.6.1.2.1.2.2.1.2, 1.3.6.1.2.1.2.2.1.3]','10650','SNMP walk Multi-lane digital optical monitoring','juniper.mx.dom.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning `JUNIPER-DOM-MIB::jnxDomModuleLaneTable` for multi-lane digital optical monitoring.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','9d7d94b8c0d046d2a1a6426e89128719','0','2','0'),
('48302','20','walk[1.3.6.1.2.1.10.7.2.1.19,1.3.6.1.2.1.2.2.1.8,1.3.6.1.2.1.31.1.1.1.18,1.3.6.1.2.1.31.1.1.1.1,1.3.6.1.2.1.2.2.1.2]','10650','SNMP walk EtherLike-MIB interfaces','juniper.mx.net.if.duplex.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Discovery of interfaces from IF-MIB and EtherLike-MIB. Interfaces with operational status `up(1)` are discovered.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','7ddc368f670e40d1b5770e0a4428ce45','0','2','0'),
('48303','20','walk[1.3.6.1.2.1.2.2.1.8, 1.3.6.1.2.1.2.2.1.2, 1.3.6.1.2.1.2.2.1.3, 1.3.6.1.2.1.2.2.1.7, 1.3.6.1.2.1.2.2.1.13, 1.3.6.1.2.1.2.2.1.14, 1.3.6.1.2.1.2.2.1.19, 1.3.6.1.2.1.2.2.1.20, 1.3.6.1.2.1.31.1.1.1.1, 1.3.6.1.2.1.31.1.1.1.6, 1.3.6.1.2.1.31.1.1.1.10, 1.3.6.1.2.1.31.1.1.1.15, 1.3.6.1.2.1.31.1.1.1.18]','10650','SNMP walk Network interfaces','juniper.mx.net.if.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Discovery of interfaces from IF-MIB.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b11839f1bddd4781b23111511db1615a','0','2','0'),
('48304','20','walk[1.3.6.1.4.1.2636.3.1.13.1.5, 1.3.6.1.4.1.2636.3.1.13.1.7, 1.3.6.1.4.1.2636.3.1.13.1.8, 1.3.6.1.4.1.2636.3.1.13.1.5.2, 1.3.6.1.4.1.2636.3.1.13.1.5.4, 1.3.6.1.4.1.2636.3.1.13.1.6.4, 1.3.6.1.4.1.2636.3.1.13.1.6.2, 1.3.6.1.4.1.2636.3.1.13.1.11]','10650','SNMP walk Operating Table','juniper.mx.operating.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning `JUNIPER-MIB::jnxOperatingTable` for CPU, Memory, Temperature, and Fans.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','f42152e7c0504aa4bfa611725f365afc','0','2','0'),
('48305','20','walk[ 1.3.6.1.2.1.14.10.1.1, 1.3.6.1.2.1.14.10.1.3, 1.3.6.1.2.1.14.10.1.5, 1.3.6.1.2.1.14.10.1.6, 1.3.6.1.2.1.14.10.1.7, 1.3.6.1.2.1.14.10.1.11]','10650','SNMP walk OSPF Neighbors','juniper.mx.ospf.nbr.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning `OSPF-MIB::ospfNbrTable` for OSPF Neighbors.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','80f06a9c2725450e9b5a16377b2cf7af','0','2','0'),
('48306','20','walk[ 1.3.6.1.4.1.2636.5.4.1.1.9.1.5, 1.3.6.1.4.1.2636.5.4.1.1.9.1.7, 1.3.6.1.4.1.2636.5.4.1.1.9.1.8, 1.3.6.1.4.1.2636.5.4.1.1.9.1.9, 1.3.6.1.4.1.2636.5.4.1.1.9.1.11]','10650','SNMP walk OSPFv3 Neighbors','juniper.mx.ospfv3.nbr.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning `OSPFV3-MIB-JUNIPER::jnxOspfv3NbrTable` for OSPFv3 Neighbors.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','4f3115a33a6a43b6bf0ab2be3eeec995','0','2','0'),
('48307','20','walk[1.3.6.1.4.1.2636.3.1.14.1.5, 1.3.6.1.4.1.2636.3.1.14.1.6, 1.3.6.1.4.1.2636.3.1.14.1.10, 1.3.6.1.4.1.2636.3.1.14.1.16, 1.3.6.1.4.1.2636.3.1.14.1.7]','10650','SNMP walk Redundancy Table','juniper.mx.redundancy.table.snmp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning `JUNIPER-MIB::jnxRedundancyTable` for Router Redundancy.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','d72814c5b9c64f4e843a04137b99dad6','0','2','0'),
('48308','20','1.3.6.1.2.1.1.4.0','10650','System contact details','juniper.mx.system.contact[sysContact.0]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nName and contact information of the contact person for the node. If not provided, the value is a zero-length string.','23','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b9b7da53c32a4b48958c313ed45870b1','0','2','0'),
('48309','20','1.3.6.1.2.1.1.1.0','10650','System description','juniper.mx.system.descr[sysDescr.0]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nA textual description of the entity. This value should include the full name and version identification of the system\'s hardware type, software operating system, and networking software.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','092dbc3c0da648449e69047d3f83b2ba','0','2','0'),
('48310','20','1.3.6.1.4.1.2636.3.1.2.0','10650','Hardware model name','juniper.mx.system.hw.model','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: JUNIPER-MIB\r\nThe name, model, or detailed description of the device, indicating which product it represents, for example, `M40`.','29','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','e101a0bd30ae45f6bff0b2b8c914f95b','0','2','0'),
('48311','20','1.3.6.1.4.1.2636.3.1.3.0','10650','Hardware serial number','juniper.mx.system.hw.serialnumber','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: JUNIPER-MIB\r\nThe serial number of this subject, blank if unknown or unavailable.','8','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','7fbc5fa8ef084cf585d5a617812b2d70','0','2','0'),
('48312','20','1.3.6.1.2.1.25.1.1.0','10650','Uptime (hardware)','juniper.mx.system.hw.uptime[hrSystemUptime.0]','30s','31d','0','0','3','','uptime','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: HOST-RESOURCES-MIB\r\nThe amount of time since this host was last initialized. Note that this is different from `sysUpTime` in the SNMPv2-MIB [RFC1907] because `sysUpTime` is the uptime of the network management portion of the system.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','c2bcb74f5afe4659af6a614ea98dbf51','0','2','0'),
('48313','20','1.3.6.1.2.1.1.6.0','10650','System location','juniper.mx.system.location[sysLocation.0]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nPhysical location of the node (e.g., `equipment room`, `3rd floor`). If not provided, the value is a zero-length string.','24','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ef6895d078204d17b7f3ba142c2075bf','0','2','0'),
('48314','20','1.3.6.1.2.1.1.5.0','10650','System name','juniper.mx.system.name','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nAn administratively-assigned name for this managed node. By convention, this is the node\'s fully-qualified domain name. If the name is unknown, the value is a zero-length string.','3','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','1a80dba9043e43edb4c073f397e471c9','0','2','0'),
('48315','20','1.3.6.1.2.1.1.3.0','10650','Uptime (network)','juniper.mx.system.net.uptime[sysUpTime.0]','30s','31d','0','0','3','','uptime','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nTime (in hundredths of a second) since the network management portion of the system was last re-initialized.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','33b048b47db542d6bc304a0048e4b743','0','2','0'),
('48316','20','1.3.6.1.2.1.1.2.0','10650','System object ID','juniper.mx.system.objectid[sysObjectID.0]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nThe vendor\'s authoritative identification of the entity as part of the vendor\'s SMI enterprises subtree with the prefix 1.3.6.1.4.1 (e.g., a vendor with the identifier 1.3.6.1.4.1.4242 might assign a system object with the OID 1.3.6.1.4.1.4242.1.1).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','832ad6d2465e4c20813c194114d2655b','0','2','0'),
('48317','20','1.3.6.1.2.1.1.1.0','10650','Operating system','juniper.mx.system.sw.os[sysDescr.0]','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB','5','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8f743934b3364cadbef2f178cc5aabb1','0','2','0'),
('48318','17','','10650','SNMP traps (fallback)','snmptrap.fallback','0','31d','0','0','2','','','','hh:mm:sszyyyy/MM/dd',NULL,NULL,'','','0','','','','','0',NULL,'The item is used to collect all SNMP traps unmatched by other `snmptrap` items.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','d2d0f8b19fc3474880ce2decd2880ce8','0','2','0'),
('48319','5','','10650','SNMP agent availability','zabbix[host,snmp,available]','1m','31d','365d','0','3','','','','',NULL,'1279','','','0','','','','','0',NULL,'Availability of SNMP checks on the host. The value of this item corresponds to availability icons in the host list.\r\nPossible values:\r\n0 - not available\r\n1 - available\r\n2 - unknown','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8223b49a0d1f4467a5f79e423a4bf862','0','2','0'),
('48368','21','','10651','Get data','azure.sql_inst.data.get','1m','0','0','0','4','','','','',NULL,NULL,'var Azure = {\r\n	params: {},\r\n	token: null,\r\n\r\n	setParams: function (params) {\r\n		[\'app_id\', \'password\', \'tenant_id\', \'subscription_id\', \'resource_id\'].forEach(function (field) {\r\n			if (typeof params !== \'object\' || typeof params[field] === \'undefined\' || params[field] === \'\') {\r\n				throw \'Required param is not set: \' + field + \'.\';\r\n			}\r\n		});\r\n\r\n		Azure.params = params;\r\n	},\r\n\r\n	login: function () {\r\n		var response, login = new HttpRequest();\r\n\r\n		if (typeof Azure.params.proxy !== \'undefined\' && Azure.params.proxy !== \'\') {\r\n			login.setProxy(Azure.params.proxy);\r\n		}\r\n\r\n		login.addHeader(\'Content-Type: application/x-www-form-urlencoded\');\r\n		response = login.post(\r\n			\'https://login.microsoftonline.com/\' + encodeURIComponent(Azure.params.tenant_id) + \'/oauth2/token\',\r\n			\'grant_type=client_credentials&resource=\' + encodeURIComponent(\'https://management.azure.com/\') + \'&client_id=\' + encodeURIComponent(Azure.params.app_id) + \'&client_secret=\' + encodeURIComponent(Azure.params.password)\r\n		);\r\n\r\n		if (login.getStatus() !== 200) {\r\n			throw \'Login failed with status code \' + login.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			response = JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse login session response.\';\r\n		}\r\n\r\n		if (!response.hasOwnProperty(\'access_token\')) {\r\n			throw \'Authentication response does not contain access token.\';\r\n		}\r\n\r\n		Azure.token = response[\'access_token\'];\r\n	},\r\n\r\n	request: function (url) {\r\n		var response, request = new HttpRequest();\r\n\r\n		if (typeof Azure.params.proxy !== \'undefined\' && Azure.params.proxy !== \'\') {\r\n			request.setProxy(Azure.params.proxy);\r\n		}\r\n\r\n		if (!Azure.token) {\r\n			throw \'Request does not contain access token.\';\r\n		}\r\n\r\n		request.addHeader(\'Content-Type: application/json\');\r\n		request.addHeader(\'Authorization: Bearer \' + Azure.token);\r\n		Zabbix.log(4, \'[ Azure SQL instance ] request url: \' + url);\r\n\r\n		response = request.get(url);\r\n\r\n		if (request.getStatus() !== 200) {\r\n			throw \'Request failed with status code \' + request.getStatus() + \': \' + response;\r\n		}\r\n\r\n		try {\r\n			return JSON.parse(response);\r\n		}\r\n		catch (error) {\r\n			throw \'Failed to parse response received from API.\';\r\n		}\r\n	},\r\n\r\n	getField: function (data, path) {\r\n		var steps = path.split(\'.\');\r\n\r\n		for (var i = 0; i < steps.length; i++) {\r\n			var step = steps[i];\r\n			if (typeof data !== \'object\' || typeof data[step] === \'undefined\') {\r\n				throw \'Required field was not found: \' + path;\r\n			}\r\n			data = data[step];\r\n		}\r\n\r\n		return data;\r\n	},\r\n\r\n	getMetricsData: function () {\r\n		var data = {},\r\n			metric_endpoints = {\r\n				\'main_metrics\': \'/providers/Microsoft.Insights/metrics?metricnames=\' + encodeURIComponent(\'virtual_core_count,avg_cpu_percent,reserved_storage_mb,storage_space_used_mb,io_requests,io_bytes_read,io_bytes_written\') + \'&api-version=2021-05-01&timespan=PT5M\',\r\n			};\r\n\r\n		data.metrics = {};\r\n\r\n		Object.keys(metric_endpoints).forEach(function (field) {\r\n			metrics = Azure.getField(Azure.request(\'https://management.azure.com\' + Azure.params.resource_id + metric_endpoints[field]), \'value\');\r\n			for (k in metrics) {\r\n				key = Azure.getField(metrics[k], \'name.value\').replace(/(\\s|\\/)+/g, \'\');\r\n				if (metrics[k].timeseries.length === 0) {\r\n					metrics[k].timeseries.push({ \'data\': [\'nodata\'] })\r\n				}\r\n				values = Azure.getField(metrics[k], \'timeseries.0.data\');\r\n				for (var i = values.length - 1; i >= 0; i--) {\r\n					if (typeof (values[i].average) !== \'undefined\') {\r\n						data.metrics[key] = values[i];\r\n						break;\r\n					}\r\n				}\r\n			}\r\n		});\r\n\r\n		data.health = Azure.getField(Azure.request(\'https://management.azure.com\' + Azure.params.resource_id + \'/providers/Microsoft.ResourceHealth/availabilityStatuses?api-version=2020-05-01\'), \'value.0.properties\');\r\n		data.instance = Azure.request(\'https://management.azure.com\' + Azure.params.resource_id + \'?api-version=2024-05-01-preview\');\r\n\r\n		return data\r\n	}\r\n};\r\n\r\ntry {\r\n	Azure.setParams(JSON.parse(value));\r\n	Azure.login();\r\n	return JSON.stringify(Azure.getMetricsData());\r\n}\r\ncatch (error) {\r\n	error += (String(error).endsWith(\'.\')) ? \'\' : \'.\';\r\n	Zabbix.log(3, \'[ Azure SQL instance ] ERROR: \' + error);\r\n	return JSON.stringify({ \'error\': error });\r\n}','','0','','','','','0',NULL,'Gathers data of the Azure SQL managed instance.','0','7d','0','',NULL,'{$AZURE.DATA.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','4dc91ae07bd048128a34da5b7ba090e8','0','2','0'),
('48369','15','','10651','Storage space utilization','azure.sql_inst.storage.utilization','1m','31d','365d','0','3','','%','','',NULL,NULL,'last(//azure.sql_inst.storage.used) * 100 / last(//azure.sql_inst.storage.reserved)','','0','','','','','0',NULL,'Managed instance storage space utilization, in percent.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b3ea1180eb174fb38656c9696fa9d9a7','0','2','0'),
('48384','19','','10653','Get device certificate','pan.pa440.certificate.device.get','1h','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','0',NULL,'Get the information about the device certificate. Note that superuser privileges are required to obtain the device certificate data.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><device-certificate><status><\\/status><\\/device-certificate><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','4bdcedebb6dd4fd4951a13c52749b89d','0','2','0'),
('48385','19','','10653','Get certificates','pan.pa440.certificate.get','1h','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','0',NULL,'Get the information about the certificates on the device.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"config"},{"action":"get"},{"xpath":"\\/config\\/shared\\/certificate"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','0d8d933aff9a4523aa784722616aa40f','0','2','0'),
('48386','19','','10653','Get system environmentals','pan.pa440.environmentals.get','1m','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','0',NULL,'Get the system environment state information.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><system><environmentals><\\/environmentals><\\/system><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','d971daee3e2340a981b0c079adf3abdc','0','2','0'),
('48387','19','','10653','Get HA info','pan.pa440.ha.get','1m','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','0',NULL,'Get the high availability information.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><high-availability><all><\\/all><\\/high-availability><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','81e26d3d45fb4cf9a085ecaf980dfc76','0','2','0'),
('48388','19','','10653','Get licenses','pan.pa440.licenses.get','1h','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','0',NULL,'Get the information about installed licenses.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<request><license><info><\\/info><\\/license><\\/request>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','296fb66ceb8d45e0aa923bf7227711b5','0','2','0'),
('48389','19','','10653','Get OSPF neighbors','pan.pa440.ospf.neighbors.get','1m','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','0',NULL,'Get the OSPF neighbor information.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><routing><protocol><ospf><neighbor><\\/neighbor><\\/ospf><\\/protocol><\\/routing><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','2c88e39db8634c5baa03e9e6bd974e52','0','2','0'),
('48390','19','','10653','Get OSPFv3 neighbors','pan.pa440.ospfv3.neighbors.get','1m','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','0',NULL,'Get the OSPFv3 neighbor information.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><routing><protocol><ospfv3><neighbor><\\/neighbor><\\/ospfv3><\\/protocol><\\/routing><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','b4dda8f48f734b9bae0a1c55bd2faf45','0','2','0'),
('48391','19','','10653','Get session info','pan.pa440.session_info.get','1m','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','0',NULL,'Get the information about sessions.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><session><info><\\/info><\\/session><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','f3defb28d70a4a0f9ebd036d65e1fda2','0','2','0'),
('48392','19','','10653','Get system info','pan.pa440.system_info.get','1m','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','0',NULL,'Get the general system information.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><system><info><\\/info><\\/system><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','5133c9b5e7284141ba1da1d1d1c726f8','0','2','0'),
('48393','19','','10653','Get system state','pan.pa440.system_state.get','1m','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','0',NULL,'Get the system state information. Used with a filter to retrieve CPU utilization metrics.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><system><state><filter>sys.monitor.s1.*.exports<\\/filter><\\/state><\\/system><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','7bbaec54328a472e99c47edca0aa13c0','0','2','0'),
('48422','19','','10653','BGP peer discovery','pan.pa440.bgp.peer.discovery','1h','31d','365d','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','1',NULL,'Discovers BGP peers.','0','7d','1','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><routing><protocol><bgp><peer><\\/peer><\\/bgp><\\/protocol><\\/routing><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','94f62f452c3947f688e99fcea7f07b04','0','2','0'),
('48427','19','','10653','Hardware network interface discovery','pan.pa440.if.hw.discovery','1h','31d','365d','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','1',NULL,'Discovers hardware network interfaces.','0','7d','1','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><interface>hardware<\\/interface><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','77eb005985d24e8bbe2ca56ea7c82f86','0','2','0'),
('48428','19','','10653','Logical network interface discovery','pan.pa440.if.sw.discovery','1h','31d','365d','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','1',NULL,'Discovers logical network interfaces.','0','7d','1','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><interface>logical<\\/interface><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','0328c545f98e4e2e90648b5990d365c7','0','2','0'),
('48432','19','','10653','BGP peer [{#PEER}]: Get data','pan.pa440.bgp.peer.get[{#PEERGROUP}, {#PEERADDR}, {#PEER}]','1m','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','2',NULL,'Get the information about the peer.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><routing><protocol><bgp><peer><peer-name>{#PEER}<\\/peer-name><\\/peer><\\/bgp><\\/protocol><\\/routing><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','8cb01b4d3dbe403bae338af458c38b7b','0','2','0'),
('48433','19','','10653','Interface [{#IFNAME}]: Get data','pan.pa440.if.hw.get[{#IFNAME}]','3m','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','2',NULL,'Get the interface statistics.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><interface>{#IFNAME}<\\/interface><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','19bcb77f16e44adbae1abd384b7c8105','0','2','0'),
('48434','19','','10653','VSYS [{#VSYS}]: Interface [{#IFNAME}]: Get data','pan.pa440.if.sw.get[{#VSYS}, {#IFNAME}]','3m','0','0','0','4','','','','',NULL,NULL,'','','1','{$PAN.PA440.USER}','{$PAN.PA440.PASSWORD}','','','2',NULL,'Get the interface statistics.','0','7d','0','',NULL,'{$PAN.PA440.TIMEOUT}','{$PAN.PA440.API.URL}','[{"type":"op"},{"cmd":"<show><interface>{#IFNAME}<\\/interface><\\/show>"}]','','','1','0','{$PAN.PA440.HTTP_PROXY}','','0','0','0','0','0','0','0','b7bc2017a9f240c793d526612738e0f8','0','2','0'),
('48461','21','','10654','Get array controller resources','dell.server.array.resources.get','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Controller\', \'Discovery\', params);\r\n\r\nconst controllers = dell.extractData(dell.executeRequest(\'/redfish/v1/Systems/System.Embedded.1/Storage?$expand=.($levels=1)\'), \'Members\');\r\n\r\nvar arrControllerKeys = [\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Name\'\r\n	},\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'slot\',\r\n		\'path\': \'Oem.Dell.DellController.PCISlot\'\r\n	}\r\n];\r\n\r\nvar battControllerKeys = [\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Oem.Dell.DellControllerBattery.Id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Oem.Dell.DellControllerBattery.Name\'\r\n	},\r\n	{\r\n		\'name\': \'status\',\r\n		\'path\': \'Oem.Dell.DellControllerBattery.PrimaryStatus\'\r\n	}\r\n];\r\n\r\nif (!Array.isArray(controllers)) {\r\n	throw \'Unexpected type for controllers.\';\r\n}\r\n\r\nvar buffer = { \'arrayControllers\': [], \'batteryControllers\': [] };\r\n\r\ncontrollers.forEach(function (controller) {\r\n	if (controller[\'Id\'].search(\'RAID\') > -1) {\r\n		buffer[\'arrayControllers\'].push(dell.extractData(controller, arrControllerKeys, true));\r\n		buffer[\'batteryControllers\'].push(dell.extractData(controller, battControllerKeys, true));\r\n	}\r\n});\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns array controller resources.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','0aa82279099d4599acd24f1cf4eccc40','0','2','0'),
('48462','21','','10654','Get disks','dell.server.disks.get','1h','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Disk\', \'Discovery\', params);\r\n\r\nconst disks = dell.extractData(dell.executeRequest(\'/redfish/v1/Systems/System.Embedded.1/Storage\'), \'Members\');\r\n\r\nvar keys = [\r\n	{\r\n		\'name\': \'path\',\r\n		\'path\': \'@odata.id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Name\'\r\n	}\r\n];\r\n\r\nif (!Array.isArray(disks)) {\r\n	throw \'Unexpected type for disks.\';\r\n}\r\n\r\nvar buffer = { \'physicalDisks\': [], \'virtualDisks\': [] };\r\n\r\ndisks.forEach(function (disk) {\r\n	var requests = [{ \'usage\': \'physicalDisks\', \'path\': \'\', \'target\': \'Drives\' }, { \'usage\': \'virtualDisks\', \'path\': \'/Volumes\', \'target\': \'Members\' }];\r\n\r\n	requests.forEach(function (request) {\r\n		const disks = dell.extractData(dell.executeRequest(disk[\'@odata.id\'] + request[\'path\']), request[\'target\']);\r\n\r\n		if (!Array.isArray(disks) || disks.length <= 0) {\r\n			return;\r\n		}\r\n\r\n		disks.forEach(function (drive) {\r\n			buffer[request[\'usage\']].push(dell.extractData(dell.executeRequest(drive[\'@odata.id\']), keys));\r\n		});\r\n	});\r\n});\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns storage resources.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','7aa73c13af5a43b6b956362d7e9f2742','0','2','0'),
('48463','21','','10654','Get network interfaces','dell.server.net.iface.get','1h','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Network Interface\', \'Discovery\', params);\r\n\r\nconst netAdapters = dell.extractData(dell.executeRequest(\'/redfish/v1/Chassis/System.Embedded.1/NetworkAdapters\'), \'Members\');\r\n\r\nvar keys = [\r\n	{\r\n		\'name\': \'path\',\r\n		\'path\': \'@odata.id\'\r\n	},\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Id\'\r\n	}\r\n];\r\n\r\nif (!Array.isArray(netAdapters)) {\r\n	throw \'Unexpected type for network adapters.\';\r\n}\r\n\r\nvar buffer = [];\r\n\r\nnetAdapters.forEach(function (netAdapter) {\r\n	const netPorts = dell.extractData(dell.executeRequest(netAdapter["@odata.id"] + \'/NetworkPorts\'), \'Members\');\r\n\r\n	if (!Array.isArray(netPorts)) {\r\n		return;\r\n	}\r\n\r\n	netPorts.forEach(function (netPort) {\r\n		buffer.push(dell.extractData(dell.executeRequest(netPort["@odata.id"]), keys));\r\n	})\r\n\r\n});\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns network interfaces.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','02e6c6db566f42aaab92e0fbc634e37c','0','2','0'),
('48464','21','','10654','Get sensors','dell.server.sensors.get','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\nfunction formatPSU(psuObj) {\r\n	var foundPowerSupplies = [],\r\n		buffer = [];\r\n\r\n	psuObj.forEach(function (obj) {\r\n		const psuName = obj[\'name\'].split(\' \')[0];\r\n\r\n		if (foundPowerSupplies.indexOf(psuName) === -1) {\r\n			foundPowerSupplies.push(psuName);\r\n			buffer.push({\r\n				\'name\': psuName,\r\n				[obj[\'type\'].toLowerCase()]: {\'reading\': obj[\'reading\'], \'health\': obj[\'health\']}\r\n			});\r\n		} else {\r\n			buffer.forEach(function (bufferObj) {\r\n\r\n				if (bufferObj[\'name\'] === psuName) {\r\n					bufferObj[obj[\'type\'].toLowerCase()] = {\'reading\': obj[\'reading\'], \'health\': obj[\'health\']};\r\n\r\n					return;\r\n				}\r\n			});\r\n		}\r\n	})\r\n	return buffer;\r\n};\r\n\r\nfunction formatTemp(tempObj) {\r\n	tempObj.forEach(function (obj) {\r\n		obj.name = obj.name.split(\' \').slice(0, -1).join(\' \');\r\n	});\r\n\r\n	return tempObj;\r\n}\r\n\r\nfunction formatSysBoard(sysObj) {\r\n	const remove = [\'System\', \'Board\', \'Usage\'];\r\n\r\n	sysObj.forEach(function (obj) {\r\n		var buffer = [];\r\n\r\n		obj[\'name\'].split(\' \').forEach(function (word) {\r\n			var match = false;\r\n\r\n			remove.forEach(function (removeWord) {\r\n				if (removeWord === word) {\r\n					match = true;\r\n				}\r\n			});\r\n\r\n			if (!match) {\r\n				buffer.push(word);\r\n			}\r\n		});\r\n\r\n		if (buffer.length > 0) {\r\n			obj[\'name\'] = buffer.join(\' \');\r\n		}\r\n	});\r\n\r\n	return sysObj;\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Sensor\', \'Discovery\', params);\r\n\r\nconst sensors = dell.extractData(dell.executeRequest(\'/redfish/v1/Chassis/System.Embedded.1/Sensors?$expand=.($levels=1)\'), \'Members\');\r\n\r\nif (!Array.isArray(sensors)) {\r\n	throw \'Unexpected type for sensors.\';\r\n}\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Name\'\r\n	},\r\n	{\r\n		\'name\': \'context\',\r\n		\'path\': \'PhysicalContext\'\r\n	},\r\n	{\r\n		\'name\': \'reading\',\r\n		\'path\': \'Reading\'\r\n	},\r\n	{\r\n		\'name\': \'type\',\r\n		\'path\': \'ReadingType\'\r\n	},\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	}\r\n];\r\n\r\nvar buffer = { \'fan\': [], \'psu\': [], \'temperature\': [], \'sysBoard\': [] };\r\n\r\nsensors.forEach(function (sensor) {\r\n	if (sensor[\'Name\'].substring(0, 2) === \'PS\' && sensor[\'PhysicalContext\'] === \'PowerSupply\') {\r\n		buffer[\'psu\'].push(dell.extractData(sensor, keys, true));\r\n	} else if (sensor[\'ReadingType\'] === \'Temperature\') {\r\n		buffer[\'temperature\'].push(dell.extractData(sensor, keys, true));\r\n	} else if (sensor[\'Name\'].includes(\'Fan\') && sensor[\'ReadingType\'] === \'Rotational\') {\r\n		buffer[\'fan\'].push(dell.extractData(sensor, keys, true));\r\n	} else if (sensor[\'Name\'].includes(\'System Board\') && sensor[\'ReadingType\'] === \'Percent\') {\r\n		buffer[\'sysBoard\'].push(dell.extractData(sensor, keys, true));\r\n	}\r\n});\r\n\r\nbuffer[\'psu\'] = formatPSU(buffer[\'psu\']);\r\nbuffer[\'temperature\'] = formatTemp(buffer[\'temperature\']);\r\nbuffer[\'sysBoard\'] = formatSysBoard(buffer[\'sysBoard\']);\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns sensors.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','228fc2bc5dc94052bb1eba79756e040f','0','2','0'),
('48465','21','','10654','Get system','dell.server.system.get','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'System\', \'Get system metrics\', params);\r\n\r\nconst requests = [\r\n	{\r\n		\'path\': \'/redfish/v1/Systems/System.Embedded.1\',\r\n		\'keys\': [\r\n			{\r\n				\'name\': \'model\',\r\n				\'path\': \'Model\'\r\n			},\r\n			{\r\n				\'name\': \'serialnumber\',\r\n				\'path\': \'Oem.Dell.DellSystem.ChassisServiceTag\'\r\n			},\r\n			{\r\n				\'name\': \'status\',\r\n				\'path\': \'Status.Health\'\r\n			}\r\n		]\r\n	},\r\n	{\r\n		\'path\': \'/redfish/v1/Managers/iDRAC.Embedded.1\',\r\n		\'keys\': {\r\n			\'name\': \'firmware\',\r\n			\'path\': \'FirmwareVersion\'\r\n		}\r\n	}\r\n];\r\n\r\nvar buffer = {};\r\n\r\nfor (var i = 0, requestsCount = requests.length; i < requestsCount; i++) {\r\n	Object.assign(buffer, dell.extractData(dell.executeRequest(requests[i].path), requests[i].keys));\r\n}\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns system metrics.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','c264044dde3241089e003ea431cf98f2','0','2','0'),
('48466','3','','10654','Redfish API status','net.tcp.service[https]','1m','31d','365d','0','3','','','','',NULL,'1287','','','0','','','','','0',NULL,'Availability of Redfish API on the server.\r\nPossible values:\r\n  0 - Unavailable\r\n  1 - Available','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','9ba8445ce392429a81191dbaffbaa919','0','2','0'),
('48483','21','','10654','Interface [{#IFNAME}]: Get interface','dell.server.net.if.get[{#IFNAME}]','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'path\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Network Interface\', \'Get metrics\', params);\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'linkStatus\',\r\n		\'path\': \'LinkStatus\'\r\n	},\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'state\',\r\n		\'path\': \'Status.State\'\r\n	},\r\n	{\r\n		\'name\': \'linkSpeed\',\r\n		\'path\': \'CurrentLinkSpeedMbps\'\r\n	}\r\n];\r\n\r\nreturn JSON.stringify(dell.extractData(dell.executeRequest(params.path), keys));','','0','','','','','2',NULL,'Returns the metrics of a network interface.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','c644bf0a447c4067bb4106860d98f813','0','2','0'),
('48484','21','','10654','Physical disk [{#DISK_NAME}]: Get disk','dell.server.hw.physicaldisk.get[{#DISK_NAME}]','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'path\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Disk\', \'Get physical disk metrics\', params);\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'sn\',\r\n		\'path\': \'SerialNumber\'\r\n	},\r\n	{\r\n		\'name\': \'model\',\r\n		\'path\': \'Model\'\r\n	},\r\n	{\r\n		\'name\': \'mediaType\',\r\n		\'path\': \'MediaType\'\r\n	},\r\n	{\r\n		\'name\': \'capacity\',\r\n		\'path\': \'CapacityBytes\'\r\n	}\r\n];\r\n\r\nreturn JSON.stringify(dell.extractData(dell.executeRequest(params.path), keys));','','0','','','','','2',NULL,'Returns the metrics of a physical disk.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','d1e4d411743040d3892769aa63e18b7f','0','2','0'),
('48485','21','','10654','Virtual disk [{#DISK_NAME}]: Get disk','dell.server.hw.virtualdisk.get[{#DISK_NAME}]','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'path\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Disk\', \'Get virtual disk metrics\', params);\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'capacity\',\r\n		\'path\': \'CapacityBytes\'\r\n	},\r\n	{\r\n		\'name\': \'status\',\r\n		\'path\': \'Status.State\'\r\n	},\r\n	{\r\n		\'name\': \'raidStatus\',\r\n		\'path\': \'Oem.Dell.DellVirtualDisk.RaidStatus\'\r\n	},\r\n	{\r\n		\'name\': \'readCachePolicy\',\r\n		\'path\': \'Oem.Dell.DellVirtualDisk.ReadCachePolicy\'\r\n	},\r\n	{\r\n		\'name\': \'writeCachePolicy\',\r\n		\'path\': \'Oem.Dell.DellVirtualDisk.WriteCachePolicy\'\r\n	}\r\n];\r\n\r\nreturn JSON.stringify(dell.extractData(dell.executeRequest(params.path), keys));','','0','','','','','2',NULL,'Returns the metrics of a virtual disk.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','2d70a9fc34e84fb4b57025fa47eabde8','0','2','0'),
('48514','20','walk[1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1.38,1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1.79,1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1.2]','10655','SNMP walk RAID controllers table','dell.server.array.controller.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of RAID Controllers Table `IDRAC-MIB-SMIv2::controllerTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','28e0c3b6ff414e8ea580a5efedd6d966','0','2','0'),
('48515','20','walk[1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1.1,1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1.4,1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1.21]','10655','SNMP walk Battery table','dell.server.battery.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of RAID Controllers Table `IDRAC-MIB-SMIv2::batteryTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','4c75b80b0f224d02a835794592bb1df9','0','2','0'),
('48516','20','get[1.3.6.1.4.1.674.10892.5.4.300.50.1.8.1.1]','10655','BIOS version','dell.server.bios.version','1m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: IDRAC-MIB-SMIv2\r\nThis attribute defines the version name of the system BIOS.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','10c7c6dfa9d645d19595f143cbeafb18','0','2','0'),
('48517','20','get[1.3.6.1.2.1.1.4.0]','10655','System contact details','dell.server.contact[sysContact]','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nName and contact information of the contact person for the node. If not provided, the value is a zero-length string.','23','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','543172398a8a46238b3b2d6e2e176db9','0','2','0'),
('48518','20','walk[1.3.6.1.4.1.674.10892.5.4.1100.30.1.26,1.3.6.1.4.1.674.10892.5.4.1100.32.1.5.1,1.3.6.1.4.1.674.10892.5.4.1100.32.1.6.1]','10655','SNMP walk Processor device tables','dell.server.cpu.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Processor Device Status Table `IDRAC-MIB-SMIv2::processorDeviceTable` and `IDRAC-MIB-SMIv2::processorDeviceStatusTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','a92165c0788f4073b773a3ccc00d8e33','0','2','0'),
('48519','20','get[1.3.6.1.2.1.1.1.0]','10655','System description','dell.server.descr[sysDescr]','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nA textual description of the entity. This value should include the full name and version identification of the system\'s hardware type, software operating system, and networking software.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ed8c53e78cf1430895f819a1c79f1881','0','2','0'),
('48520','20','walk[1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.1,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.2,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.24,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.31,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.6,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.7,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.35,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.11]','10655','SNMP walk Physical disk table','dell.server.disk.physical.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Physical Disk Table `IDRAC-MIB-SMIv2::physicalDiskTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','bfe85965ad6847b5913fc71ecd6b837d','0','2','0'),
('48521','20','walk[1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.1,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.2,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.13,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.30,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.11,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.10,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.6,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.4]','10655','SNMP walk Virtual disk table','dell.server.disk.virtual.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Virtual Disk Table `IDRAC-MIB-SMIv2::virtualDiskTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b5c22682042045c9972cd6779d31dabd','0','2','0'),
('48522','20','walk[1.3.6.1.4.1.674.10892.5.4.700.12.1.5,1.3.6.1.4.1.674.10892.5.4.700.12.1.8,1.3.6.1.4.1.674.10892.5.4.700.12.1.7,1.3.6.1.4.1.674.10892.5.4.700.12.1.6]','10655','SNMP walk Cooling device table','dell.server.fan.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Cooling Device Table `IDRAC-MIB-SMIv2::coolingDeviceTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','bd6d36c7568f43e884654e8f7cbb4606','0','2','0'),
('48523','20','get[1.3.6.1.4.1.674.10892.5.1.1.8.0]','10655','Firmware version','dell.server.hw.firmware[racFirmwareVersion]','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: IDRAC-MIB-SMIv2\r\nThis attribute defines the firmware version of a remote access card.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','0523d1c71ec648d3b7f72152bcdd3980','0','2','0'),
('48524','20','get[1.3.6.1.4.1.674.10892.5.1.3.12.0]','10655','Hardware model name','dell.server.hw.model[systemModelName]','1m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: IDRAC-MIB-SMIv2\r\nThis attribute defines the model name of the system.','29','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3f474f2cc921445392d4153b4070c581','0','2','0'),
('48525','20','get[1.3.6.1.4.1.674.10892.5.1.3.2.0]','10655','Hardware serial number','dell.server.hw.serialnumber[systemServiceTag]','1m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: IDRAC-MIB-SMIv2\r\nThis attribute defines the service tag of the system.','8','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','cd1220099942408eab14e854a9f556fe','0','2','0'),
('48526','20','get[1.3.6.1.4.1.674.10892.5.2.5.0]','10655','Uptime (hardware)','dell.server.hw.uptime[systemPowerUpTime]','1m','31d','0','0','3','','uptime','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: IDRAC-MIB-SMIv2\r\nThis attribute defines the power-up time of the system in seconds.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','86f3503ad4ce4210a9d367536075c78d','0','2','0'),
('48527','20','get[1.3.6.1.2.1.1.6.0]','10655','System location','dell.server.location[sysLocation]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nThe physical location of this node (e.g., \'telephone closet, 3rd floor\'). If the location is unknown, the value is a zero-length string.','24','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','94dacb3e9ce94c8abe29f5a1f3ed7414','0','2','0'),
('48528','15','','10655','Memory, total size','dell.server.memory.size.total','1m','31d','365d','0','3','','B','','',NULL,NULL,'sum(last_foreach(//dell.server.memory.size[*]))','','0','','','','','0',NULL,'Total memory amount on the device.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','aa5060ea16f54e348d0093600bc1369b','0','2','0'),
('48529','20','walk[1.3.6.1.4.1.674.10892.5.4.1100.50.1.8.1,1.3.6.1.4.1.674.10892.5.4.1100.50.1.5.1,1.3.6.1.4.1.674.10892.5.4.1100.50.1.14.1]','10655','SNMP walk Memory device table','dell.server.memory.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Memory Device Table `IDRAC-MIB-SMIv2::memoryDeviceTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','65592c126dd242e7b7fd9b574ed63281','0','2','0'),
('48530','20','get[1.3.6.1.2.1.1.5.0]','10655','System name','dell.server.name[sysName]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nAn administratively-assigned name for this managed node. By convention, this is the node\'s fully-qualified domain name. If the name is unknown, the value is a zero-length string.','3','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','feddc0222dab4e89a6caa661b67020a7','0','2','0'),
('48531','20','walk[1.3.6.1.4.1.674.10892.5.4.1100.90.1.4.1,1.3.6.1.4.1.674.10892.5.4.1100.90.1.30.1,1.3.6.1.4.1.674.10892.5.4.1100.90.1.3.1, 1.3.6.1.4.1.674.10892.5.4.1100.90.1.15.1]','10655','SNMP walk Network device table','dell.server.net.if.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Network Device Table `IDRAC-MIB-SMIv2::networkDeviceTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8d872ee881154af284dc295c0bb2a933','0','2','0'),
('48532','20','get[1.3.6.1.6.3.10.2.1.3.0]','10655','Uptime (network)','dell.server.net.uptime[snmpEngineTime]','1m','31d','0','0','3','','uptime','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMP-FRAMEWORK-MIB\r\nThe number of seconds since the value of the snmpEngineBoots object last changed.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','62a708d5e13b4d8fbf3d12b77164e2a0','0','2','0'),
('48533','20','1.3.6.1.2.1.1.2.0','10655','System object ID','dell.server.objectid[sysObjectID]','15m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMPv2-MIB\r\nThe vendor\'s authoritative identification of the entity as part of the vendor\'s SMI enterprises subtree with the prefix 1.3.6.1.4.1 (e.g., a vendor with the identifier 1.3.6.1.4.1.4242 might assign a system object with the OID 1.3.6.1.4.1.4242.1.1).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','443fb640977a492f83cba1b7fb9454fe','0','2','0'),
('48534','20','walk[1.3.6.1.4.1.674.10892.5.4.600.12.1.5,1.3.6.1.4.1.674.10892.5.4.600.12.1.8]','10655','SNMP walk Power supply table','dell.server.psu.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Power Supply Table `IDRAC-MIB-SMIv2::powerSupplyTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5b1a6a7a7adb4c32b66ae22e698b174f','0','2','0'),
('48535','20','walk[1.3.6.1.4.1.674.10892.5.4.700.20.1.1,1.3.6.1.4.1.674.10892.5.4.700.20.1.8,1.3.6.1.4.1.674.10892.5.4.700.20.1.6,1.3.6.1.4.1.674.10892.5.4.700.20.1.5]','10655','SNMP walk Temperature sensor table','dell.server.sensor.temp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Temperature Probe Table `IDRAC-MIB-SMIv2::temperatureProbeTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','7e66e28304e24ddcaf79426b32070cb3','0','2','0'),
('48536','20','get[1.3.6.1.4.1.674.10892.5.2.1.0]','10655','Overall system health status','dell.server.status[globalSystemStatus]','1m','31d','0','0','3','','','','',NULL,'1296','','','0','','','','','0',NULL,'MIB: IDRAC-MIB-SMIv2\r\nThis attribute defines the overall rollup status of all the components in the system monitored by the remote access card. Includes system, storage, IO devices, iDRAC, CPU, memory, etc.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','4acbcd1baf9e456a9d3e30d33282858a','0','2','0'),
('48537','20','get[1.3.6.1.4.1.674.10892.5.1.3.6.0]','10655','Operating system','dell.server.sw.os[systemOSName]','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: IDRAC-MIB-SMIv2\r\nThis attribute defines the name of the operating system that the host is running.','5','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','069326e2f88d4ef9bbed30e94d08af5d','0','2','0'),
('48538','20','walk[1.3.6.1.4.1.674.10892.5.4.600.50.1.7.1,1.3.6.1.4.1.674.10892.5.4.600.50.1.5.1]','10655','SNMP walk System battery table','dell.server.system.battery.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of System Battery Table `IDRAC-MIB-SMIv2::systemBatteryTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','0918a2a56c6542629acc5cfa7f4c5255','0','2','0'),
('48539','20','walk[1.3.6.1.4.1.674.10892.5.4.600.20.1.8.1,1.3.6.1.4.1.674.10892.5.4.600.20.1.6.1,1.3.6.1.4.1.674.10892.5.4.600.20.1.5.1,1.3.6.1.4.1.674.10892.5.4.600.20.1.7.1]','10655','SNMP walk Voltage probe table','dell.server.voltage.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Voltage Probe Table `IDRAC-MIB-SMIv2::voltageProbeTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','31ca246b873248439deb225f56d9c16b','0','2','0'),
('48540','17','','10655','SNMP traps (fallback)','snmptrap.fallback','0','31d','0','0','2','','','','hh:mm:sszyyyy/MM/dd',NULL,NULL,'','','0','','','','','0',NULL,'The item is used to collect all SNMP traps unmatched by other `snmptrap` items','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','9beb49cb322d48cfa061fc206b679a3e','0','2','0'),
('48541','5','','10655','SNMP agent availability','zabbix[host,snmp,available]','1m','31d','365d','0','3','','','','',NULL,'1306','','','0','','','','','0',NULL,'Availability of SNMP checks on the host. The value of this item corresponds to availability icons in the host list.\r\nPossible values:\r\n0 - not available\r\n1 - available\r\n2 - unknown','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3847459063014aafae40a59263c6cd21','0','2','0'),
('48583','21','','10435','Get array controller resources','dell.server.array.resources.get','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Controller\', \'Discovery\', params);\r\n\r\nconst controllers = dell.extractData(dell.executeRequest(\'/redfish/v1/Systems/System.Embedded.1/Storage?$expand=.($levels=1)\'), \'Members\');\r\n\r\nvar arrControllerKeys = [\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Name\'\r\n	},\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'slot\',\r\n		\'path\': \'Oem.Dell.DellController.PCISlot\'\r\n	}\r\n];\r\n\r\nvar battControllerKeys = [\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Oem.Dell.DellControllerBattery.Id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Oem.Dell.DellControllerBattery.Name\'\r\n	},\r\n	{\r\n		\'name\': \'status\',\r\n		\'path\': \'Oem.Dell.DellControllerBattery.PrimaryStatus\'\r\n	}\r\n];\r\n\r\nif (!Array.isArray(controllers)) {\r\n	throw \'Unexpected type for controllers.\';\r\n}\r\n\r\nvar buffer = { \'arrayControllers\': [], \'batteryControllers\': [] };\r\n\r\ncontrollers.forEach(function (controller) {\r\n	if (controller[\'Id\'].search(\'RAID\') > -1) {\r\n		buffer[\'arrayControllers\'].push(dell.extractData(controller, arrControllerKeys, true));\r\n		buffer[\'batteryControllers\'].push(dell.extractData(controller, battControllerKeys, true));\r\n	}\r\n});\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns array controller resources.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','f422ccc6fd194d59b49632f0a876bdbf','0','2','0'),
('48584','21','','10435','Get disks','dell.server.disks.get','1h','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Disk\', \'Discovery\', params);\r\n\r\nconst disks = dell.extractData(dell.executeRequest(\'/redfish/v1/Systems/System.Embedded.1/Storage\'), \'Members\');\r\n\r\nvar keys = [\r\n	{\r\n		\'name\': \'path\',\r\n		\'path\': \'@odata.id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Name\'\r\n	}\r\n];\r\n\r\nif (!Array.isArray(disks)) {\r\n	throw \'Unexpected type for disks.\';\r\n}\r\n\r\nvar buffer = { \'physicalDisks\': [], \'virtualDisks\': [] };\r\n\r\ndisks.forEach(function (disk) {\r\n	var requests = [{ \'usage\': \'physicalDisks\', \'path\': \'\', \'target\': \'Drives\' }, { \'usage\': \'virtualDisks\', \'path\': \'/Volumes\', \'target\': \'Members\' }];\r\n\r\n	requests.forEach(function (request) {\r\n		const disks = dell.extractData(dell.executeRequest(disk[\'@odata.id\'] + request[\'path\']), request[\'target\']);\r\n\r\n		if (!Array.isArray(disks) || disks.length <= 0) {\r\n			return;\r\n		}\r\n\r\n		disks.forEach(function (drive) {\r\n			buffer[request[\'usage\']].push(dell.extractData(dell.executeRequest(drive[\'@odata.id\']), keys));\r\n		});\r\n	});\r\n});\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns storage resources.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','3cdb6b1e166247ddbc08a1bfbacb3197','0','2','0'),
('48585','21','','10435','Get network interfaces','dell.server.net.iface.get','1h','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Network Interface\', \'Discovery\', params);\r\n\r\nconst netAdapters = dell.extractData(dell.executeRequest(\'/redfish/v1/Chassis/System.Embedded.1/NetworkAdapters\'), \'Members\');\r\n\r\nvar keys = [\r\n	{\r\n		\'name\': \'path\',\r\n		\'path\': \'@odata.id\'\r\n	},\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Id\'\r\n	}\r\n];\r\n\r\nif (!Array.isArray(netAdapters)) {\r\n	throw \'Unexpected type for network adapters.\';\r\n}\r\n\r\nvar buffer = [];\r\n\r\nnetAdapters.forEach(function (netAdapter) {\r\n	const netPorts = dell.extractData(dell.executeRequest(netAdapter["@odata.id"] + \'/NetworkPorts\'), \'Members\');\r\n\r\n	if (!Array.isArray(netPorts)) {\r\n		return;\r\n	}\r\n\r\n	netPorts.forEach(function (netPort) {\r\n		buffer.push(dell.extractData(dell.executeRequest(netPort["@odata.id"]), keys));\r\n	})\r\n\r\n});\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns network interfaces.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','c5520628f22f4a9ebd1e158b6a89b1a5','0','2','0'),
('48586','21','','10435','Get sensors','dell.server.sensors.get','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\nfunction formatPSU(psuObj) {\r\n	var foundPowerSupplies = [],\r\n		buffer = [];\r\n\r\n	psuObj.forEach(function (obj) {\r\n		const psuName = obj[\'name\'].split(\' \')[0];\r\n\r\n		if (foundPowerSupplies.indexOf(psuName) === -1) {\r\n			foundPowerSupplies.push(psuName);\r\n			buffer.push({\r\n				\'name\': psuName,\r\n				[obj[\'type\'].toLowerCase()]: {\'reading\': obj[\'reading\'], \'health\': obj[\'health\']}\r\n			});\r\n		} else {\r\n			buffer.forEach(function (bufferObj) {\r\n\r\n				if (bufferObj[\'name\'] === psuName) {\r\n					bufferObj[obj[\'type\'].toLowerCase()] = {\'reading\': obj[\'reading\'], \'health\': obj[\'health\']};\r\n\r\n					return;\r\n				}\r\n			});\r\n		}\r\n	})\r\n	return buffer;\r\n};\r\n\r\nfunction formatTemp(tempObj) {\r\n	tempObj.forEach(function (obj) {\r\n		obj.name = obj.name.split(\' \').slice(0, -1).join(\' \');\r\n	});\r\n\r\n	return tempObj;\r\n}\r\n\r\nfunction formatSysBoard(sysObj) {\r\n	const remove = [\'System\', \'Board\', \'Usage\'];\r\n\r\n	sysObj.forEach(function (obj) {\r\n		var buffer = [];\r\n\r\n		obj[\'name\'].split(\' \').forEach(function (word) {\r\n			var match = false;\r\n\r\n			remove.forEach(function (removeWord) {\r\n				if (removeWord === word) {\r\n					match = true;\r\n				}\r\n			});\r\n\r\n			if (!match) {\r\n				buffer.push(word);\r\n			}\r\n		});\r\n\r\n		if (buffer.length > 0) {\r\n			obj[\'name\'] = buffer.join(\' \');\r\n		}\r\n	});\r\n\r\n	return sysObj;\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Sensor\', \'Discovery\', params);\r\n\r\nconst sensors = dell.extractData(dell.executeRequest(\'/redfish/v1/Chassis/System.Embedded.1/Sensors?$expand=.($levels=1)\'), \'Members\');\r\n\r\nif (!Array.isArray(sensors)) {\r\n	throw \'Unexpected type for sensors.\';\r\n}\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Name\'\r\n	},\r\n	{\r\n		\'name\': \'context\',\r\n		\'path\': \'PhysicalContext\'\r\n	},\r\n	{\r\n		\'name\': \'reading\',\r\n		\'path\': \'Reading\'\r\n	},\r\n	{\r\n		\'name\': \'type\',\r\n		\'path\': \'ReadingType\'\r\n	},\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	}\r\n];\r\n\r\nvar buffer = { \'fan\': [], \'psu\': [], \'temperature\': [], \'sysBoard\': [] };\r\n\r\nsensors.forEach(function (sensor) {\r\n	if (sensor[\'Name\'].substring(0, 2) === \'PS\' && sensor[\'PhysicalContext\'] === \'PowerSupply\') {\r\n		buffer[\'psu\'].push(dell.extractData(sensor, keys, true));\r\n	} else if (sensor[\'ReadingType\'] === \'Temperature\') {\r\n		buffer[\'temperature\'].push(dell.extractData(sensor, keys, true));\r\n	} else if (sensor[\'Name\'].includes(\'Fan\') && sensor[\'ReadingType\'] === \'Rotational\') {\r\n		buffer[\'fan\'].push(dell.extractData(sensor, keys, true));\r\n	} else if (sensor[\'Name\'].includes(\'System Board\') && sensor[\'ReadingType\'] === \'Percent\') {\r\n		buffer[\'sysBoard\'].push(dell.extractData(sensor, keys, true));\r\n	}\r\n});\r\n\r\nbuffer[\'psu\'] = formatPSU(buffer[\'psu\']);\r\nbuffer[\'temperature\'] = formatTemp(buffer[\'temperature\']);\r\nbuffer[\'sysBoard\'] = formatSysBoard(buffer[\'sysBoard\']);\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns sensors.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','ab6d8e8ed72f4b64b30a3f1d11a0d4d6','0','2','0'),
('48599','21','','10435','Interface [{#IFNAME}]: Get interface','dell.server.net.if.get[{#IFNAME}]','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'path\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Network Interface\', \'Get metrics\', params);\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'linkStatus\',\r\n		\'path\': \'LinkStatus\'\r\n	},\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'state\',\r\n		\'path\': \'Status.State\'\r\n	},\r\n	{\r\n		\'name\': \'linkSpeed\',\r\n		\'path\': \'CurrentLinkSpeedMbps\'\r\n	}\r\n];\r\n\r\nreturn JSON.stringify(dell.extractData(dell.executeRequest(params.path), keys));','','0','','','','','2',NULL,'Returns the metrics of a network interface.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','83f2022ae915408e8b8e6318e6f7b57b','0','2','0'),
('48600','21','','10435','Physical disk [{#DISK_NAME}]: Get disk','dell.server.hw.physicaldisk.get[{#DISK_NAME}]','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'path\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Disk\', \'Get physical disk metrics\', params);\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'sn\',\r\n		\'path\': \'SerialNumber\'\r\n	},\r\n	{\r\n		\'name\': \'model\',\r\n		\'path\': \'Model\'\r\n	},\r\n	{\r\n		\'name\': \'mediaType\',\r\n		\'path\': \'MediaType\'\r\n	},\r\n	{\r\n		\'name\': \'capacity\',\r\n		\'path\': \'CapacityBytes\'\r\n	}\r\n];\r\n\r\nreturn JSON.stringify(dell.extractData(dell.executeRequest(params.path), keys));','','0','','','','','2',NULL,'Returns the metrics of a physical disk.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','8e8a8788befb4d779e2a99165b05d529','0','2','0'),
('48601','21','','10435','Virtual disk [{#DISK_NAME}]: Get disk','dell.server.hw.virtualdisk.get[{#DISK_NAME}]','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'path\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Disk\', \'Get virtual disk metrics\', params);\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'capacity\',\r\n		\'path\': \'CapacityBytes\'\r\n	},\r\n	{\r\n		\'name\': \'status\',\r\n		\'path\': \'Status.State\'\r\n	},\r\n	{\r\n		\'name\': \'raidStatus\',\r\n		\'path\': \'Oem.Dell.DellVirtualDisk.RaidStatus\'\r\n	},\r\n	{\r\n		\'name\': \'readCachePolicy\',\r\n		\'path\': \'Oem.Dell.DellVirtualDisk.ReadCachePolicy\'\r\n	},\r\n	{\r\n		\'name\': \'writeCachePolicy\',\r\n		\'path\': \'Oem.Dell.DellVirtualDisk.WriteCachePolicy\'\r\n	}\r\n];\r\n\r\nreturn JSON.stringify(dell.extractData(dell.executeRequest(params.path), keys));','','0','','','','','2',NULL,'Returns the metrics of a virtual disk.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','2d40df5f9ef14013a45f48bad2d5e133','0','2','0'),
('48630','20','walk[1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1.38,1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1.79,1.3.6.1.4.1.674.10892.5.5.1.20.130.1.1.2]','10436','SNMP walk RAID controllers table','dell.server.array.controller.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of RAID Controllers Table `IDRAC-MIB-SMIv2::controllerTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','93c5649909334a61ba0414fe7e0063a3','0','2','0'),
('48631','20','walk[1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1.1,1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1.4,1.3.6.1.4.1.674.10892.5.5.1.20.130.15.1.21]','10436','SNMP walk Battery table','dell.server.battery.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of RAID Controllers Table `IDRAC-MIB-SMIv2::batteryTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','34a1321bf79841a2a600b11e12d3cef1','0','2','0'),
('48632','20','get[1.3.6.1.4.1.674.10892.5.4.300.50.1.8.1.1]','10436','BIOS version','dell.server.bios.version','1m','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: IDRAC-MIB-SMIv2\r\nThis attribute defines the version name of the system BIOS.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5e8cd7ff8b5b4ac796147f72087ea925','0','2','0'),
('48633','20','walk[1.3.6.1.4.1.674.10892.5.4.1100.30.1.26,1.3.6.1.4.1.674.10892.5.4.1100.32.1.5.1,1.3.6.1.4.1.674.10892.5.4.1100.32.1.6.1]','10436','SNMP walk Processor device tables','dell.server.cpu.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Processor Device Status Table `IDRAC-MIB-SMIv2::processorDeviceTable` and `IDRAC-MIB-SMIv2::processorDeviceStatusTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','4f2fabba628e45ab9dc8627e32e9a35a','0','2','0'),
('48634','20','walk[1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.1,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.2,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.24,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.31,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.6,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.7,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.35,1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.11]','10436','SNMP walk Physical disk table','dell.server.disk.physical.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Physical Disk Table `IDRAC-MIB-SMIv2::physicalDiskTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','9773c82f46a6485992049843de57de3e','0','2','0'),
('48635','20','walk[1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.1,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.2,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.13,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.30,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.11,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.10,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.6,1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.4]','10436','SNMP walk Virtual disk table','dell.server.disk.virtual.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Virtual Disk Table `IDRAC-MIB-SMIv2::virtualDiskTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','bf3b1c74945f40549ddd4688250846e1','0','2','0'),
('48636','20','walk[1.3.6.1.4.1.674.10892.5.4.700.12.1.5,1.3.6.1.4.1.674.10892.5.4.700.12.1.8,1.3.6.1.4.1.674.10892.5.4.700.12.1.7,1.3.6.1.4.1.674.10892.5.4.700.12.1.6]','10436','SNMP walk Cooling device table','dell.server.fan.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Cooling Device Table `IDRAC-MIB-SMIv2::coolingDeviceTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5e06ce9f690c4671bf0fbf38aa6e3b89','0','2','0'),
('48637','20','get[1.3.6.1.4.1.674.10892.5.2.5.0]','10436','Uptime (hardware)','dell.server.hw.uptime[systemPowerUpTime]','1m','31d','0','0','3','','uptime','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: IDRAC-MIB-SMIv2\r\nThis attribute defines the power-up time of the system in seconds.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3240487059234b49bb822113c1964693','0','2','0'),
('48638','15','','10436','Memory, total size','dell.server.memory.size.total','1m','31d','365d','0','3','','B','','',NULL,NULL,'sum(last_foreach(//dell.server.memory.size[*]))','','0','','','','','0',NULL,'Total memory amount on the device.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','beac13b3dfa04b0a9edf1a01e559021e','0','2','0'),
('48639','20','walk[1.3.6.1.4.1.674.10892.5.4.1100.50.1.8.1,1.3.6.1.4.1.674.10892.5.4.1100.50.1.5.1,1.3.6.1.4.1.674.10892.5.4.1100.50.1.14.1]','10436','SNMP walk Memory device table','dell.server.memory.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Memory Device Table `IDRAC-MIB-SMIv2::memoryDeviceTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','84267fb8555d48398b661bce37be8a74','0','2','0'),
('48640','20','walk[1.3.6.1.4.1.674.10892.5.4.1100.90.1.4.1,1.3.6.1.4.1.674.10892.5.4.1100.90.1.30.1,1.3.6.1.4.1.674.10892.5.4.1100.90.1.3.1, 1.3.6.1.4.1.674.10892.5.4.1100.90.1.15.1]','10436','SNMP walk Network device table','dell.server.net.if.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Network Device Table `IDRAC-MIB-SMIv2::networkDeviceTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2d273acf4bb646d7a3ca9602d7b529af','0','2','0'),
('48641','20','get[1.3.6.1.6.3.10.2.1.3.0]','10436','Uptime (network)','dell.server.net.uptime[snmpEngineTime]','1m','31d','0','0','3','','uptime','','',NULL,NULL,'','','0','','','','','0',NULL,'MIB: SNMP-FRAMEWORK-MIB\r\nThe number of seconds since the value of the snmpEngineBoots object last changed.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','767944c5d9e0470580f813948d9dbe96','0','2','0'),
('48642','20','walk[1.3.6.1.4.1.674.10892.5.4.600.12.1.5,1.3.6.1.4.1.674.10892.5.4.600.12.1.8]','10436','SNMP walk Power supply table','dell.server.psu.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Power Supply Table `IDRAC-MIB-SMIv2::powerSupplyTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','a5b4a818eeb04e1fb072b3b8e76441f3','0','2','0'),
('48643','20','walk[1.3.6.1.4.1.674.10892.5.4.700.20.1.1,1.3.6.1.4.1.674.10892.5.4.700.20.1.8,1.3.6.1.4.1.674.10892.5.4.700.20.1.6,1.3.6.1.4.1.674.10892.5.4.700.20.1.5]','10436','SNMP walk Temperature sensor table','dell.server.sensor.temp.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Temperature Probe Table `IDRAC-MIB-SMIv2::temperatureProbeTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','6f407f3ff09f48179075f54eb26604db','0','2','0'),
('48644','20','walk[1.3.6.1.4.1.674.10892.5.4.600.50.1.7.1,1.3.6.1.4.1.674.10892.5.4.600.50.1.5.1]','10436','SNMP walk System battery table','dell.server.system.battery.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of System Battery Table `IDRAC-MIB-SMIv2::systemBatteryTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8cb0cacb3ca144d2b917ea457ef3ba24','0','2','0'),
('48645','20','walk[1.3.6.1.4.1.674.10892.5.4.600.20.1.8.1,1.3.6.1.4.1.674.10892.5.4.600.20.1.6.1,1.3.6.1.4.1.674.10892.5.4.600.20.1.5.1,1.3.6.1.4.1.674.10892.5.4.600.20.1.7.1]','10436','SNMP walk Voltage probe table','dell.server.voltage.walk','1m','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Scanning of Voltage Probe Table `IDRAC-MIB-SMIv2::voltageProbeTable`.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','5f7dc7b0c23c40e4b8442ae1223d70d5','0','2','0'),
('48666','21','','10437','Get array controller resources','dell.server.array.resources.get','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Controller\', \'Discovery\', params);\r\n\r\nconst controllers = dell.extractData(dell.executeRequest(\'/redfish/v1/Systems/System.Embedded.1/Storage?$expand=.($levels=1)\'), \'Members\');\r\n\r\nvar arrControllerKeys = [\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Name\'\r\n	},\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'slot\',\r\n		\'path\': \'Oem.Dell.DellController.PCISlot\'\r\n	}\r\n];\r\n\r\nvar battControllerKeys = [\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Oem.Dell.DellControllerBattery.Id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Oem.Dell.DellControllerBattery.Name\'\r\n	},\r\n	{\r\n		\'name\': \'status\',\r\n		\'path\': \'Oem.Dell.DellControllerBattery.PrimaryStatus\'\r\n	}\r\n];\r\n\r\nif (!Array.isArray(controllers)) {\r\n	throw \'Unexpected type for controllers.\';\r\n}\r\n\r\nvar buffer = { \'arrayControllers\': [], \'batteryControllers\': [] };\r\n\r\ncontrollers.forEach(function (controller) {\r\n	if (controller[\'Id\'].search(\'RAID\') > -1) {\r\n		buffer[\'arrayControllers\'].push(dell.extractData(controller, arrControllerKeys, true));\r\n		buffer[\'batteryControllers\'].push(dell.extractData(controller, battControllerKeys, true));\r\n	}\r\n});\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns array controller resources.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','d913e585d3834b86a552e5cc7fe717fc','0','2','0'),
('48667','21','','10437','Get disks','dell.server.disks.get','1h','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Disk\', \'Discovery\', params);\r\n\r\nconst disks = dell.extractData(dell.executeRequest(\'/redfish/v1/Systems/System.Embedded.1/Storage\'), \'Members\');\r\n\r\nvar keys = [\r\n	{\r\n		\'name\': \'path\',\r\n		\'path\': \'@odata.id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Name\'\r\n	}\r\n];\r\n\r\nif (!Array.isArray(disks)) {\r\n	throw \'Unexpected type for disks.\';\r\n}\r\n\r\nvar buffer = { \'physicalDisks\': [], \'virtualDisks\': [] };\r\n\r\ndisks.forEach(function (disk) {\r\n	var requests = [{ \'usage\': \'physicalDisks\', \'path\': \'\', \'target\': \'Drives\' }, { \'usage\': \'virtualDisks\', \'path\': \'/Volumes\', \'target\': \'Members\' }];\r\n\r\n	requests.forEach(function (request) {\r\n		const disks = dell.extractData(dell.executeRequest(disk[\'@odata.id\'] + request[\'path\']), request[\'target\']);\r\n\r\n		if (!Array.isArray(disks) || disks.length <= 0) {\r\n			return;\r\n		}\r\n\r\n		disks.forEach(function (drive) {\r\n			buffer[request[\'usage\']].push(dell.extractData(dell.executeRequest(drive[\'@odata.id\']), keys));\r\n		});\r\n	});\r\n});\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns storage resources.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','6d340455b52d45fcadc83a1dc9361544','0','2','0'),
('48668','21','','10437','Get network interfaces','dell.server.net.iface.get','1h','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Network Interface\', \'Discovery\', params);\r\n\r\nconst netAdapters = dell.extractData(dell.executeRequest(\'/redfish/v1/Chassis/System.Embedded.1/NetworkAdapters\'), \'Members\');\r\n\r\nvar keys = [\r\n	{\r\n		\'name\': \'path\',\r\n		\'path\': \'@odata.id\'\r\n	},\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Id\'\r\n	}\r\n];\r\n\r\nif (!Array.isArray(netAdapters)) {\r\n	throw \'Unexpected type for network adapters.\';\r\n}\r\n\r\nvar buffer = [];\r\n\r\nnetAdapters.forEach(function (netAdapter) {\r\n	const netPorts = dell.extractData(dell.executeRequest(netAdapter["@odata.id"] + \'/NetworkPorts\'), \'Members\');\r\n\r\n	if (!Array.isArray(netPorts)) {\r\n		return;\r\n	}\r\n\r\n	netPorts.forEach(function (netPort) {\r\n		buffer.push(dell.extractData(dell.executeRequest(netPort["@odata.id"]), keys));\r\n	})\r\n\r\n});\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns network interfaces.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','405e79c2477e41de8af49785c57bbeb4','0','2','0'),
('48669','21','','10437','Get sensors','dell.server.sensors.get','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\nfunction formatPSU(psuObj) {\r\n	var foundPowerSupplies = [],\r\n		buffer = [];\r\n\r\n	psuObj.forEach(function (obj) {\r\n		const psuName = obj[\'name\'].split(\' \')[0];\r\n\r\n		if (foundPowerSupplies.indexOf(psuName) === -1) {\r\n			foundPowerSupplies.push(psuName);\r\n			buffer.push({\r\n				\'name\': psuName,\r\n				[obj[\'type\'].toLowerCase()]: {\'reading\': obj[\'reading\'], \'health\': obj[\'health\']}\r\n			});\r\n		} else {\r\n			buffer.forEach(function (bufferObj) {\r\n\r\n				if (bufferObj[\'name\'] === psuName) {\r\n					bufferObj[obj[\'type\'].toLowerCase()] = {\'reading\': obj[\'reading\'], \'health\': obj[\'health\']};\r\n\r\n					return;\r\n				}\r\n			});\r\n		}\r\n	})\r\n	return buffer;\r\n};\r\n\r\nfunction formatTemp(tempObj) {\r\n	tempObj.forEach(function (obj) {\r\n		obj.name = obj.name.split(\' \').slice(0, -1).join(\' \');\r\n	});\r\n\r\n	return tempObj;\r\n}\r\n\r\nfunction formatSysBoard(sysObj) {\r\n	const remove = [\'System\', \'Board\', \'Usage\'];\r\n\r\n	sysObj.forEach(function (obj) {\r\n		var buffer = [];\r\n\r\n		obj[\'name\'].split(\' \').forEach(function (word) {\r\n			var match = false;\r\n\r\n			remove.forEach(function (removeWord) {\r\n				if (removeWord === word) {\r\n					match = true;\r\n				}\r\n			});\r\n\r\n			if (!match) {\r\n				buffer.push(word);\r\n			}\r\n		});\r\n\r\n		if (buffer.length > 0) {\r\n			obj[\'name\'] = buffer.join(\' \');\r\n		}\r\n	});\r\n\r\n	return sysObj;\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Sensor\', \'Discovery\', params);\r\n\r\nconst sensors = dell.extractData(dell.executeRequest(\'/redfish/v1/Chassis/System.Embedded.1/Sensors?$expand=.($levels=1)\'), \'Members\');\r\n\r\nif (!Array.isArray(sensors)) {\r\n	throw \'Unexpected type for sensors.\';\r\n}\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'id\',\r\n		\'path\': \'Id\'\r\n	},\r\n	{\r\n		\'name\': \'name\',\r\n		\'path\': \'Name\'\r\n	},\r\n	{\r\n		\'name\': \'context\',\r\n		\'path\': \'PhysicalContext\'\r\n	},\r\n	{\r\n		\'name\': \'reading\',\r\n		\'path\': \'Reading\'\r\n	},\r\n	{\r\n		\'name\': \'type\',\r\n		\'path\': \'ReadingType\'\r\n	},\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	}\r\n];\r\n\r\nvar buffer = { \'fan\': [], \'psu\': [], \'temperature\': [], \'sysBoard\': [] };\r\n\r\nsensors.forEach(function (sensor) {\r\n	if (sensor[\'Name\'].substring(0, 2) === \'PS\' && sensor[\'PhysicalContext\'] === \'PowerSupply\') {\r\n		buffer[\'psu\'].push(dell.extractData(sensor, keys, true));\r\n	} else if (sensor[\'ReadingType\'] === \'Temperature\') {\r\n		buffer[\'temperature\'].push(dell.extractData(sensor, keys, true));\r\n	} else if (sensor[\'Name\'].includes(\'Fan\') && sensor[\'ReadingType\'] === \'Rotational\') {\r\n		buffer[\'fan\'].push(dell.extractData(sensor, keys, true));\r\n	} else if (sensor[\'Name\'].includes(\'System Board\') && sensor[\'ReadingType\'] === \'Percent\') {\r\n		buffer[\'sysBoard\'].push(dell.extractData(sensor, keys, true));\r\n	}\r\n});\r\n\r\nbuffer[\'psu\'] = formatPSU(buffer[\'psu\']);\r\nbuffer[\'temperature\'] = formatTemp(buffer[\'temperature\']);\r\nbuffer[\'sysBoard\'] = formatSysBoard(buffer[\'sysBoard\']);\r\n\r\nreturn JSON.stringify(buffer);','','0','','','','','0',NULL,'Returns sensors.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','ccd47edb739c47418bdf17141cd60112','0','2','0'),
('48682','21','','10437','Interface [{#IFNAME}]: Get interface','dell.server.net.if.get[{#IFNAME}]','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'path\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Network Interface\', \'Get metrics\', params);\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'linkStatus\',\r\n		\'path\': \'LinkStatus\'\r\n	},\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'state\',\r\n		\'path\': \'Status.State\'\r\n	},\r\n	{\r\n		\'name\': \'linkSpeed\',\r\n		\'path\': \'CurrentLinkSpeedMbps\'\r\n	}\r\n];\r\n\r\nreturn JSON.stringify(dell.extractData(dell.executeRequest(params.path), keys));','','0','','','','','2',NULL,'Returns the metrics of a network interface.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','9c0d896957234a5b99d8f35074a07d7b','0','2','0'),
('48683','21','','10437','Physical disk [{#DISK_NAME}]: Get disk','dell.server.hw.physicaldisk.get[{#DISK_NAME}]','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'path\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Disk\', \'Get physical disk metrics\', params);\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'sn\',\r\n		\'path\': \'SerialNumber\'\r\n	},\r\n	{\r\n		\'name\': \'model\',\r\n		\'path\': \'Model\'\r\n	},\r\n	{\r\n		\'name\': \'mediaType\',\r\n		\'path\': \'MediaType\'\r\n	},\r\n	{\r\n		\'name\': \'capacity\',\r\n		\'path\': \'CapacityBytes\'\r\n	}\r\n];\r\n\r\nreturn JSON.stringify(dell.extractData(dell.executeRequest(params.path), keys));','','0','','','','','2',NULL,'Returns the metrics of a physical disk.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','84314bd54ce0457f873b6ada5c40cd0d','0','2','0'),
('48684','21','','10437','Virtual disk [{#DISK_NAME}]: Get disk','dell.server.hw.virtualdisk.get[{#DISK_NAME}]','1m','0','0','0','4','','','','',NULL,NULL,'function validateZabbixParams(requiredParams, allParams) {\r\n	requiredParams.forEach(function (field) {\r\n		if (typeof allParams !== \'object\' || typeof allParams[field] === \'undefined\' || allParams[field] === \'\') {\r\n			throw \'Required param is not set: \' + field + \'.\';\r\n		}\r\n	});\r\n}\r\n\r\nfunction Dell(service, action, params) {\r\n	this.zabbixLogPrefix = \'[ DELL ] [ \' + service + \' ] [ \' + action + \' ]\';\r\n	this.request = new HttpRequest();\r\n\r\n	this.executeRequest = function (apiPath) {\r\n		this.request.addHeader(\'Authorization: Basic \' + btoa(params[\'user\'] + \':\' + params[\'password\']));\r\n\r\n		if (params[\'http_proxy\']) {\r\n			this.request.setProxy(params[\'http_proxy\']);\r\n			Zabbix.log(4, this.zabbixLogPrefix + \' Using http proxy: \' + params[\'http_proxy\']);\r\n		}\r\n\r\n		const response = this.request.get(params[\'url\'] + apiPath);\r\n\r\n		this.request.clearHeader();\r\n\r\n		if (this.request.getStatus() === parseInt(params[\'http_status_code\'])) {\r\n			return response;\r\n		} else {\r\n			Zabbix.log(3, this.zabbixLogPrefix + \' Unexpected HTTP response code: \' + this.request.getStatus());\r\n			throw \'Unexpected HTTP response code: \' + this.request.getStatus();\r\n		}\r\n	};\r\n\r\n	this.extractData = function (data, keys, skipParse) {\r\n		if (!skipParse) {\r\n			try {\r\n				data = JSON.parse(data);\r\n			} catch (error) {\r\n				Zabbix.log(3, this.zabbixLogPrefix + \' Could not parse the received JSON object: \' + data);\r\n				throw \'Could not parse received JSON object. See logs for more information.\';\r\n			}	\r\n		}\r\n\r\n		if (Array.isArray(keys)) {\r\n			var returnBuffer = {};\r\n\r\n			for (keyIdx = 0, keysLength = keys.length; keyIdx < keysLength; keyIdx++) {\r\n				if (keys[keyIdx][\'path\'] === \'@odata.id\') {\r\n					returnBuffer[keys[keyIdx][\'name\']] = data[keys[keyIdx][\'path\']];\r\n				} else {\r\n					returnBuffer[keys[keyIdx][\'name\']] = this.parseJSON(data, keys[keyIdx][\'path\'].split(\'.\'));\r\n				}\r\n			}\r\n\r\n			return returnBuffer;\r\n		} else if (typeof keys === \'object\') {\r\n			return { [keys[\'name\']]: this.parseJSON(data, keys[\'path\'].split(\'.\')) };\r\n		} else if (typeof keys === \'string\') {\r\n			return this.parseJSON(data, keys.split(\'.\'));\r\n		} else {\r\n			throw \'Unexpected key type\';\r\n		}\r\n	};\r\n\r\n	this.parseJSON = function (data, jsonPath) {\r\n		for (var i = 0, args = jsonPath.length; i < args; i++) {\r\n			data = data[jsonPath[i]];\r\n		}\r\n\r\n		return data;\r\n	}\r\n}\r\n\r\n\r\nconst params = JSON.parse(value);\r\n\r\nvalidateZabbixParams([\'url\', \'path\', \'user\', \'password\', \'http_status_code\'], params);\r\nvar dell = new Dell(\'Disk\', \'Get virtual disk metrics\', params);\r\n\r\nconst keys = [\r\n	{\r\n		\'name\': \'health\',\r\n		\'path\': \'Status.Health\'\r\n	},\r\n	{\r\n		\'name\': \'capacity\',\r\n		\'path\': \'CapacityBytes\'\r\n	},\r\n	{\r\n		\'name\': \'status\',\r\n		\'path\': \'Status.State\'\r\n	},\r\n	{\r\n		\'name\': \'raidStatus\',\r\n		\'path\': \'Oem.Dell.DellVirtualDisk.RaidStatus\'\r\n	},\r\n	{\r\n		\'name\': \'readCachePolicy\',\r\n		\'path\': \'Oem.Dell.DellVirtualDisk.ReadCachePolicy\'\r\n	},\r\n	{\r\n		\'name\': \'writeCachePolicy\',\r\n		\'path\': \'Oem.Dell.DellVirtualDisk.WriteCachePolicy\'\r\n	}\r\n];\r\n\r\nreturn JSON.stringify(dell.extractData(dell.executeRequest(params.path), keys));','','0','','','','','2',NULL,'Returns the metrics of a virtual disk.','0','7d','0','',NULL,'{$DELL.HTTP.REQUEST.TIMEOUT}','','','','200','1','0','','','0','0','0','0','0','0','0','bb156d13a6514151ad9673a91e8463ef','0','2','0'),
