zabbix_export: version: '6.0' date: '2021-11-21T21:59:25Z' groups: - uuid: 040d20d408f447c4a041176b8604e5e9 name: 'Templates/storage controllers' templates: - uuid: 9a23785fded44634a6d50de7f1183234 template: 'Intel RST with js' name: 'Intel RST with js' description: | ## Overview This template is for discovering and monitoring Intel RST (Intel VROC) storage controllers. Works with zabbix 4.2 and higher. Template uses action with zabbix API. Instuctions is on github page groups: - name: 'Templates/storage controllers' items: - uuid: c77ec4510669412dad7b4be726307dec name: 'Intel RST All Info' key: 'irst.allinfo[{$IRST_CLI}]' delay: '{$STOR_CTRL_REQUEST_PERIOD}' history: '{$INTERNAL_ITEMS_HISTORY_PERIOD}' trends: '0' value_type: TEXT description: 'Get all info from rst controller(cli path + ''I'' key)' tags: - tag: Application value: 'Intel RST internal items' - uuid: b3f7eaa3ff0449618e360699da2febcc name: 'Intel RST All Lds info' type: DEPENDENT key: irst.ld delay: '0' history: '{$INTERNAL_ITEMS_HISTORY_PERIOD}' trends: '0' value_type: TEXT preprocessing: - type: JAVASCRIPT parameters: - | value=(value.match(/.*/gm)).toString(); var matches = value.match(/Name:\s*\S*Raid Level:\s*\d{1,}\S*Size:(\s*\S*){2}StripeSize:(\s*\S*){1,2}Num Disks:\s*\d{1,2}\S*State:\s*\w*/gmi); var prejson = []; for(var i = 0; i < matches.length; i++){ var myobj={}; var str = matches[i].split(/,{1,}/); for(var x = 0; x < str.length; x++){ var temp = str[x].split(':'); myobj[temp[0].trim('\t')] = temp[1].trim('\t'); } var Name = myobj['Name']; delete myobj['Name']; prejson.push(('"' + Name + '":') + JSON.stringify(myobj,null,space=0)); } json=("[{" + prejson + "}]"); return json master_item: key: 'irst.allinfo[{$IRST_CLI}]' tags: - tag: Application value: 'Intel RST internal items' - uuid: a2e1e1d901544494a3af4956f15a8ea9 name: 'Intel RST All Pds info' type: DEPENDENT key: irst.pd delay: '0' history: '{$INTERNAL_ITEMS_HISTORY_PERIOD}' trends: '0' value_type: TEXT preprocessing: - type: JAVASCRIPT parameters: - | value=(value.match(/.*/gm)).toString(); var re=/(ID:\s*(\d{1,}-){3}\d{1,})(.*?)(Serial Number:(\s*\S*\s*|\s*\S*:\d{1,2}\s*))/gmi; var matches = value.match(re); var prejson = []; for(var i = 0; i < matches.length; i++){ var myobj={}; var str = matches[i].split(/,{1,}/); for(var x = 0; x < str.length; x++){ var temp = str[x].replace(/(:\d{1,2})$/,'_nocorrectsn'); var temp = temp.split(':'); myobj[temp[0].trim('\t')] = temp[1].trim('\t'); } var ID = myobj['ID']; delete myobj['ID']; prejson.push(('"' + ID + '":') + JSON.stringify(myobj,null,space=0)); } json=("[{" + prejson + "}]"); return json master_item: key: 'irst.allinfo[{$IRST_CLI}]' tags: - tag: Application value: 'Intel RST internal items' - uuid: 318f0dbd1e2c418da2cefc4f68618249 name: 'Intel RST All Pds LLD info' type: DEPENDENT key: irst.SMART.lld delay: '0' history: '3600' trends: '0' value_type: TEXT description: 'JSON for lld of physical disks and for SMART template' preprocessing: - type: JAVASCRIPT parameters: - | value=(value.match(/.*/gm)).toString(); var re=/(ID:\s*(\d{1,}-){3}\d{1,})(.*?)(Serial Number:(\s*\S*\s*|\s*\S*:\d{1,2}\s*))/gmi; var matches = value.match(re); var prejson = []; for(var i = 0; i < matches.length; i++) { var myobj={}; var str = matches[i].split(',,,'); for(var x = 0; x < str.length; x++){ var temp = str[x].split(':'); if (temp[0].match(/ID.*|Serial Number.*/gm)){ myobj[temp[0].trim('\t')] = temp[1].trim('\t'); myobj['slotname_source'] = 'Intel RST'; } } prejson.push(JSON.stringify(myobj,null,space=0)); } json=("[" + prejson + "]").replace(/ID":/gm,'SLOT":') return json - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - '{$PD_THROTTLING_HB_PERIOD}' master_item: key: 'irst.allinfo[{$IRST_CLI}]' tags: - tag: Application value: 'Intel RST internal items' - uuid: df22293b069642ef9c2864cfbb893c7a name: 'RST cli path' key: 'wmi.get[root\cimv2,select DriverVersion from Win32_PnPSignedDriver WHERE DriverProviderName like ''%Intel%'' and DeviceClass like ''SCSIADAPTER'' and not DeviceName like ''%Ethernet Virtual Storage%'']' delay: '{$INTERNAL_ITEMS_REQUEST_PERIOD}' history: '7200' trends: '0' value_type: TEXT description: 'Path to needed version of utility (depends on driver version)' preprocessing: - type: JAVASCRIPT parameters: - | var DriverVer = value.match(/\d{1,2}.\d.\d/); DriverVer=(DriverVer[0].replace(/\./gm,"")).match(/\d{3}/); // var IrstPath = 'C:\\\\zabbix_agent\\\\diskutils\\\\rst\\\\'; var IrstVer = (DriverVer < 170) ? '13_16_rstcli64.exe': (DriverVer < 500) ? '4.6.0_rstcli64.exe': (DriverVer < 503) ? '5.0.0_rstcli64.exe': (DriverVer < 530) ? '5.0.3_rstcli64.exe': (DriverVer < 540) ? '5.3.0_rstcli64.exe': (DriverVer < 560) ? '5.6.0_rstcli64.exe': (DriverVer < 650) ? 'IntelVROCCli.exe': 'rstcli64.exe'; //var IrstCli = IrstPath + IrstVer; var IrstCli=IrstVer; return IrstCli tags: - tag: Application value: 'Intel RST internal items' triggers: - uuid: b0ce3ee03d4448269d02d4022bcf1efa expression: '(last(/Intel RST with js/wmi.get[root\cimv2,select DriverVersion from Win32_PnPSignedDriver WHERE DriverProviderName like ''%Intel%'' and DeviceClass like ''SCSIADAPTER'' and not DeviceName like ''%Ethernet Virtual Storage%''],#1)<>last(/Intel RST with js/wmi.get[root\cimv2,select DriverVersion from Win32_PnPSignedDriver WHERE DriverProviderName like ''%Intel%'' and DeviceClass like ''SCSIADAPTER'' and not DeviceName like ''%Ethernet Virtual Storage%''],#2))=1 or count(/Intel RST with js/wmi.get[root\cimv2,select DriverVersion from Win32_PnPSignedDriver WHERE DriverProviderName like ''%Intel%'' and DeviceClass like ''SCSIADAPTER'' and not DeviceName like ''%Ethernet Virtual Storage%''],#2)<2' name: '{ITEM.VALUE}' description: 'Changing if driver version for Irst changed or if it''s first check' manual_close: 'YES' tags: - tag: NOTIFY value: 'NO' - tag: SOURCE value: 'Intel RST path' discovery_rules: - uuid: c7dc1bdb99804c86b1a5cc028cf0364c name: 'Logical disks discovery' type: DEPENDENT key: ldlld delay: '0' item_prototypes: - uuid: e6cf05157ef74fc6a1a64e02b728b8b5 name: 'Logical disk "{#LDNAME}" level' type: DEPENDENT key: 'irst.raid.level.[{#LDNAME}]' delay: '0' history: '{$LD_HISTORY_PERIOD}' trends: '0' preprocessing: - type: JSONPATH parameters: - '$[0][''{#LDNAME}''][''Raid Level'']' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - '{$LD_THROTTLING_HB_PERIOD}' master_item: key: irst.ld tags: - tag: Application value: 'Intel RST Logical Disks' - uuid: 87da75ba895d409c963c4a4698bb69bf name: 'Logical disk "{#LDNAME}" disks count' type: DEPENDENT key: 'irst.raid.pdcount.[{#LDNAME}]' delay: '0' history: '{$LD_HISTORY_PERIOD}' trends: '0' preprocessing: - type: JSONPATH parameters: - '$[0][''{#LDNAME}''][''Num Disks'']' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - '{$LD_THROTTLING_HB_PERIOD}' master_item: key: irst.ld tags: - tag: Application value: 'Intel RST Logical Disks' - uuid: 03cbe07437184ff58f16fd838fe8c98e name: 'Logical disk "{#LDNAME}" state' type: DEPENDENT key: 'irst.raid.state.[{#LDNAME}]' delay: '0' history: '{$LD_HISTORY_PERIOD}' trends: '0' value_type: TEXT preprocessing: - type: JSONPATH parameters: - '$[0][''{#LDNAME}''][''State'']' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - '{$LD_THROTTLING_HB_PERIOD}' master_item: key: irst.ld tags: - tag: Application value: 'Intel RST Logical Disks' trigger_prototypes: - uuid: f76df8bea82f46cb908280dc073631bb expression: 'find(/Intel RST with js/irst.raid.state.[{#LDNAME}],#1,"regexp","{$LD_WARNING_SEVERITY_STATES}")=1 and find(/Intel RST with js/irst.raid.state.[{#LDNAME}],#3,"regexp","{$LD_HIGH_SEVERITY_STATES}")=0' recovery_mode: RECOVERY_EXPRESSION recovery_expression: 'find(/Intel RST with js/irst.raid.state.[{#LDNAME}],,"regexp","{$LD_RECOVERY_STATES}")=1' name: 'Intel RST: Logical disk "{#LDNAME}" is "{ITEM.VALUE}"' priority: WARNING tags: - tag: SOURCE value: 'Intel RST LD state' - uuid: 2ecb4a812a844a14a02e9349b49c3ded expression: 'find(/Intel RST with js/irst.raid.state.[{#LDNAME}],,"regexp","{$LD_INFORMATION_SEVERITY_STATES}")=1' recovery_mode: RECOVERY_EXPRESSION recovery_expression: 'find(/Intel RST with js/irst.raid.state.[{#LDNAME}],,"regexp","{$LD_RECOVERY_STATES}")=1' name: 'Intel RST: Logical disk "{#LDNAME}" is "{ITEM.VALUE}"' priority: INFO dependencies: - name: 'Intel RST: Logical disk "{#LDNAME}" is "{ITEM.VALUE}"' expression: 'find(/Intel RST with js/irst.raid.state.[{#LDNAME}],#1,"regexp","{$LD_WARNING_SEVERITY_STATES}")=1 and find(/Intel RST with js/irst.raid.state.[{#LDNAME}],#3,"regexp","{$LD_HIGH_SEVERITY_STATES}")=0' recovery_expression: 'find(/Intel RST with js/irst.raid.state.[{#LDNAME}],,"regexp","{$LD_RECOVERY_STATES}")=1' tags: - tag: SOURCE value: 'Intel RST LD state' - uuid: aac6178dd25d44888f7b8e320c697bc4 expression: 'find(/Intel RST with js/irst.raid.state.[{#LDNAME}],#1,"regexp","{$LD_WARNING_SEVERITY_STATES}")=1 and find(/Intel RST with js/irst.raid.state.[{#LDNAME}],#2,"regexp","Degraded")=1' name: 'Intel RST: Logical disk "{#LDNAME}" state was changed from "Degraded" state to "{ITEM.VALUE}"' priority: INFO tags: - tag: SOURCE value: 'Intel RST LD state' - uuid: 106d6b8df74145f18ec86a4ff722ba5a expression: 'find(/Intel RST with js/irst.raid.state.[{#LDNAME}],#1,"regexp","{$LD_WARNING_SEVERITY_STATES}")=1 and find(/Intel RST with js/irst.raid.state.[{#LDNAME}],#2,"regexp","Failed")=1' name: 'Intel RST: Logical disk "{#LDNAME}" state was changed from "Failed" state to "{ITEM.VALUE}"' priority: INFO tags: - tag: SOURCE value: 'Intel RST LD state' trigger_prototypes: - uuid: bb593c7d20474a3da176dc90dfd825bc expression: | find(/Intel RST with js/irst.raid.state.[{#LDNAME}],,"regexp","{$LD_HIGH_SEVERITY_STATES}")=1 and last(/Intel RST with js/irst.raid.level.[{#LDNAME}])>0 and last(/Intel RST with js/irst.raid.pdcount.[{#LDNAME}])>0 recovery_mode: RECOVERY_EXPRESSION recovery_expression: 'find(/Intel RST with js/irst.raid.state.[{#LDNAME}],,"regexp","{$LD_RECOVERY_STATES}")=1' name: 'Intel RST: Logical disk "{#LDNAME}" is "{ITEM.VALUE1}". LD level: {ITEM.VALUE2} Disks count: {ITEM.VALUE3}' priority: HIGH tags: - tag: SOURCE value: 'Intel RST LD state' master_item: key: 'irst.allinfo[{$IRST_CLI}]' lld_macro_paths: - lld_macro: '{#LDNAME}' path: $.LDNAME preprocessing: - type: JAVASCRIPT parameters: - | value=(value.match(/.*/gm)).toString(); var re=/Name:\s*\S*Raid Level:\s*\d{1,}/gmi; var matches = value.match(re); var prejson = []; for(var i = 0; i < matches.length; i++){ myobj={}; var str = matches[i].split(/,{1,}/); for(var x = 0; x < str.length; x++){ var temp = str[x].split(':'); myobj[temp[0].trim('\t')] = temp[1].trim('\t'); } prejson.push(JSON.stringify(myobj,null,space=0)); } json=("[" + prejson + "]").replace(/Name":/g,'LDNAME":'); return json - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - '{$LD_THROTTLING_HB_PERIOD}' - uuid: e20f7b2f0c834ebc99cefc944ae904f0 name: 'Physical disks discovery' type: DEPENDENT key: pdlld delay: '0' item_prototypes: - uuid: e2c7c3be0d014261a569c6a7420ff39a name: 'Physical disk "{#SLOT}" serial number' type: DEPENDENT key: 'irst.pd.sn.["{#SLOT}"]' delay: '0' history: '{$PD_HISTORY_PERIOD}' trends: '0' value_type: TEXT preprocessing: - type: JSONPATH parameters: - '$[0][''{#SLOT}''][''Serial Number'']' - type: NOT_MATCHES_REGEX parameters: - '.*(_nocorrectsn$)' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - '{$PD_THROTTLING_HB_PERIOD}' master_item: key: irst.pd tags: - tag: Application value: 'Intel RST Physical Disks' trigger_prototypes: - uuid: 19d7e47ce9fb4fdebea7b3a85a742b55 expression: '(last(/Intel RST with js/irst.pd.sn.["{#SLOT}"],#1)<>last(/Intel RST with js/irst.pd.sn.["{#SLOT}"],#2))=1 and length(last(/Intel RST with js/irst.pd.sn.["{#SLOT}"]))>2' name: 'Intel RST: Physical disk "{#SLOT}" was replaced by sn "{ITEM.VALUE}"' priority: INFO manual_close: 'YES' tags: - tag: SOURCE value: 'Intel RST PD replace' - uuid: d5b1a7eaad184c08833ac6c65419ce55 name: 'Physical disk "{#SLOT}" state' type: DEPENDENT key: 'irst.pd.state.["{#SLOT}"]' delay: '0' history: '{$PD_HISTORY_PERIOD}' trends: '0' value_type: TEXT preprocessing: - type: JSONPATH parameters: - '$[0][''{#SLOT}''][''State'']' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - '{$PD_THROTTLING_HB_PERIOD}' master_item: key: irst.pd tags: - tag: Application value: 'Intel RST Physical Disks' - uuid: b4e4a5668cfd4fd8a046359d4af400ed name: 'Physical disk "{#SLOT}" usage' type: DEPENDENT key: 'irst.pd.usage.["{#SLOT}"]' delay: '0' history: '{$PD_HISTORY_PERIOD}' trends: '0' value_type: TEXT preprocessing: - type: JSONPATH parameters: - '$[0][''{#SLOT}''][''Usage'']' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - '{$PD_THROTTLING_HB_PERIOD}' master_item: key: irst.pd tags: - tag: Application value: 'Intel RST Physical Disks' trigger_prototypes: - uuid: 23560ea9d21c4bee9db0ef5538473482 expression: 'find(/Intel RST with js/irst.pd.state.["{#SLOT}"],,"iregexp","{$PD_INFORMATION_SEVERITY_STATES}")=1 and length(last(/Intel RST with js/irst.pd.sn.["{#SLOT}"]))>0' recovery_mode: NONE name: 'Intel RST: Physical disk "{#SLOT}" is "{ITEM.VALUE1}". Disk SN is "{ITEM.VALUE2}"' priority: INFO manual_close: 'YES' tags: - tag: SOURCE value: 'Intel RST PD state' - uuid: fcd9b419f2cb4f0da00d06baac93f754 expression: 'find(/Intel RST with js/irst.pd.state.["{#SLOT}"],,"iregexp","{$PD_WARNING_SEVERITY_STATES}")=1 and length(last(/Intel RST with js/irst.pd.sn.["{#SLOT}"]))>0' recovery_mode: RECOVERY_EXPRESSION recovery_expression: 'find(/Intel RST with js/irst.pd.state.["{#SLOT}"],,"iregexp","{$PD_RECOVERY_STATES}")=1' name: 'Intel RST: Physical disk "{#SLOT}" is "{ITEM.VALUE1}". Disk SN is "{ITEM.VALUE2}"' priority: WARNING dependencies: - name: 'Intel RST: Physical disk "{#SLOT}" is "{ITEM.VALUE}". Disk SN is "{ITEM.VALUE2}"' expression: 'find(/Intel RST with js/irst.pd.state.["{#SLOT}"],,"iregexp","{$PD_HIGH_SEVERITY_STATES}")=1 and length(last(/Intel RST with js/irst.pd.sn.["{#SLOT}"]))>0' recovery_expression: 'find(/Intel RST with js/irst.pd.state.["{#SLOT}"],,"iregexp","{$PD_RECOVERY_STATES}")=1' tags: - tag: SOURCE value: 'Intel RST PD state' - uuid: a4a79de3532b4611bf1f82976706a97f expression: 'find(/Intel RST with js/irst.pd.state.["{#SLOT}"],,"iregexp","{$PD_HIGH_SEVERITY_STATES}")=1 and length(last(/Intel RST with js/irst.pd.sn.["{#SLOT}"]))>0' recovery_mode: RECOVERY_EXPRESSION recovery_expression: 'find(/Intel RST with js/irst.pd.state.["{#SLOT}"],,"iregexp","{$PD_RECOVERY_STATES}")=1' name: 'Intel RST: Physical disk "{#SLOT}" is "{ITEM.VALUE}". Disk SN is "{ITEM.VALUE2}"' priority: HIGH tags: - tag: SOURCE value: 'Intel RST PD state' master_item: key: irst.SMART.lld lld_macro_paths: - lld_macro: '{#SLOT}' path: '$.[''SLOT'']' tags: - tag: APP value: 'Intel RST storage controller' macros: - macro: '{$INTERNAL_ITEMS_HISTORY_PERIOD}' value: '0' description: 'Time interval for saving data. For debagging use you can set not null' - macro: '{$INTERNAL_ITEMS_REQUEST_PERIOD}' value: 60m description: 'Time interval for getting internal information for template. Like driver version for controllers' - macro: '{$LD_HIGH_SEVERITY_STATES}' value: Degraded|Failed description: 'Logical disks high severity states (using in regex of triggers)' - macro: '{$LD_INFORMATION_SEVERITY_STATES}' value: Initializing description: 'Logical disks information severity states (using in regex of triggers)' - macro: '{$LD_RECOVERY_STATES}' value: Normal description: 'Logical disks recovery states (using in regex of triggers)' - macro: '{$LD_THROTTLING_HB_PERIOD}' value: 3h description: 'Logical disk throttling heartbeat period' - macro: '{$LD_WARNING_SEVERITY_STATES}' value: 'Rebuilding|Verify and Fix' description: 'Logical disks warning severity states (using in regex of triggers)' - macro: '{$PD_HIGH_SEVERITY_STATES}' value: 'Missing|Failed|Smart event triggered' description: 'Physical disks high severity states (using in regex of triggers)' - macro: '{$PD_INFORMATION_SEVERITY_STATES}' value: 'need to set it' description: 'Physical disks information severity states' - macro: '{$PD_RECOVERY_STATES}' value: Normal description: 'Physicall disks recovery states (using in regex of triggers)' - macro: '{$PD_THROTTLING_HB_PERIOD}' value: 3h description: 'Physical disk throttling heartbeat period' - macro: '{$PD_WARNING_SEVERITY_STATES}' value: Verify|Rebuilding description: 'Physicall disks warning severity states (using in regex of triggers)' - macro: '{$STOR_CTRL_REQUEST_PERIOD}' value: 5m description: 'Time interval for getting all information from storage contrroller'