473,848 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

run unix commands with C# Question

zw
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.
Feb 22 '08 #1
2 2696
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://www.chiark.greenend.org.uk/~s.../download.html
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.
Feb 22 '08 #2
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
Feb 22 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2268
by: Kory Wheatley | last post by:
Hi all, I've just started to learn Python and I have a question. What is the syntax to embed Unix commands, or call other programs within a Python script? for example I would like to use a system chmod unix command in the python script:
2
3006
by: timdoyle05 | last post by:
Hi, I have a question relating to how Unix commands can be issued from Python programs. Im am currently writing a large test script in python and I need this script to call three other separate Python scripts, where each one executes in it own thread of control. I would like to use a Unix command to get each script to run in its own shell. I have tried using the "Commands" module but after I issue the first "command", execution blocks...
3
2931
by: db2guy | last post by:
Hi Gurus, Questions for you. 1. Is it possible to assign a DB2 DBA for UNIX into a DB2 DBA for Mainframe (OS390)? 2. Are the data administration commands the same for UNIX and mainframe? 3. If not how many percent is the differecence?
3
5748
by: Fabian Knopf | last post by:
Hi friends, i have a unix machine PC1 where a database is running ( IBM DB2 V8.1 ) . Then i have another machine PC2 i installed there also ( IBM DB2 V8.1 ). On PC2 i installed unixODBC. To connect to the database over ODBC on unix i did this: on db2 console: catalog tcpip node archiv remote PC1 server DB2_db2inst1
9
2204
by: fidlee | last post by:
I dont know if this is the right place to ask this question. i got this book "The C Odyssey. Unix - The Open, Boundless C" It is a 1992 edition book The book speaks of all the unix specific functions Just quoting an example below: void main()
2
4378
by: harish.l | last post by:
Hello All, I want to run Unix commands from HTML. I want to run Perl command. In windows I have placed the commands in .bat file and I am invoking through <href= >. I want to run unix commands from HTML. Can anyone help me in this regard. Regards Harish
1
2874
by: apsonline | last post by:
hi people i want to work on a project that would "emulate" unix commands like ls,rm etc... by making use of uunix system calls . by writing programs in c++ using system calls ,these programs would work exactly the same way as the unix commands would work. but will the unix shell accept these commanands(which are defined by me) ? where should i put all these commands ?which directory? or will i have to write a new shell alltogether??
1
1825
by: Marcin Wiszowaty | last post by:
Hello, I work at a company that has 2 development enviroments. One Unix which i dont know anything about and the othe vs.net 03 with MSSQL server 2000 for db. How can i cause applications (scripts) to get run in unix while using preferably vb.net or c# applications run in windows. So far all the unix aplications are started manualy through the command window. Files are sent using FTP. We have XceedFTP client to send files to unix from...
10
1997
by: blaine | last post by:
Hey everyone, So I've got a quick query for advice. We have an embedded device in which we are displaying to an LCD device that sits at /dev/screen. This device is not readily available all the time, so I am needing to write an emulator. This will basically just monitor a file, /dev/screen for example, and write the commands to a TK or WxWindows canvas. So sending 'line 0 0 10 10' will draw a line on my canvas from (0,0)
0
9892
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9735
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10658
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10347
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9497
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5730
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5915
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4133
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3171
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.