CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
How to automatically login into OMC using perl

 



sajjad_84
Novice

Oct 15, 2009, 5:05 AM

Post #1 of 3 (2544 views)
How to automatically login into OMC using perl Can't Post

Hello All,

I'm almost at the end of my project, and i've run into a problem.

The problem is that there are some commands which can only be run when logged in to the application which is the OMC.

Now how this OMC login works is, when run the command "omclogin -m cli".

First it prompts for a user name, and after user name a password.

In perl this is what i've done

`(sleep 6; echo "zomg\r"; sleep 1;echo "wai\r";sleep 4; echo "bdf\r"; sleep 2)| omclogin -m cli`;

so that first it enters the user name, then the password and then run the bdf command.

But i can't seem to login. (even if I just run the above command without the script).

Thanks


FishMonger
Veteran / Moderator

Oct 15, 2009, 7:28 AM

Post #2 of 3 (2540 views)
Re: [sajjad_84] How to automatically login into OMC using perl [In reply to] Can't Post

You need to use Expect.

http://search.cpan.org/~rgiersig/Expect-1.21/Expect.pod


sajjad_84
Novice

Oct 15, 2009, 8:43 AM

Post #3 of 3 (2535 views)
Re: [FishMonger] How to automatically login into OMC using perl [In reply to] Can't Post

Hello FishMonger,

Thats what i tried using first. The problem this module isn't installed on the server, and the administrator won't let me install it. And thats why i tried some other procedure.

Well I this is the only way then i guess i have to convince the administrator.

Thanks.
p.s sorry for the double post Tongue

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives