I've to do a simple job many times whenever it has been asked, just i've to log in to all of fourtien HP servers and i've to execute
ps -fu user > temp
cat temp|sendmail "xyz@z.com"
commands to send the statics of all of 14 servers over the mail to particular user id..
Though logging into each and every server and issuing same command is easy, but its time wasting.
Instead of that i want to create a script and run in single server, so that it can fetch statistics from all servers automatically and sends a single mail.
I've started writing script using SSH command but stuck and couldnt proceed.
I tested the "for loop" for the two servers, server1 and server2
But its giving the foloowing error
ssh: {server1}: Name or service not known
ssh: {server2}: Name or service not known
Please help in this regard, also i want all the userid and password required for the servers to be hardcoded, ie it shouldnt prompt for password or username