I have a monitoring script like snippet below:
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:
sudo sh firstname.lastname@example.org"perl ./monitoring-script bust_page | /home/john/mailhim.pl
Putty Session- II
sudo sh email@example.com "perl ./monitoring-script bust_page | /home/john/mailhim.pl
sudo sh firstname.lastname@example.org "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.