I have centOS Machine which is my monitoring Server. I run the belowmentioned command to ssh to remote production server and get back those parametrics metrics.
All I am doing now is manually running these commands 10-15 times .
I am a sudo user in that production.How can I write a script to make it in one shot?
Code:
ssh tom@10.14.236.151 "perl ./monitor count" | /mont/ground/mail.pl
ssh tom@10.14.236.26 "perl ./monitor count" | /mont/ground/mail.pl
ssh tom@10.14.236.25 "perl ./monitor count" | /mont/ground/mail.pl
ssh tom@10.14.236.146 "perl ./monitor count" | /mont/ground/mail.pl
ssh tom@10.14.236.18 "perl ./monitor count" | /mont/ground/mail.pl
ssh tom@10.14.236.20 "perl ./monitor count" | /mont/ground/mail.pl
ssh tom@10.14.236.146 "perl ./monitor count" | /mont/ground/mail.pl
ssh tom@10.14.236.146 "perl ./monitor count" | /mont/ground/mail.pl
ssh tom@10.14.236.20 "perl ./monitor count" | /mont/ground/mail.pl
I explored and took a look at
http://kbase.redhat.com/faq/docs/DOC-9195
I tried running :
ssh-keygen
And,
ssh-copy-id -i $HOME/.ssh/id_rsa.pub user@
And they worked fine.
I can also see authorized_key in remote Machine.
Now what next?