LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   Running iostats over ssh on remote guest -- time doesn't show up in report (https://www.linuxquestions.org/questions/linux-enterprise-47/running-iostats-over-ssh-on-remote-guest-time-doesnt-show-up-in-report-4175435739/)

beeblequix 11-05-2012 10:31 AM

Running iostats over ssh on remote guest -- time doesn't show up in report
 
This is a continuation of my post made here:
http://www.linuxquestions.org/questi...le-4175434912/

I basically wanted to tail a log and run iostats as soon as a specific event showed up. I found that while my command worked fine that the problem I'm looking for is on another guest.

Now I'm running iostats over ssh on a remote guest instead of the local guest once that event shows up:

tail -F logfile.txt | while read INFILE
do
[[ "${INFILE}" == *"event_12345"* ]]
&& ssh beeblequix@beeblequixs_remote_guest.somedomain.com "bash -c /usr/bin/iostat -t >> iostat_on_guest2_when_process_times_out_on_guest1.txt
done


The iostat -t is supposed to also print the timestamp in the report. My report however does not give the time. I get the regular iostats breakdown. I'd really like to see the remote guest's time as well. How can I make it give be the remote guest's timestamp in the report? Any help appreciated. Thanks.

ß

beeblequix 11-05-2012 10:35 AM

fixed it :)
 
I just needed to use single quotes like this:

ssh beeblequix@beeblequixs_remote_guest.somedomain.com "bash -c '/usr/bin/iostat -t'" >> iostat_on_guest2_when_process_times_out_on_guest1.txt


All times are GMT -5. The time now is 03:32 AM.