LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 11-06-2011, 06:00 AM   #1
jrahma
Member
 
Registered: Oct 2011
Posts: 30

Rep: Reputation: Disabled
save terminal to database


Hi,

is there any software on linux to save the terminal output to database instantly? I am currently using Putty to read the Serial port data from the PBX but my online issue is I need to save the data to database please..

Thanks,
Jassim
 
Old 11-06-2011, 06:04 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,516
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
Does it have to be done with a terminal? Is it not possible to have a daemon process that reads from the serial port and writes to a database?
 
Old 11-06-2011, 06:07 AM   #3
jrahma
Member
 
Registered: Oct 2011
Posts: 30

Original Poster
Rep: Reputation: Disabled
how please?
 
Old 11-06-2011, 06:16 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,516
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
It could be done many ways. Which language(s) do you know? What sort of database do you want to use?
 
Old 11-06-2011, 06:18 AM   #5
jrahma
Member
 
Registered: Oct 2011
Posts: 30

Original Poster
Rep: Reputation: Disabled
I am new to linux

I am using MySql and I know .NET and C#.
 
Old 11-06-2011, 06:26 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,516
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
Assuming the system is Linux, AFAIK we can rule out .NET so that leaves C# unless you want to invest the effort in learning another language. I don't C# but surely it can extract data from a serial port and there must be libraries to write to MySQL.

What you are trying to do does not sound unusual. Might be worth netsearching for a solution before developing your own.

If you do have to develop your own it will be worth netsearching for examples of how a program can daemonise itself, read from the serial port and write to a MySQL database.
 
Old 11-06-2011, 06:29 AM   #7
jrahma
Member
 
Registered: Oct 2011
Posts: 30

Original Poster
Rep: Reputation: Disabled
as you said, i can do it easily using C# and MySql but the project I have is purely Linux backend...
 
Old 11-06-2011, 06:31 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,516
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
Isn't C# enough like C++ for you to be able to program it on Linux?
 
Old 11-06-2011, 06:33 AM   #9
jrahma
Member
 
Registered: Oct 2011
Posts: 30

Original Poster
Rep: Reputation: Disabled
I am not sure about C# on Linux. If it's possible then it won't be a direct solution from Microsoft.. It might be another third party

what about Linux it self? any other solution?!
 
Old 11-06-2011, 06:38 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,516
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
GNU/Linux has a FOSS c++ compiler, gcc ("GNU/Linux" because Linux is only the kernel; many utilities including gcc are provided by GNU).

Alternatives? C, Ruby, python, perl, bash ... each with their pros and cons for developing in and for the problem/solution domain.
 
Old 11-06-2011, 08:52 AM   #11
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 3,986

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
If I understand well, you have a serial connection to your PBX. A PBX is a telephone switch, right? (Public Branch eXchange). And now you are getting data (perhaps calling data, dialled numbers, durations) from that PBX and you have to store that in a database. Right? The next question will be how to represent the data you stored, how to search, produce statistics etc?

I am not sure whether you do this as a pure hobby project (just nice to have), but since PBX-es do not often appear at the home I assume you have been given a professional assigment.

Well, if you are able to fulfill this assigment, I hope you understand you should do some reserch first as to design what your needs are. Rather than wondering what programming language you'd need to pipe your terminal data into MySQL.

If it less severe than this, we would be happy to help you, if you can tell what the requirements are for your program, but more precise than piping it into MySQL.

jlinkels

Last edited by jlinkels; 11-06-2011 at 11:32 AM.
 
Old 11-06-2011, 08:59 AM   #12
jrahma
Member
 
Registered: Oct 2011
Posts: 30

Original Poster
Rep: Reputation: Disabled
this is my brother's small office.

There is a PBX (yes phone exchange) and I want to read the data..

I m able to read it with no issue except it's not saving into database so if they server crashed or was restarted then I am losing all the data.

I am currently using Serial PBX logger from Eltima software which is free and does the job. It saves the serial port data into a text file but they only issue here it is on Windows and I am planing to move the environment in my brother's office all to linux backend..

so it's a project for him and it's a study case for me because I am new to linux
 
Old 11-06-2011, 10:25 AM   #13
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,516
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
Sounds challenging to move your brother's office to a Linux back-end when you are new to Linux

Have fun and tread carefully
 
Old 11-06-2011, 10:32 AM   #14
jrahma
Member
 
Registered: Oct 2011
Posts: 30

Original Poster
Rep: Reputation: Disabled
Thanks
 
Old 11-06-2011, 11:31 AM   #15
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 3,986

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quote:
Originally Posted by jrahma View Post
I am currently using Serial PBX logger from Eltima software which is free and does the job. It saves the serial port data into a text file but they only issue here it is on Windows and I am planing to move the environment in my brother's office all to linux backend.
That has nothing to do with database storage, it is a simple logging utility. See if ttylog is suitable for you. Should be available in the repository of your distro. This is hearsay, I did not apply it myself, just found it in Google.

Minicom and associated logging is more sophisticated, but limited if the PBX does not dump ASCII.

jlinkels
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to read mailbox and save items to a MySQL database Chrizzieej Programming 2 09-08-2010 08:30 AM
save input from an online form to a file/database? portia Programming 4 01-30-2010 09:22 AM
save terminal session cad Linux - General 1 12-31-2006 05:12 AM
webfwlog unable to save report to database dwarf007 Linux - Software 1 08-21-2006 01:13 AM
Terminal size (How to save??) sevvy8 Linux - Software 2 08-16-2004 06:21 PM


All times are GMT -5. The time now is 05:01 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