Operating System - OpenVMS
1827808 Members
12436 Online
109969 Solutions
New Discussion

Re: VMS Command Prompt - Can't Tell?!?!

 
SOLVED
Go to solution
Allan Parsons
Advisor

VMS Command Prompt - Can't Tell?!?!

I am writing a webpage that allows for remote monitoring of AIX nodes and VMS nodes using the JAVA telnet wrapper (this is being called from my webpage, using coldfusion - see http://javassh.org/download/source/de/mud/telnet/TelnetWrapper.html)

This works great in AIX and I'm able to execute commands in AIX and interact via telnet. However, executing the exact same code on a VMS box, I get undefined errors, essentially saying that the command failed. I'm just passing simple commands like "dir" or "sho def."

I've attached my code and sample output from a putty telnet session to the vms node. I **think** it has to do something with that special character right before the prompt (see putty output). I've worked on this for >2 weeks and have just been spinning my wheels.

If anyone could help, I'd really appreciate it.

-Allan

26 REPLIES 26
Wim Van den Wyngaert
Honored Contributor

Re: VMS Command Prompt - Can't Tell?!?!

Steven Schweda
Honored Contributor

Re: VMS Command Prompt - Can't Tell?!?!

I know nothing here, but should I be less
troubled by this odd quotation mark count?

Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

No, i had some longer command in there and shortened it to dir for this forum purpose. It would have thrown a syntax error if that was the problem.
Wim Van den Wyngaert
Honored Contributor

Re: VMS Command Prompt - Can't Tell?!?!

If you're looking for doing a telnet via the browser, try this
http://javassh.org/space/start
Click on JTA binaries.

It worked over here but some security settings have changed and now it no longer works. But it could work for you.

Wim
Wim
Rudolf Wingert
Frequent Advisor

Re: VMS Command Prompt - Can't Tell?!?!

Hello,
could it be, that the user on the OpenVMS node did define symbols, which override your commands. My experience is, that the most one did not know that every action (inlcuding telnet) implied a LOGIN. So you have to check the OpenVMS account for the presens of the LOGIN.COM procedure and there content. Also you have to check that the right DCLTABLES will be used.
Best regards R. Wingert
Robert Gezelter
Honored Contributor

Re: VMS Command Prompt - Can't Tell?!?!

Allan,

Looking at your attachment, I suspect that the "funny" characters are either line feeds, carriage returns, or nulls (I will try to do a hex dump of the file later, if I can find the time).

What is your check for command success/failure?

- Bob Gezelter, http://www.rlgsc.com
Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

No, the user didn't override the commands with symbols. The telnet session logs in just fine, it appears, but just fails on a dir (or any) command. I can telnet to the vms node just fine using putty.

I don't think it can find the prompt, which is what it needs in order for it to execute the next command.

I don't have any specific error checking in Coldfusion turned on, but it would typically return the entire window to the variable (in the case of the attached code: hello2).

I can't use an applet - it has to be just a java call to the jar file embedded in the webpage. It will run as a nightly job which will go out and see if a set of particular files exist. If they do, then I'll store the dates of those files in a database.

Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

Just wanted to bump this since I'm still having issues trying to get this to work...
Doug Phillips
Trusted Contributor

Re: VMS Command Prompt - Can't Tell?!?!

Have you tried doing the login before the setPrompt?

telnet.connect("#node#", 23);
telnet.login("#username#","#password#");
telnet.setPrompt("#prompt#");

Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

I just tried that (just now) and it yielded the same result :(
Doug Phillips
Trusted Contributor

Re: VMS Command Prompt - Can't Tell?!?!

Do you know exactly where it's failing? Do you know that it's actually logging in and making it through the users login.com? The exact error message(s) text might help.
Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

It logs in correctly and is failing when i execute the command. It just gets nothing back. I *suspect* that it has to do with that special character before the prompt (see my original output from putty).
Doug Phillips
Trusted Contributor

Re: VMS Command Prompt - Can't Tell?!?!

The special character in front of the prompts is hex 0D (CR). After each line is 0D 0A 0D (CR LF CR). Seems like maybe a setting someplace that's auto-adding a CR.

If you're sure you're making through the LOGIN.COM and there isn't a SET TERM or such tripping you up, then maybe it is the extra CR that's causing the problem -- but I don't see how.

Sorry, that's about all I have to offer.
Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

I'm not toooooo familiar with java. Do you know how to "set term" using the telnet wrapper in the javassh library?
Doug Phillips
Trusted Contributor

Re: VMS Command Prompt - Can't Tell?!?!

I think LOGIN.COM (LGICMD) would be the place to do your SET TERM. I'd probably create a special username for this application so I could better control and restrict the environment.
Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

I tried changing the environment type in the LOGIN.COM (before) but each terminal seems to auto-set the terminal type. For instance, when i connect through Putty, i get a different terminal type than when I connect through msdos telnet.
Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

Do you know if there is a public VMS node I can connect to just to test my code... Creating separate usernames is not an option - we have standard usernames that are created with installation and my tiny project's username will never make it into the installation document. It'd be a management nightmare to create separate patrol usernames on each node.
Doug Phillips
Trusted Contributor

Re: VMS Command Prompt - Can't Tell?!?!

$set term/inquire does this. You'll probably find that in the login.com file.

That's why if you can't identify the login as coming from your application, you need a special username to log in with. Don't use that user for anything other than your web app (and testing, of course) and make it so that it can olny do the task you want.
Doug Phillips
Trusted Contributor

Re: VMS Command Prompt - Can't Tell?!?!

Sorry, you beat me to the post:-) Some of the folks who hang out here offer public VMS accounts. I think there are some links at WWW.OPENVMS.ORG, too. Otherwise, a google should turn up some.

The SET TERM command is just DCL, though, so you could try sending it just after your login.

I suggested a special username because you need someway to make this login appear unique if you want to cause the LGICMD file to act in a unique way. The other option is to make your client terminal/node identifiable in the login.

Don't know enough about your environment to make suggestions about that.
Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

Doug:

Thanks for the openvms.org link - i got an account on their cluster. I tried running my program - and again I am having the same problem as I was having on my nodes here - it is not getting anything back after sending "dir"... so i dont know what to do... Maybe i'll try setting the terminal type in the login.com
Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

Doug: my login.com on the openvms box is setting the terminal....

++++++
$ set terminal/inquire/noeightbit
+++++++

no luck.
Doug Phillips
Trusted Contributor
Solution

Re: VMS Command Prompt - Can't Tell?!?!

Allen,

I'm unable to build a test from here, but I still don't think your problem is with the "dir " command. I don't think you're making it that far.

I (finally) just looked at the man and mine says that telnet.login only works if the login prompts are "login:" and "Password:".

VMS uses "Username:" and "Password:" so you might instead need waits & sends for the Username: & Password:.

This would mean you'd need different scripts for unix & VMS.

If you *really* are making it past the login with your script (which is *not* actually doing the same thing as your PuTTY session) then I'm at a loss.

The prompt should be recognized even if it has leading characters.

The "dir " should work regardless of the terminal type.

I keep hoping one of the VMS-Java experts will pop in. I guess everyone left early for the holiday (I'm gone in a few minutes, so have a safe New Year!)
Allan Parsons
Advisor

Re: VMS Command Prompt - Can't Tell?!?!

Doug:

HOLY HELL. HOLY HELL HOLY HELL HOLY HELL. You were right. AIX = "login" and VMS = "username". Wow, I can't believe that... I am an idiot for not noticing that. Thanks so much, Doug. **Now walks up and down the hallway kicking himself**
Jan van den Ende
Honored Contributor

Re: VMS Command Prompt - Can't Tell?!?!

Allan,

first of all: Welcome to the VMS forum.

I noticed you only assigned points to the last answer.
The intention of the points system is, to assign points to ALL answers.
How many is entirely YOUR decision, but even if you think an answer does not merit any points, then please do assign zero, to remove the UNASSIGNED.

It shows up in your profile, and low percentages of assignments are frowned upon.

Happy new year!

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.