run unix commands with C# Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zw

    run unix commands with C# Question

    Hi

    I have 2 unix boxes.
    In each box, I have a unix shell script that captures certain
    statistics to a file of the unix box. During the run of the 2 shell
    scripts, I need a common timestamp for both.
    I'm thinking of writing a C# app to issue commands every few mins to
    these shell scripts and capture the statistics back to a file in a
    Windows folder. The C# app will provide the common timestamp for the
    statistics retrieved from the unix boxes.
    After the run is complete, I need to process these 2 files and graph
    them on a web browser.

    I like to hear from you all what's the best method to accomplish this.
    Even better, if one could provide a simple sample to accomplish this.
    I have .NET 2.0 on the Windows laptop to work with.


    Advanced thanks.
    Appreciate any help.
  • Mufaka

    #2
    Re: run unix commands with C# Question

    Are you looking for a way to call these scripts from C#? If so, you may
    be able to spawn a process for Plink and capture the output.


    http://the.earth.li/~sgtatham/putty/.../Chapter7.html (docs)

    zw wrote:
    Hi
    >
    I have 2 unix boxes.
    In each box, I have a unix shell script that captures certain
    statistics to a file of the unix box. During the run of the 2 shell
    scripts, I need a common timestamp for both.
    I'm thinking of writing a C# app to issue commands every few mins to
    these shell scripts and capture the statistics back to a file in a
    Windows folder. The C# app will provide the common timestamp for the
    statistics retrieved from the unix boxes.
    After the run is complete, I need to process these 2 files and graph
    them on a web browser.
    >
    I like to hear from you all what's the best method to accomplish this.
    Even better, if one could provide a simple sample to accomplish this.
    I have .NET 2.0 on the Windows laptop to work with.
    >
    >
    Advanced thanks.
    Appreciate any help.

    Comment

    • christery@gmail.com

      #3
      Re: run unix commands with C# Question

      On 22 Feb, 08:50, zw <MPC8...@gmail. comwrote:
      Hi
      >
      <snip>
      scripts, I need a common timestamp for both.
      I'm thinking of writing a C# app to issue commands every few mins to
      <snip>

      So running the puters clock with NTP and the clock will be right is
      not a solution to timestamping at the origin of the data? thereby you
      can buffer if the connection is broken and so on.
      Then ftp or nfs, samba or whatewer to retreive datafiles, just the
      problem with race conditions, I usually rename x.x to x.y and then
      download, and then delete x.y - the other program will create a new
      x.x if there is none to be appended too, this gives buffering and lets
      me stop the consumer without loosing data.

      //CY

      Comment

      Working...