Hello All,
This is my code ,
Code:
#!/bin/bash
Output=` snmpwalk -m /usr/share/snmp/mibs/CISCO-UNIFIED-COMPUTING-STORAGE-MIB.my -v2c -c opennms-Priv x.x.x.x .1.3.6.1.4.1.9.9.719.1.45.4.1.18 2>/dev/null | awk '{print $4}' | while read -r line ; do echo "Drive:$line" ; done`
printf '%s\n' $Output
For this I am getting output similar to this,
Quote:
Drive online(1)
Drive online(1)
Drive online(1)
Drive online(1)
Drive online(1)
|
I am trying to modify the code to display like,
Quote:
Drive1 online(1)
Drive2 online(1)
Drive3 online(1)
Drive4 online(1)
Drive5 online(1)
|
Could someone guide me what needs to be added in code to achieve above result?