LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-04-2011, 01:02 PM   #1
Wojk
LQ Newbie
 
Registered: Aug 2011
Posts: 11

Rep: Reputation: Disabled
Telnet Login + CSV text


Hello fellow penguins!

This is my first post on the forums and it's all because my research is failing me (I do actually research prior to asking for peoples help).

Let me start by stating my Problem, and my solution that I can't figure out how to put in action.

Problem: Remote PDU logins sometimes get stuck when users don't properly log out.

Solution: telnet into remote PDU using Username/Password and selecting option 4 to log out (this clears any hung state)

I wrote a script to do so-
-
#!/usr/bin/expect -f
spawn telnet x.x.x.x
expect -re "User Name"
send "USERNAME\r"
expect -re "Password"
send "PASSWORD\r"
expect -re "4- Logout"
send "4\r"
sleep 3
send "exit\r"
expect eof
-

Now here's what I need to happen.

I have a text file that's CSV:
"acctPDUID","acctID","rackPDU","username","password","ip","type"
5,3686,"1J6-East","USER","PASSWORD","x.x.x.x","APC"
7,3878,"1L17","USER","PASSWORD","x.x.x.x","APC"
11,4108,"1M24","USER",PASSWORD","x.x.x.x","APC"
13,3795,"1L10","USER","PASSWORD","x.x.x.x","APC"

How can I incorporate the CSV into my Telnet login script?

Basically only need telnet to connect to x.x.x.x with USER / PASSWORD then input the option 4


Thanks in advance! If you need any questions clarified let me know!!

Last edited by Wojk; 08-04-2011 at 01:26 PM.
 
Old 08-04-2011, 02:17 PM   #2
Wojk
LQ Newbie
 
Registered: Aug 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
Nobody can help me on this? Really?
 
Old 08-04-2011, 03:55 PM   #3
Wojk
LQ Newbie
 
Registered: Aug 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
I honestly expected at least someone to have an idea on this. I guess it's on to the next forum...

Heard good things about LQ too.. odd..
 
Old 08-04-2011, 04:11 PM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by Wojk View Post
I honestly expected at least someone to have an idea on this. I guess it's on to the next forum...
This is a forum of volunteers. Bumping your thread twice within three hours is considered rude since it implicates that you demand priority attention. We will help when we find the time and interest to help and not when you demand it.
By bumping your own thread you also took it off the zero reply list. As long as a thread is on the zero reply list it will get bumped automatically. By responding to your own thread after only one hour you have deactivated this mechanism for this thread.
Quote:
Heard good things about LQ too.. odd..
Probably from people who were patient enough to actually wait for a response. There is nothing odd about that, just common netiquette.
 
Old 08-04-2011, 05:25 PM   #5
Wojk
LQ Newbie
 
Registered: Aug 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
I guess my urgency resulted from seeing 100+ views on the topic and not one response. Sorry if it offended you admin...

I got my answer within 15minutes from LinuxForums so all is well.

Good day!
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert a simplte text file into csv using awk script certteam Linux - General 1 09-15-2010 12:23 AM
OpenOffice help , read csv-like text format ufmale Linux - Desktop 3 09-10-2008 01:26 PM
CSV | Text manipulation lmedland Programming 26 07-31-2008 10:44 AM
Reading a CSV text file and storing the values in Oracle Database table shafi2all Linux - Newbie 3 04-17-2008 12:19 PM
convert CSV (TEXT) files to UTF-16 cccc Programming 1 07-01-2004 01:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:55 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration