Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 04-07-2008, 01:30 PM   #1
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

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

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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
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.


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:30 AM.

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