5.02021-11-21T21:59:23ZTemplates/storage controllersIntel RST with jsIntel RST with js## 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
<https://github.com/mykolq/zabbix_intel_rst_template>
Templates/storage controllersIntel RST internal itemsIntel RST Logical DisksIntel RST Physical DisksIntel RST Physical Disks SMART- Intel RST All Infoirst.allinfo[{$IRST_CLI}]{$STOR_CTRL_REQUEST_PERIOD}{$INTERNAL_ITEMS_HISTORY_PERIOD}0TEXTGet all info from rst controller(cli path + 'I' key)Intel RST internal items
- Intel RST All Lds infoDEPENDENTirst.ld0{$INTERNAL_ITEMS_HISTORY_PERIOD}0TEXTIntel RST internal itemsJAVASCRIPTvalue=(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 jsonirst.allinfo[{$IRST_CLI}]
- Intel RST All Pds infoDEPENDENTirst.pd0{$INTERNAL_ITEMS_HISTORY_PERIOD}0TEXTIntel RST internal itemsJAVASCRIPTvalue=(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 jsonirst.allinfo[{$IRST_CLI}]
- Intel RST All Pds LLD infoDEPENDENTirst.SMART.lld036000TEXTJSON for lld of physical disks and for SMART templateIntel RST internal itemsJAVASCRIPTvalue=(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 jsonDISCARD_UNCHANGED_HEARTBEAT{$PD_THROTTLING_HB_PERIOD}irst.allinfo[{$IRST_CLI}]
- RST cli pathwmi.get[root\cimv2,select DriverVersion from Win32_PnPSignedDriver WHERE DriverProviderName like '%Intel%' and DeviceClass like 'SCSIADAPTER' and not DeviceName like '%Ethernet Virtual Storage%']{$INTERNAL_ITEMS_REQUEST_PERIOD}72000TEXTPath to needed version of utility (depends on driver version)Intel RST internal itemsJAVASCRIPTvar 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 {diff()}=1 or {count(#2)}<2{ITEM.VALUE}Changing if driver version for Irst changed or if it's first checkYESNOTIFYNOSOURCEIntel RST path
Logical disks discoveryDEPENDENTldlld0Logical disk "{#LDNAME}" levelDEPENDENTirst.raid.level.[{#LDNAME}]0{$LD_HISTORY_PERIOD}0Intel RST Logical DisksJSONPATH$[0]['{#LDNAME}']['Raid Level']DISCARD_UNCHANGED_HEARTBEAT{$LD_THROTTLING_HB_PERIOD}irst.ldLogical disk "{#LDNAME}" disks countDEPENDENTirst.raid.pdcount.[{#LDNAME}]0{$LD_HISTORY_PERIOD}0Intel RST Logical DisksJSONPATH$[0]['{#LDNAME}']['Num Disks']DISCARD_UNCHANGED_HEARTBEAT{$LD_THROTTLING_HB_PERIOD}irst.ldLogical disk "{#LDNAME}" stateDEPENDENTirst.raid.state.[{#LDNAME}]0{$LD_HISTORY_PERIOD}0TEXTIntel RST Logical DisksJSONPATH$[0]['{#LDNAME}']['State']DISCARD_UNCHANGED_HEARTBEAT{$LD_THROTTLING_HB_PERIOD}irst.ld{regexp({$LD_INFORMATION_SEVERITY_STATES})}=1RECOVERY_EXPRESSION{regexp({$LD_RECOVERY_STATES})}=1Intel RST: Logical disk "{#LDNAME}" is "{ITEM.VALUE}"INFOIntel RST: Logical disk "{#LDNAME}" is "{ITEM.VALUE}"{Intel RST with js:irst.raid.state.[{#LDNAME}].regexp({$LD_WARNING_SEVERITY_STATES},#1)}=1 and {Intel RST with js:irst.raid.state.[{#LDNAME}].regexp({$LD_HIGH_SEVERITY_STATES},#3)}=0{Intel RST with js:irst.raid.state.[{#LDNAME}].regexp({$LD_RECOVERY_STATES})}=1SOURCEIntel RST LD state{regexp({$LD_WARNING_SEVERITY_STATES},#1)}=1 and {regexp({$LD_HIGH_SEVERITY_STATES},#3)}=0RECOVERY_EXPRESSION{regexp({$LD_RECOVERY_STATES})}=1Intel RST: Logical disk "{#LDNAME}" is "{ITEM.VALUE}"WARNINGSOURCEIntel RST LD state{regexp({$LD_WARNING_SEVERITY_STATES},#1)}=1 and {regexp(Degraded,#2)}=1Intel RST: Logical disk "{#LDNAME}" state was changed from "Degraded" state to "{ITEM.VALUE}"INFOSOURCEIntel RST LD state{regexp({$LD_WARNING_SEVERITY_STATES},#1)}=1 and {regexp(Failed,#2)}=1Intel RST: Logical disk "{#LDNAME}" state was changed from "Failed" state to "{ITEM.VALUE}"INFOSOURCEIntel RST LD state{Intel RST with js:irst.raid.state.[{#LDNAME}].regexp({$LD_HIGH_SEVERITY_STATES})}=1
and {Intel RST with js:irst.raid.level.[{#LDNAME}].last()}>0 and
{Intel RST with js:irst.raid.pdcount.[{#LDNAME}].last()}>0RECOVERY_EXPRESSION{Intel RST with js:irst.raid.state.[{#LDNAME}].regexp({$LD_RECOVERY_STATES})}=1Intel RST: Logical disk "{#LDNAME}" is "{ITEM.VALUE1}". LD level: {ITEM.VALUE2} Disks count: {ITEM.VALUE3}HIGHSOURCEIntel RST LD stateirst.allinfo[{$IRST_CLI}]{#LDNAME}$.LDNAMEJAVASCRIPTvalue=(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 jsonDISCARD_UNCHANGED_HEARTBEAT{$LD_THROTTLING_HB_PERIOD}Physical disks discoveryDEPENDENTpdlld0Physical disk "{#SLOT}" serial numberDEPENDENTirst.pd.sn.["{#SLOT}"]0{$PD_HISTORY_PERIOD}0TEXTIntel RST Physical DisksJSONPATH$[0]['{#SLOT}']['Serial Number']NOT_MATCHES_REGEX.*(_nocorrectsn$)DISCARD_UNCHANGED_HEARTBEAT{$PD_THROTTLING_HB_PERIOD}irst.pd{diff()}=1 and {strlen()}>2Intel RST: Physical disk "{#SLOT}" was replaced by sn "{ITEM.VALUE}"INFOYESSOURCEIntel RST PD replacePhysical disk "{#SLOT}" stateDEPENDENTirst.pd.state.["{#SLOT}"]0{$PD_HISTORY_PERIOD}0TEXTIntel RST Physical DisksJSONPATH$[0]['{#SLOT}']['State']DISCARD_UNCHANGED_HEARTBEAT{$PD_THROTTLING_HB_PERIOD}irst.pdPhysical disk "{#SLOT}" usageDEPENDENTirst.pd.usage.["{#SLOT}"]0{$PD_HISTORY_PERIOD}0TEXTIntel RST Physical DisksJSONPATH$[0]['{#SLOT}']['Usage']DISCARD_UNCHANGED_HEARTBEAT{$PD_THROTTLING_HB_PERIOD}irst.pd{Intel RST with js:irst.pd.state.["{#SLOT}"].iregexp({$PD_INFORMATION_SEVERITY_STATES})}=1 and {Intel RST with js:irst.pd.sn.["{#SLOT}"].strlen()}>0NONEIntel RST: Physical disk "{#SLOT}" is "{ITEM.VALUE1}". Disk SN is "{ITEM.VALUE2}"INFOYESSOURCEIntel RST PD state{Intel RST with js:irst.pd.state.["{#SLOT}"].iregexp({$PD_WARNING_SEVERITY_STATES})}=1 and {Intel RST with js:irst.pd.sn.["{#SLOT}"].strlen()}>0RECOVERY_EXPRESSION{Intel RST with js:irst.pd.state.["{#SLOT}"].iregexp({$PD_RECOVERY_STATES})}=1Intel RST: Physical disk "{#SLOT}" is "{ITEM.VALUE1}". Disk SN is "{ITEM.VALUE2}"WARNINGIntel RST: Physical disk "{#SLOT}" is "{ITEM.VALUE}". Disk SN is "{ITEM.VALUE2}"{Intel RST with js:irst.pd.state.["{#SLOT}"].iregexp({$PD_HIGH_SEVERITY_STATES})}=1 and {Intel RST with js:irst.pd.sn.["{#SLOT}"].strlen()}>0{Intel RST with js:irst.pd.state.["{#SLOT}"].iregexp({$PD_RECOVERY_STATES})}=1SOURCEIntel RST PD state{Intel RST with js:irst.pd.state.["{#SLOT}"].iregexp({$PD_HIGH_SEVERITY_STATES})}=1 and {Intel RST with js:irst.pd.sn.["{#SLOT}"].strlen()}>0RECOVERY_EXPRESSION{Intel RST with js:irst.pd.state.["{#SLOT}"].iregexp({$PD_RECOVERY_STATES})}=1Intel RST: Physical disk "{#SLOT}" is "{ITEM.VALUE}". Disk SN is "{ITEM.VALUE2}"HIGHSOURCEIntel RST PD stateirst.SMART.lld{#SLOT}$.['SLOT']APPIntel RST storage controller{$INTERNAL_ITEMS_HISTORY_PERIOD}0Time interval for saving data. For debagging use you can set not null{$INTERNAL_ITEMS_REQUEST_PERIOD}60mTime interval for getting internal information for template. Like driver version for controllers{$LD_HIGH_SEVERITY_STATES}Degraded|FailedLogical disks high severity states (using in regex of triggers){$LD_INFORMATION_SEVERITY_STATES}InitializingLogical disks information severity states (using in regex of triggers){$LD_RECOVERY_STATES}NormalLogical disks recovery states (using in regex of triggers){$LD_THROTTLING_HB_PERIOD}3hLogical disk throttling heartbeat period{$LD_WARNING_SEVERITY_STATES}Rebuilding|Verify and FixLogical disks warning severity states (using in regex of triggers){$PD_HIGH_SEVERITY_STATES}Missing|Failed|Smart event triggeredPhysical disks high severity states (using in regex of triggers){$PD_INFORMATION_SEVERITY_STATES}need to set itPhysical disks information severity states{$PD_RECOVERY_STATES}NormalPhysicall disks recovery states (using in regex of triggers){$PD_THROTTLING_HB_PERIOD}3hPhysical disk throttling heartbeat period{$PD_WARNING_SEVERITY_STATES}Verify|RebuildingPhysicall disks warning severity states (using in regex of triggers){$STOR_CTRL_REQUEST_PERIOD}5mTime interval for getting all information from storage contrroller