LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-07-2008, 01:30 PM   #1
fragon
LQ Newbie
 
Registered: Apr 2008
Posts: 2

Rep: Reputation: 0
Make a program can collect linux command output regularly and send to a tftp server


Hi all,

I intend to make a program that will collect commands output that I need and send it to a tftp server in every seconds.

I will make another python script at tftf server to collect and parse the information that I need to save. But I'm not really how to implement it yet because. No python, tcl/expect solution can be applied here because this is a small device that use busybox. Cpu/memory less consuming is a requirement to maintain device performance.

Does bash shell can help to get output of a command like top? Or is there any other way to solve this requirement

Thanks,
 
Old 04-07-2008, 02:00 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Why do you want tftp to be involved? If you are already going to write both server side and client side code, just write something that communicates directly between peers. This can be made very small if written in a compiled language such as C. There are many simple examples of how to do this; one of my favorites is Beej's Guide to Network Programming Bash is probably not the tool you want to use for this, especially in a resource-constrained environment.

--- rod.
 
Old 04-07-2008, 04:49 PM   #3
fragon
LQ Newbie
 
Registered: Apr 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for replying. I really like Beej's Guide to Network Programming. It is a great document to play with.

I'm stick with shell till now because I don't need to touch the low level code. I can just excuse
ifconfig eth0 > ifconfig%time.txt
then put that text file to tftp server to archive my goal

The thing I consider is the resource consuming that make my device slower and how to handle some special commands like top

Using C, I may go to the kernel, enhance commands with an option to be able to talk to my server to put information but it is too much for this requirement.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IS it possible to send command output to a file as well as the screen helptonewbie Programming 6 09-16-2007 01:13 PM
how do i collect output of linux netowk ipes sunlinux Linux - Networking 1 12-02-2006 07:32 AM
How do I use Linux POST command to send text to remote server Bill K Linux - General 1 05-19-2006 09:26 PM
Command line program to send X events? drj000 Linux - Software 0 09-07-2005 05:48 PM
how to make a C program send email notification/alerts? eigenyeugen Programming 1 01-04-2005 08:16 PM


All times are GMT -5. The time now is 09:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration