I have a monitoring script like snippet below:
Code:
sudo sh customer@IP "perl ./monitoring-script bust_page | /home/john/mailhim.pl
Now The issue is I have 10 Web and 10 DB Servers.
All I used to open different putty and run this command 20-times on the monitoring Server.This script which I run on Local Monitoring server, run on remote server, fetches the data and bring it back to local monitoring server and execute with local script called /home/john/mailhim.pl
As of now I do need to provide couple of 20 times and thats cumbersome when connectivity goes down.I follow up like this:
Code:
Putty Session-1
sudo sh customer@10.14.236.91"perl ./monitoring-script bust_page | /home/john/mailhim.pl
Putty Session- II
sudo sh customer@10.14.236.92 "perl ./monitoring-script bust_page | /home/john/mailhim.pl
.
.
.
sudo sh customer@10.14.236.120 "perl ./monitoring-script bust_page | /home/john/mailhim.pl
Guys, Can you help me with writing a single script which can execute at a single shot.