Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to get the output of some 'show' commands in linux and print them in a file
It's a HP 2626 switch
1. How can i setup Passwordless entry via public key authentication to the switch
2. How can i make a bash command to login to the server and then write the output of the switch in a file

*only ssh access is aplicable here

share|improve this question

2 Answers 2

up vote 2 down vote accepted

First of all, note that the RANCID tool can be used to automate the process of tracking your switch config over time. I haven't used it myself but the docs indicate it works with Procurve switches. I strongly recommend you investigate using it.

Aside from that, your first step is to enable ssh access to the switch and upload your public ssh key. Here's a great howto for doing that.

Once you have ssh access working for the manager or operator account on the device, you will need to use something like expect to automate ssh connections to the machine. This Stack Overflow posting has some great tips on how to do that.

But again, I strongly recommend you try to get RANCID working first, since that's a more standardized way to do this, and will scale better if you have more than one switch, or switches from different vendors.

share|improve this answer

I remember it was tricky but I did get it to work. I think this was the article I used: http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1294601445286+28353475&threadId=973580

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.