
UserParameter=megacli.pd.discover,sudo /usr/sbin/megacli -PDList -a0 -NoLog | /bin/egrep '^(Enclosure Device ID|Slot Number|Adapter)' | /bin/sed -n 's/Adapter #\([0-9]*\)/{"{#ADPNUM}":"\1", /; h; g;N;N; :r; { /Enclosure Device ID:.*Slot Number: / {s/\n//g; s/Enclosure Device ID: \([0-9]*\)Slot Number: \([0-9]*\)/"{#ENCL}":"\1", "{#PDNUM}":"\2"},/p; g;N;N; }; br};' | /bin/sed ' $ s/,$//' | /bin/sed -e '1 i { \"data\":['; echo ']}'

UserParameter=megacli.pd.disk_type_and_SN[*],sudo /usr/sbin/megacli -pdInfo -PhysDrv[$2:$3] -a$1 -NoLog | grep 'Inquiry Data: ' | sed -e 's/Inquiry Data: //'
UserParameter=megacli.pd.firmware[*],sudo /usr/sbin/megacli -pdInfo -PhysDrv[$2:$3] -a$1 -NoLog | grep 'Device Firmware Level: ' | sed -e 's/Device Firmware Level: //'
UserParameter=megacli.pd.state[*],sudo /usr/sbin/megacli -pdInfo -PhysDrv[$2:$3] -a$1 -NoLog | grep 'Firmware state: ' | sed -e 's/Firmware state: //'
UserParameter=megacli.pd.temp[*],sudo /usr/sbin/megacli -pdInfo -PhysDrv[$2:$3] -a$1 -NoLog | grep 'Drive Temperature :' | sed -e 's!: N/A!:0!' -re 's/^Drive Temperature :([0-9]+).*$/\1/'
UserParameter=megacli.pd.raw_size[*],sudo /usr/sbin/megacli -pdInfo -PhysDrv[$2:$3] -a$1 -NoLog | grep 'Raw Size: ' | cut -d ' ' -f 3


#UserParameter=megacli.ecl.discover,sudo /usr/sbin/megacli -EncInfo -a0 -NoLog | grep 'Device ID' | sed -re 's/^\s+Device ID\s+: //' | /bin/sed -e '$ ! s/\(.*\)/{"{#ENCNUM}":"\1"},/' | sed -e '$  s/\(.*\)/{"{#ENCNUM}":"\1"}]}/' | /bin/sed -e '1 i { \"data\":['

