Serial Numbers from a Storage Controller over SSH
<p><strong>Background</strong> <br>
I'm working on a bash script to pull serial numbers and part numbers from all the devices in a server rack, my goal is to be able to run a single script (inventory.sh) and walk away while it generates text files containing the information I need. I'm using bash for maximum compatibility, the RHEL 6.7 systems do have Perl and Python installed, however they have minimal libraries. So far I haven't had to use anything other than bash, but I'm not against calling a Perl or Python script from my bash script. </p>

<p><strong>My Problem</strong><br>
I need to retrieve the Serial Numbers and Part numbers from the drives in a Dot Hill Systems AssuredSAN 3824, as well as the Serial numbers from the equipment inside. The only way I have found to get all the information I need is to connect over SSH and run the following three commands dumping the output to a local file:</p>

<ul>
<li>show controllers</li>
<li>show frus</li>
<li>show disks</li>
</ul>

<p><strong>Limitations:</strong></p>

<ul>
<li>I don't have "sshpass" installed, and would prefer not to install it.</li>
<li>The Controller is not capable of storing SSH keys ( no option in custom shell).</li>
<li>The Controller also cannot write or transfer local files.</li>
<li>The Rack does NOT have access to the Internet.</li>
<li>I looked at paramiko, but while Python is installed I do not have pip.</li>
<li>I also cannot use CPAN.</li>
<li>For what its worth, the output comes back in XML format. (I've already written the code to parse it in bash)</li>
</ul>

<p>Right now I think my best option would be to have a library for Python or Perl in the folder with my other scripts, and write a script to dump the commands' output to files that I can parse with my bash script. Which language is easier to just provide a library in a file? I'm looking for a library that is as small and simple as possible to use. I just need a way to get the output of those commands to XML files. Right now I am just using ssh 3 times in my script and having to enter the password each time. </p>

<p>Have a look at SNMP. There is a reasonable chance that you can use SNMP tools to remotely extract the information you need. The manufacturer should be able to provide you with the MIBs.</p>

python linux bash perl ssh