('46861','21','','10620','Get enabled object lifecycle management','oci.obj.storage.metrics.olm.get','3h','31d','365d','0','3','','','','',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\n\r\nconst params = JSON.parse(value);\r\nvalidateZabbixParams([\'tenancy_ocid\', \'user_ocid\', \'private_key\', \'fingerprint\', \'api_host\', \'bucket_name\', \'http_status_code\', \'req_interval\', \'compartment_id\'], params);\r\nvar oci = new OCI(\'Object storage\', \'Get metrics \' + params[\'req_interval\'] + \'m\', params);\r\nconst mql = \'EnabledOLM[\' + params[\'req_interval\'] + \'m]{resourceDisplayName=\' + params[\'bucket_name\'] + \'}.mean()\';\r\n\r\nreturn JSON.stringify(oci.extractData(\'post\', oci.executeRequest(\'post\', \'/20180401/metrics/actions/summarizeMetricsData\', \'?compartmentId=\' + encodeURIComponent(params[\'compartment_id\']), mql, \'oci_objectstorage\'), \'aggregatedDatapoints\'));','','0','','','','','0',NULL,'Indicates whether a bucket has any executable Object Lifecycle Management policies configured. `EnabledOLM` emits:\r\n\r\n    1 - if policies are configured\r\n    0 - if no policies are configured','0','7d','0','',NULL,'10s','','','','200','1','0','','','0','0','0','0','0','0','0','5bb5ba3011e94e43bb1fdc79668c9537','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}"]','1h','0','0','0','4','','','','',NULL,NULL,'show replica 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 CON_ID, 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\r\n	CON_ID,\r\n	NVL(CON$NAME, \'DB\') CON_NAME,\r\n	TABLESPACE_NAME TABLESPACE,\r\n	CONTENTS\r\nFROM\r\n	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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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','get[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	getRoleBaseCredentials: function () {\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	},\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.getRoleBaseCredentials();\r\n				break;\r\n			case \'assume_role\':\r\n				if (typeof params.metadata_auth === \'undefined\' || params.metadata_auth === \'\' || (params.metadata_auth !== \'true\' && params.metadata_auth !== \'false\')) {\r\n					throw \'Required param metadata_auth for assume_role is not set or has invalid value: "\' + params.metadata_auth + \'". Expected "true" or "false".\';\r\n				}\r\n				if (params.metadata_auth === \'true\') {\r\n					AWS.getRoleBaseCredentials();\r\n					AWS.params[\'SessionToken\'] = AWS.params[\'Token\'];\r\n					AWS.params[\'auth_type\'] = \'assume_role_metadata\';\r\n\r\n					[\'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\r\n				if (params.metadata_auth === \'false\') {\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\r\n				const role_arn_regex = /role\\/(.+)$/;\r\n				const match = AWS.params.role_arn.match(role_arn_regex);\r\n				if (!match) {\r\n					throw \'Invalid role ARN format.\';\r\n				}\r\n\r\n				const payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': match[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_metadata\' || (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	getRoleBaseCredentials: function () {\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	},\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.getRoleBaseCredentials();\r\n				break;\r\n			case \'assume_role\':\r\n				if (typeof params.metadata_auth === \'undefined\' || params.metadata_auth === \'\' || (params.metadata_auth !== \'true\' && params.metadata_auth !== \'false\')) {\r\n					throw \'Required param metadata_auth for assume_role is not set or has invalid value: "\' + params.metadata_auth + \'". Expected "true" or "false".\';\r\n				}\r\n				if (params.metadata_auth === \'true\') {\r\n					AWS.getRoleBaseCredentials();\r\n					AWS.params[\'SessionToken\'] = AWS.params[\'Token\'];\r\n					AWS.params[\'auth_type\'] = \'assume_role_metadata\';\r\n\r\n					[\'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\r\n				if (params.metadata_auth === \'false\') {\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\r\n				const role_arn_regex = /role\\/(.+)$/;\r\n				const match = AWS.params.role_arn.match(role_arn_regex);\r\n				if (!match) {\r\n					throw \'Invalid role ARN format.\';\r\n				}\r\n\r\n				const payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': match[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_metadata\' || (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	getRoleBaseCredentials: function () {\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	},\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.getRoleBaseCredentials();\r\n				break;\r\n			case \'assume_role\':\r\n				if (typeof params.metadata_auth === \'undefined\' || params.metadata_auth === \'\' || (params.metadata_auth !== \'true\' && params.metadata_auth !== \'false\')) {\r\n					throw \'Required param metadata_auth for assume_role is not set or has invalid value: "\' + params.metadata_auth + \'". Expected "true" or "false".\';\r\n				}\r\n				if (params.metadata_auth === \'true\') {\r\n					AWS.getRoleBaseCredentials();\r\n					AWS.params[\'SessionToken\'] = AWS.params[\'Token\'];\r\n					AWS.params[\'auth_type\'] = \'assume_role_metadata\';\r\n\r\n					[\'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\r\n				if (params.metadata_auth === \'false\') {\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\r\n				const role_arn_regex = /role\\/(.+)$/;\r\n				const match = AWS.params.role_arn.match(role_arn_regex);\r\n				if (!match) {\r\n					throw \'Invalid role ARN format.\';\r\n				}\r\n\r\n				const payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': match[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_metadata\' || (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'),
('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','21','','10629','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'),
('47159','21','','10629','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'),
('47160','21','','10629','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'),
('47161','21','','10629','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'),
('47162','21','','10629','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'),
('47163','21','','10629','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'),
('47164','21','','10629','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'),
('47195','16','','10630','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'),
('47196','16','','10630','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'),
('47197','16','','10630','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'),
('47198','16','','10630','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'),
('47199','16','','10630','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'),
('47200','16','','10630','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'),
('47201','16','','10630','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'),
('47202','16','','10630','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'),
('47203','16','','10630','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'),
('47204','16','','10630','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'),
('47205','16','','10630','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'),
('47206','16','','10630','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'),
('47207','16','','10630','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'),
('47208','16','','10630','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'),
('47209','16','','10630','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'),
('47210','16','','10630','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'),
('47211','16','','10630','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'),
('47212','16','','10630','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'),
('47213','16','','10630','DB: Connections: State','jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=state,name=value",Value]','1m','31d','365d','0','3','','','','',NULL,'1224','','','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'),
('47214','16','','10630','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'),
('47215','16','','10630','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'),
('47216','16','','10630','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'),
('47217','16','','10630','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'),
('47218','16','','10630','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,'1226','','','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'),
('47219','16','','10630','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'),
('47220','16','','10630','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'),
('47221','16','','10630','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'),
('47222','16','','10630','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'),
('47223','16','','10630','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'),
('47237','21','','10631','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'),
('47238','21','','10631','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'),
('47239','21','','10631','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'),
('47240','21','','10631','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'),
('47241','21','','10631','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'),
('47242','21','','10631','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'),
('47414','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'),
('47415','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'),
('47416','3','','10174','Snapshot consolidation needed','vmware.vm.consolidationneeded[{$VMWARE.URL},{$VMWARE.VM.UUID}]','1m','31d','365d','0','3','','','','',NULL,'1229','','','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'),
('47417','3','','10174','Hypervisor maintenance mode','vmware.vm.hv.maintenance[{$VMWARE.URL},{$VMWARE.VM.UUID}]','1m','31d','365d','0','3','','','','',NULL,'1230','','','0','{$VMWARE.USERNAME}','{$VMWARE.PASSWORD}','','','0',NULL,'Hypervisor maintenance mode. One of the following:\r\n- Normal mode;\r\n- Maintenance mode.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b794d9df3e764df8b04239d5779269cd','0','2','0'),
('47418','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'),
('47419','3','','10174','VM state','vmware.vm.state[{$VMWARE.URL},{$VMWARE.VM.UUID}]','1m','31d','365d','0','3','','','','',NULL,'1232','','','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'),
('47420','3','','10174','VMware Tools status','vmware.vm.tools[{$VMWARE.URL},{$VMWARE.VM.UUID},status]','1m','31d','365d','0','3','','','','',NULL,'1231','','','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'),
('47421','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'),
('47422','3','','10175','Connection state','vmware.hv.connectionstate[{$VMWARE.URL},{$VMWARE.HV.UUID}]','1m','31d','365d','0','3','','','','',NULL,'1233','','','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'),
('47423','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'),
('47424','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'),
('47425','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'),
('47426','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'),
('47427','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'),
('47428','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'),
('47443','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'),
('47444','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'),
('47451','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'),
('47452','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'),
('47455','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'),
('47456','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'),
('47457','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'),
('47458','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'),
('47459','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'),
('47485','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	getRoleBaseCredentials: function () {\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	},\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.getRoleBaseCredentials();\r\n				break;\r\n			case \'assume_role\':\r\n				if (typeof params.metadata_auth === \'undefined\' || params.metadata_auth === \'\' || (params.metadata_auth !== \'true\' && params.metadata_auth !== \'false\')) {\r\n					throw \'Required param metadata_auth for assume_role is not set or has invalid value: "\' + params.metadata_auth + \'". Expected "true" or "false".\';\r\n				}\r\n				if (params.metadata_auth === \'true\') {\r\n					AWS.getRoleBaseCredentials();\r\n					AWS.params[\'SessionToken\'] = AWS.params[\'Token\'];\r\n					AWS.params[\'auth_type\'] = \'assume_role_metadata\';\r\n\r\n					[\'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\r\n				if (params.metadata_auth === \'false\') {\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\r\n				const role_arn_regex = /role\\/(.+)$/;\r\n				const match = AWS.params.role_arn.match(role_arn_regex);\r\n				if (!match) {\r\n					throw \'Invalid role ARN format.\';\r\n				}\r\n\r\n				const payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': match[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_metadata\' || (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'),
('47486','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	getRoleBaseCredentials: function () {\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	},\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.getRoleBaseCredentials();\r\n				break;\r\n			case \'assume_role\':\r\n				if (typeof params.metadata_auth === \'undefined\' || params.metadata_auth === \'\' || (params.metadata_auth !== \'true\' && params.metadata_auth !== \'false\')) {\r\n					throw \'Required param metadata_auth for assume_role is not set or has invalid value: "\' + params.metadata_auth + \'". Expected "true" or "false".\';\r\n				}\r\n				if (params.metadata_auth === \'true\') {\r\n					AWS.getRoleBaseCredentials();\r\n					AWS.params[\'SessionToken\'] = AWS.params[\'Token\'];\r\n					AWS.params[\'auth_type\'] = \'assume_role_metadata\';\r\n\r\n					[\'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\r\n				if (params.metadata_auth === \'false\') {\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\r\n				const role_arn_regex = /role\\/(.+)$/;\r\n				const match = AWS.params.role_arn.match(role_arn_regex);\r\n				if (!match) {\r\n					throw \'Invalid role ARN format.\';\r\n				}\r\n\r\n				const payload = {\r\n					\'Action\': \'AssumeRole\',\r\n					\'Version\': \'2011-06-15\',\r\n					\'RoleArn\': AWS.params.role_arn,\r\n					\'RoleSessionName\': match[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_metadata\' || (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'),
('47504','21','','10634','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'),
('47570','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.dorado.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'),
('47571','20','get[1.3.6.1.4.1.34774.4.1.1.5.0]','10636','Capacity total','huawei.dorado.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'),
('47572','20','get[1.3.6.1.4.1.34774.4.1.1.4.0]','10636','Capacity used','huawei.dorado.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'),
('47573','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.dorado.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'),
('47574','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.dorado.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'),
('47575','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.dorado.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'),
('47576','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.dorado.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'),
('47577','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.dorado.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'),
('47578','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,1.3.6.1.4.1.34774.4.1.21.3.1.4]','10636','Node SNMP walk','huawei.dorado.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'),
('47579','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,1.3.6.1.4.1.34774.4.1.23.4.2.1.27]','10636','Storage pool SNMP walk','huawei.dorado.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'),
('47580','20','get[1.3.6.1.4.1.34774.4.1.1.3.0]','10636','Status','huawei.dorado.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'),
('47581','20','get[1.3.6.1.4.1.34774.4.1.1.6.0]','10636','Version','huawei.dorado.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'),
('47582','3','','10636','ICMP ping','icmpping','1m','31d','365d','0','3','','','','',NULL,'1243','','','0','','','','','0',NULL,'The host accessibility by ICMP ping.\r\n\r\n0 - ICMP ping fails;\r\n1 - ICMP ping successful.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','590714e7fb3f4d468c19385146f76433','0','2','0'),
('47583','3','','10636','ICMP loss','icmppingloss','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'The percentage of lost packets.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','3bcc87c0fee74e64be9b66cc9080008e','0','2','0'),
('47584','3','','10636','ICMP response time','icmppingsec','1m','31d','365d','0','0','','s','','',NULL,NULL,'','','0','','','','','0',NULL,'The ICMP ping response time (in seconds).','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','137b8177ba0b4949a895be9dde23400c','0','2','0'),
('47585','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'),
('47586','20','get[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'),
('47587','20','get[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'),
('47588','20','get[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'),
('47589','20','get[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'),
('47590','20','get[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'),
('47591','20','get[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'),
('47592','20','get[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'),
('47593','5','','10636','SNMP agent availability','zabbix[host,snmp,available]','1m','31d','365d','0','3','','','','',NULL,'1244','','','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'),
('47639','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'),
('47640','7','','10637','Service ping','net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.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','e4252071d0864fd5bf7c60c4d6e4915d','0','2','0'),
('47641','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'),
('47642','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'),
('47689','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'),
('47690','7','','10639','Service status','net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"]','1m','31d','365d','0','3','','','','',NULL,'1246','','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','b68e4123d7c9483c9f77bc9c27fd0e7c','0','2','0'),
('47691','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'),
('47692','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'),
('47710','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 = allParams;\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'),
('47711','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 = allParams;\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'),
('47712','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 = allParams;\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'),
('47713','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 = allParams;\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'),
('47714','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 = allParams;\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'),
('47715','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 = allParams;\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'),
('47716','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 = allParams;\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'),
('47717','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 = allParams;\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'),
('47959','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'),
('47960','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'),
('47961','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'),
('47962','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'),
('47988','15','','10646','Buffer pool efficiency','mysql.buffer_pool_efficiency','1m','31d','365d','0','0','','%','','',NULL,NULL,'100 - (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'),
('47989','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'),
('47990','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'),
('47991','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'),
('47992','7','','10646','Status','mysql.ping["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]','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','338507e500574423915f798234c7f239','0','2','0'),
('47993','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'),
('48050','15','','10647','Buffer pool efficiency','mysql.buffer_pool_efficiency','1m','31d','365d','0','0','','%','','',NULL,NULL,'100 - (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'),
('48051','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'),
('48052','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'),
('48053','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'),
('48054','7','','10647','Status','mysql.ping["{$MYSQL.HOST}","{$MYSQL.PORT}"]','1m','31d','365d','0','3','','','','',NULL,'1261','','','0','','','','','0',NULL,'MySQL server status.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ca43acd282a8435884b33af454b207fb','0','2','0'),
('48055','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'),
('48112','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'),
('48113','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'),
('48114','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'),
('48115','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'),
('48116','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'),
('48117','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'),
('48118','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'),
('48119','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'),
('48120','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'),
('48121','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'),
('48122','7','','10648','Ping','pgsql.ping["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,'1265','','','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'),
('48123','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'),
('48124','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'),
('48125','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'),
('48126','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'),
('48127','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'),
('48128','7','','10648','Replication: Recovery role','pgsql.replication.recovery_role["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,'1263','','','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'),
('48129','7','','10648','Replication: Status','pgsql.replication.status["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,'1264','','','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'),
('48130','7','','10648','Uptime','pgsql.uptime["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','0','','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','46b53fcf97a74619a03c2490fe9b71ea','0','2','0'),
('48131','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'),
('48132','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'),
('48224','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'),
('48225','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'),
('48226','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'),
('48227','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'),
('48228','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'),
('48229','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'),
('48230','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'),
('48231','7','','10649','Ping','pgsql.ping["{$PG.HOST}","{$PG.PORT}"]','1m','31d','365d','0','3','','','','',NULL,'1268','','','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'),
('48232','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'),
('48233','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'),
('48234','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'),
('48235','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,'1266','','','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'),
('48236','7','','10649','Replication: Status','pgsql.replication.status["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]','1m','31d','365d','0','3','','','','',NULL,'1267','','','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'),
('48237','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'),
('48238','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'),
('48239','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'),
('48240','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'),
('48297','0','','10074','CPU spin time','system.cpu.util[,spin]','1m','31d','365d','0','0','','%','','',NULL,NULL,'','','0','','','','','0',NULL,'Time the CPU has spent spinning on a lock.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','636b16908e3746039cf0bc5edf5ef3c6','0','2','0'),
('48298','7','','10650','Number of devices','nvml.device.count','1h','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Retrieves the number of compute devices in the system. A compute device is a single GPU.\r\nFor all Nvidia products.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','efdffab0b401430388a5cb21a789978d','0','2','0'),
('48299','7','','10650','Get devices','nvml.device.get','1h','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Retrieves a list of Nvidia devices in the system.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','6ea9f80195af4c7b89c1f7220fc71df7','0','2','0'),
('48300','7','','10650','Driver version','nvml.system.driver.version','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Retrieves the version of the system\'s graphics driver.\r\nFor all Nvidia products.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','424bce7a262144d0a2bc33bc0b5ee98a','0','2','0'),
('48301','7','','10650','NVML library version','nvml.version','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Retrieves the version of the NVML library.\r\nFor all Nvidia products.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','1566ad71d26a474a858c12ff1cf438fb','0','2','0'),
('48341','0','','10651','Number of devices','nvml.device.count','1h','31d','365d','0','3','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Retrieves the number of compute devices in the system. A compute device is a single GPU.\r\nFor all Nvidia products.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','ac18129f78a54a2e95d1d48630e0eab2','0','2','0'),
('48342','0','','10651','Get devices','nvml.device.get','1h','0','0','0','4','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Retrieves a list of Nvidia devices in the system.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','afe2ea47c42f4992851f02b31efd8225','0','2','0'),
('48343','0','','10651','Driver version','nvml.system.driver.version','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Retrieves the version of the system\'s graphics driver.\r\nFor all Nvidia products.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','824a7555809f4e23b2f7fa72aff28a0c','0','2','0'),
('48344','0','','10651','NVML library version','nvml.version','1h','31d','0','0','1','','','','',NULL,NULL,'','','0','','','','','0',NULL,'Retrieves the version of the NVML library.\r\nFor all Nvidia products.','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','8e54cc700a9147baa5f18aa286c47205','0','2','0'),
('48384','21','','10652','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'),
('48385','15','','10652','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'),
('48400','3','','10654','ICMP ping','icmpping','1m','31d','365d','0','3','','','','',NULL,'1283','','','0','','','','','0',NULL,'','0','7d','0','',NULL,'','','','','200','1','0','','','0','0','0','0','0','0','0','2af50dac1b3245a9b6c350c1096209b6','0','2','0'),
('48401','3','','10654','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'),
('48402','3','','10654','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'),
('48403','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]','10654','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'),
('48404','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]','10654','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'),
('48405','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]','10654','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'),
('48406','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]','10654','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'),
('48407','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]','10654','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'),
('48408','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]','10654','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'),
('48409','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]','10654','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'),
('48410','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]','10654','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'),
('48411','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]','10654','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'),
('48412','20','get[1.3.6.1.2.1.1.4.0]','10654','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'),
('48413','20','get[1.3.6.1.2.1.1.1.0]','10654','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'),
('48414','20','get[1.3.6.1.4.1.2636.3.1.2.0]','10654','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'),
('48415','20','get[1.3.6.1.4.1.2636.3.1.3.0]','10654','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'),
('48416','20','get[1.3.6.1.2.1.25.1.1.0]','10654','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'),
('48417','20','get[1.3.6.1.2.1.1.6.0]','10654','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'),
('48418','20','get[1.3.6.1.2.1.1.5.0]','10654','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'),
('48419','20','get[1.3.6.1.2.1.1.3.0]','10654','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'),
('48420','20','get[1.3.6.1.2.1.1.2.0]','10654','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'),
('48421','20','get[1.3.6.1.2.1.1.1.0]','10654','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'),
('48422','17','','10654','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'),
('48423','5','','10654','SNMP agent availability','zabbix[host,snmp,available]','1m','31d','365d','0','3','','','','',NULL,'1284','','','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'),
('48472','19','','10655','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'),
('48473','19','','10655','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'),
('48474','19','','10655','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'),
('48475','19','','10655','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'),
('48476','19','','10655','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'),
('48477','19','','10655','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'),
('48478','19','','10655','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'),
('48479','19','','10655','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'),
('48480','19','','10655','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'),
('48481','19','','10655','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'),
('48549','21','','10656','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'),
('48550','21','','10656','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'),
('48551','21','','10656','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\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'),
('48552','21','','10656','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'),
('48553','21','','10656','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'),
('48554','3','','10656','Redfish API status','net.tcp.service[https]','1m','31d','365d','0','3','','','','',NULL,'1290','','','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'),
('48602','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]','10657','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'),
('48603','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]','10657','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'),
('48604','20','get[1.3.6.1.4.1.674.10892.5.4.300.50.1.8.1.1]','10657','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'),
('48605','20','get[1.3.6.1.2.1.1.4.0]','10657','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'),
('48606','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]','10657','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'),
('48607','20','get[1.3.6.1.2.1.1.1.0]','10657','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'),
('48608','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]','10657','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'),
('48609','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]','10657','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'),
('48610','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]','10657','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'),
('48611','20','get[1.3.6.1.4.1.674.10892.5.1.1.8.0]','10657','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'),
('48612','20','get[1.3.6.1.4.1.674.10892.5.1.3.12.0]','10657','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'),
('48613','20','get[1.3.6.1.4.1.674.10892.5.1.3.2.0]','10657','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'),
('48614','20','get[1.3.6.1.4.1.674.10892.5.2.5.0]','10657','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'),
('48615','20','get[1.3.6.1.2.1.1.6.0]','10657','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'),
('48616','15','','10657','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'),
('48617','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]','10657','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'),
('48618','20','get[1.3.6.1.2.1.1.5.0]','10657','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'),
('48619','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]','10657','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'),
('48620','20','get[1.3.6.1.6.3.10.2.1.3.0]','10657','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'),
('48621','20','get[1.3.6.1.2.1.1.2.0]','10657','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'),
('48622','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]','10657','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'),
('48623','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]','10657','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'),
('48624','20','get[1.3.6.1.4.1.674.10892.5.2.1.0]','10657','Overall system health status','dell.server.status[globalSystemStatus]','1m','31d','0','0','3','','','','',NULL,'1299','','','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'),
('48625','20','get[1.3.6.1.4.1.674.10892.5.1.3.6.0]','10657','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'),
('48626','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]','10657','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'),
('48627','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]','10657','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'),
('48628','17','','10657','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'),
('48629','5','','10657','SNMP agent availability','zabbix[host,snmp,available]','1m','31d','365d','0','3','','','','',NULL,'1309','','','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'),
('48671','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'),
('48672','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'),
('48673','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\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'),
('48674','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'),
('48718','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'),
('48719','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'),
('48720','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'),
('48721','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'),
('48722','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'),
('48723','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'),
('48724','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'),
('48725','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'),
('48726','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'),
('48727','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'),
('48728','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'),
('48729','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'),
('48730','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'),
('48731','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'),
('48732','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'),
('48733','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'),
('48754','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'),
('48755','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'),
('48756','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\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'),
('48757','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'),
('48801','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]','10438','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','f956a1ccd0f14b1b88c1d98e6850cd7b','0','2','0'),
('48802','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]','10438','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','ab2744fa308e4a51be4617b7ded321a0','0','2','0'),
('48803','20','get[1.3.6.1.4.1.674.10892.5.4.300.50.1.8.1.1]','10438','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','3e3a215ef84946619beb4cc769ef7573','0','2','0'),
('48804','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]','10438','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','0612a426ef21465085614e790fa4e886','0','2','0'),
('48805','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]','10438','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','d3ab597f3148403f801b32f9faa71e34','0','2','0'),
('48806','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]','10438','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','0f11e52e20ca4dd2a0723ba0a86eda20','0','2','0'),
('48807','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]','10438','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','f5b95355db804ca2a1f050b45174faa5','0','2','0'),
('48808','20','get[1.3.6.1.4.1.674.10892.5.2.5.0]','10438','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','330f4c339c95443fb87640d2d807e4d9','0','2','0'),
('48809','15','','10438','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','78d9d2f87bd743e4b55cc8e9ca64fd1e','0','2','0'),
('48810','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]','10438','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','68deb350a71341e19dc6740d327af700','0','2','0'),
('48811','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]','10438','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','25dc5f538e5b4b108e9fcc6866cbbdf4','0','2','0'),
('48812','20','get[1.3.6.1.6.3.10.2.1.3.0]','10438','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','c0953b2a7dc24b03b098b6ae66af77df','0','2','0'),
('48813','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]','10438','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','a9c00a61d4284fe581d097739dcc3f86','0','2','0'),
('48814','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]','10438','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','1acb2a2c55b349278c46e2d4f12b446b','0','2','0'),
('48815','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]','10438','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','e3e8a5715afe4109b5c157ccf33e8a85','0','2','0'),
('48816','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]','10438','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','71732127775d4675b73bea0d7b941b60','0','2','0'),
('48837','21','','10658','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','5758eff4369d494981404a54f84306e4','0','2','0'),
('48838','21','','10658','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','fed600a0b427471685abbdf145e7536d','0','2','0'),
('48839','21','','10658','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\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','36bb12f18137442aaad4b5c7d0aaa713','0','2','0'),
('48840','21','','10658','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','4cf208355d724de39347889314e2df1d','0','2','0'),
('48841','21','','10658','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','b9acc3a3d4d74a19911fce16f8a3a8d5','0','2','0'),
('48842','3','','10658','Redfish API status','net.tcp.service[https]','1m','31d','365d','0','3','','','','',NULL,'1329','','','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','cb5fc3e47c5444fcaff32a351bb1a392','0','2','0'),
('48890','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]','10659','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','afe5a32aaab74acc94199a87c8eb893f','0','2','0'),
('48891','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]','10659','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','2058910ac68046bcbbe3c541d8493cc6','0','2','0'),
('48892','20','get[1.3.6.1.4.1.674.10892.5.4.300.50.1.8.1.1]','10659','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','8369cb7f9e9040eda117ed54acae56ef','0','2','0'),
('48893','20','get[1.3.6.1.2.1.1.4.0]','10659','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','1ed40c90dc2a4c329467fcd8796e4826','0','2','0'),
('48894','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]','10659','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','5eb47d9d420446cba50d5bdf8ce94ea2','0','2','0'),
('48895','20','get[1.3.6.1.2.1.1.1.0]','10659','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','6bfce5ab91884d75a8771a6648ab90b5','0','2','0'),
('48896','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]','10659','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','35400811500f4b7fb3444aebfc8a9bb3','0','2','0'),
('48897','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]','10659','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','f2762c4ec5a0488492d312c07d82890f','0','2','0'),
('48898','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]','10659','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','bbedf912ec7a4b01b6c4c1f6646fe691','0','2','0'),
('48899','20','get[1.3.6.1.4.1.674.10892.5.1.1.8.0]','10659','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','0433d7f60efb429399493383314f7256','0','2','0'),
('48900','20','get[1.3.6.1.4.1.674.10892.5.1.3.12.0]','10659','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','79dc78b6decf4b8b9769ae834da84513','0','2','0'),
('48901','20','get[1.3.6.1.4.1.674.10892.5.1.3.2.0]','10659','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','bb3b2abb63c84a97ba62a04b943236a9','0','2','0'),
('48902','20','get[1.3.6.1.4.1.674.10892.5.2.5.0]','10659','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','578b9267e58d462abb36c0e68fd32dbc','0','2','0'),
('48903','20','get[1.3.6.1.2.1.1.6.0]','10659','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','f09996db69fe484283e45a3117b4d5f0','0','2','0'),
('48904','15','','10659','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','37f3d96deb39494e95513361d0ea8183','0','2','0'),
('48905','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]','10659','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','3f9159df646b4036a754969f454b0ce8','0','2','0'),
('48906','20','get[1.3.6.1.2.1.1.5.0]','10659','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','09195963d6e74bab98f9cea1adbfbd25','0','2','0'),
('48907','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]','10659','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','8a9d37b55a7149ce8ac0428e5021ee12','0','2','0'),
('48908','20','get[1.3.6.1.6.3.10.2.1.3.0]','10659','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','8515f86587ab43a0af94b90a06998ba5','0','2','0'),
('48909','20','get[1.3.6.1.2.1.1.2.0]','10659','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','d8abb2af15ad42f2ae3d76df569e1ae0','0','2','0'),
('48910','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]','10659','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','82ab16270c5d4748bc212b69774b8ddc','0','2','0'),
('48911','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]','10659','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','ad64ca5196504b48afb43a0954396579','0','2','0'),
('48912','20','get[1.3.6.1.4.1.674.10892.5.2.1.0]','10659','Overall system health status','dell.server.status[globalSystemStatus]','1m','31d','0','0','3','','','','',NULL,'1338','','','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','24bf18434f2145fe91b6bf6ccf3a5c5d','0','2','0'),
('48913','20','get[1.3.6.1.4.1.674.10892.5.1.3.6.0]','10659','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','abed403c12404de3b6df8335324eddf3','0','2','0'),
('48914','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]','10659','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','391180d5461c4f448724b22cacc12036','0','2','0'),
('48915','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]','10659','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','0dc203875c6541e48f8418c4806461dd','0','2','0'),
('48916','17','','10659','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','575229ede65e4639a4113ef078ed33d2','0','2','0'),
('48917','5','','10659','SNMP agent availability','zabbix[host,snmp,available]','1m','31d','365d','0','3','','','','',NULL,'1348','','','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','c164ae420f1a49d2a205ecbe2eb1d892','0','2','0'),
('48959','21','','10439','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','68a232da5e184d23ac524ee2d424fef7','0','2','0'),
('48960','21','','10439','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','029cf7dfa7734c4a86292d2b3b3b907b','0','2','0'),
('48961','21','','10439','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\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','2bade51081c74bfdbb282713a50dbf68','0','2','0'),
('48962','21','','10439','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','f455a0b7c198414db84fb679fba47330','0','2','0'),
('49006','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]','10440','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','c3bd795316314dbf9cf1c21751358ba8','0','2','0'),
('49007','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]','10440','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','0d7f8134d9934125b0bde2e0392479e8','0','2','0'),
('49008','20','get[1.3.6.1.4.1.674.10892.5.4.300.50.1.8.1.1]','10440','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','cf0d3ec990d94f949157ea9c22ba37b0','0','2','0'),
('49009','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]','10440','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','f146e9f2165d441a9a68091f750f20c0','0','2','0'),
('49010','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]','10440','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','63fa498031104fa8a418570334efe139','0','2','0'),
('49011','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]','10440','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','1c500e036b534567a62d1c9a2f912f43','0','2','0'),
('49012','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]','10440','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','00d4d1232f13434eb7ff10eb025da6c3','0','2','0'),
('49013','20','get[1.3.6.1.4.1.674.10892.5.2.5.0]','10440','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','2308ce0f18f249258d3b05a5d08e6a83','0','2','0'),
('49014','15','','10440','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','190388551b5144c49a4afefe0347cdc0','0','2','0'),
('49015','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]','10440','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','6c3ef6e5744649d7ba41df2748c349d8','0','2','0'),
('49016','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]','10440','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','868e51dcc9114c7991a1be641a0b634d','0','2','0'),
('49017','20','get[1.3.6.1.6.3.10.2.1.3.0]','10440','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','55193d35960a410abf32f903b3b04406','0','2','0'),
('49018','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]','10440','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','08921851e08f41859daf5cfe748eaff6','0','2','0'),
('49019','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]','10440','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','148a893a9b1540619793d3608ff9fa29','0','2','0'),
('49020','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]','10440','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','35bc6ebfbb5f48ac93941d91b197dec0','0','2','0'),
('49021','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]','10440','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','89a3a5f1edff45cba03191752f4c5935','0','2','0'),
('49042','21','','10441','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','7c99c4ba6e3643e5b4672aeb3ecbaa20','0','2','0'),
('49043','21','','10441','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','4f6df395e903468481990c9d2e6e9a21','0','2','0'),
('49044','21','','10441','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\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','d09bd1c6bccf422286031a7081d2d130','0','2','0'),
('49045','21','','10441','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','860871bf033f443183bed66919fc86e3','0','2','0'),
