0

I find myself at a crossroad. I want to automate some processes that include mainly: telnet session with a Linux OS and to interpret(autonomously)the log files from the Linux machine.

I admit that it is a question about experience rather than a specific technical question.

My question is: which programming language will best fit my needs?

What I analyzed up to this point(possibilities):

  1. Python, using logtools library.

  2. Dedicated solutions for log analysis : LogParser, LogExpert other web based solutions etc(usually do not include telnet session option or do not work on embedded Linux board,that is what I use).

  3. A combination of Expect scripting(for log extraction) with Python log interpreter.I would like to have a single environment for the entire process. *I managed to use Expect for some basic commands sequence.

To be more specific I will give a theoretical example(sequence of actions):

Create telnet session -> Give credentials -> Send a command -> Save command output -> Analyze/Extract/Interpret parts from output.

Log interpretation will not be trivial, it might need: control structures,arithmetic operations, graphical representation etc.

Added question: Will Python impose some limitations/difficulties with respect to above stated requirements?

Your input will be much appreciated!

Thank you!

J.E
  • 35
  • 7

1 Answers1

0

To do such a task, scripting languages (like Python, and BASH) will be a good choice.

Python

Since Python has got a built-in telnetlib module, it would be easy to work out how to connect via telnet and send commands. Processing data would be relatively easy too because Python's good enough with file handling and regular expressions (re module).

BASH

You can use BASH if your processing algorithm is trivial (e.g. read output from telnet and save to a file) or you need deeper integration with Linux and want to use its features like piping.

Community
  • 1
  • 1
ForceBru
  • 43,482
  • 10
  • 63
  • 98
  • What about using C programming for the above stated requirements? I have some experience using C and socket programming but not for such a task. – J.E Jan 27 '16 at 09:49
  • @J.E, in this case you'll have to implement the whole Telnet protocol from scratch (or probably find an implementation in the Internet). For me, Python will suit _very well_ for this problem and your code'll be _much_ simpler than the same written in C as everything you'll need to use the Telnet protocol _is already built-in_. Although if you've got _a lot of experience_ with C socket programming, you could probably try C. – ForceBru Jan 27 '16 at 11:57
  • I just want to tell you that your opinion was very helpful. Many thanks! – J.E Jan 28 '16 at 11:42
  • @J.E, you're always welcome :) – ForceBru Jan 28 '16 at 11:45