I have bash script to collect all hardware info but following memory info piece is missing, so this is what i am trying to do.
Following command give you status of DIMM
memory module,
[root@Linux ~]# hpasmcli -s 'show dimm'
DIMM Configuration
------------------
Processor #: 1
Module #: 1
Present: Yes
Form Factor: 9h
Memory Type: DDR3(18h)
Size: 8192 MB
Speed: 1333 MHz
Supports Lock Step: No
Configured for Lock Step: No
Status: Ok
Processor #: 1
Module #: 12
Present: Yes
Form Factor: 9h
Memory Type: DDR3(18h)
Size: 8192 MB
Speed: 1333 MHz
Supports Lock Step: No
Configured for Lock Step: No
Status: Ok
Processor #: 2
Module #: 1
Present: Yes
Form Factor: 9h
Memory Type: DDR3(18h)
Size: 8192 MB
Speed: 1333 MHz
Supports Lock Step: No
Configured for Lock Step: No
Status: Ok
Processor #: 2
Module #: 12
Present: Yes
Form Factor: 9h
Memory Type: DDR3(18h)
Size: 8192 MB
Speed: 1333 MHz
Supports Lock Step: No
Configured for Lock Step: No
Status: DIMM is degraded
want to extract Size:
and Status:
and need that in single line, like following
Final output will look like following. I can use other language like python or perl but i wrote in bash so i need something in bash, i can do multiple for loop
and play with variable to make it work but i need something easy or in-short single like like sed/awk
. how can i achieve that in sed/awk?
8192MB - Ok
8192MB - OK
8192MB - OK
8192MB - DIMM is degraded