PDA

View Full Version : Telnet-Ausgabe



Chris.jan
28-06-13, 13:50
Ich möchte von der AS/400 aus eine Telnet-Sitzung starten und die Telnet-Ausgabe empfangen/loggen können.

Praktisch das gleiche wie das was man so schön bei einer FTP-Sitzung machen kann. Habt ihr da vielleicht irgendeine Lösung?

In Linux geht sowas ja zBsp mit telnet <server> | tee <output>.

KingofKning
29-06-13, 07:24
Bei Mocha kanst Du den kompletten Telnet verkehr aufzeichnen fall es das ist was Du suchst.

GG

Chris.jan
29-06-13, 09:34
Ja, aber leider brauche ich das für den Batch-Betrieb bzw. einen Submitted Job.

Fuerchau
01-07-13, 07:53
Dafür gibt es die "virtuellen Terminal-API's", mit denen man sich quasi eine eigene Emulation schreiben kann.
Virtual Terminal APIs (http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/apis/vt1a.htm?resultof=%22%74%65%72%6d%69%6e%61%6c%22%2 0%22%61%70%69%22%20)

TARASIK
01-07-13, 08:30
Hallo,
ich vermute da hilft Dir dies:

Who is knocking At Your Door

by Shannon O'Donnell
Sometimes you need to know when a particular user or group of users is signing on to your system, or you want to direct certain messages to a certain group of users when they log on. But to do so, the first thing you need is a way to know who is logging on to your system. You can accomplish all of that, as well as a whole host of other things, by using of a Telnet exit program.

Exit Points
Like many other system functions, such as FTP, Telnet access can be monitored by attaching a program to the Telnet server's exit point. Before we go any further, let's define a couple of terms.
Telnet is an application, just like FTP, that is based on the TCP/IP protocol. Generally speaking, you use Telnet to connect one computer to another via TCP/IP. Telnet exists, in one form or another, on pretty much every computing platform in the world. In fact, you may be surprised to learn that a basic Telnet application has been shipping with Microsoft Windows for many years. To access it, click the Window's Start button, then click the Run button, and, finally, type in the command "telnet" and click OK.
IBM has been using Telnet on the AS/400 since way back when. In fact, IBM's Client Access Express PC5250 emulation product uses an advanced (or specialized) version of Telnet, called TN5250, to allow you to start an emulation session with the AS/400.
An exit point is a spot defined within various IBM applications where you can attach your own programs in order to perform your own customized processing in those applications. For example, you might attach a CL program to the FTP exit point to track FTP activity. Each exit point has a predefined parameter list, which must also exist in your custom application. It is through this parameter list that the application--in our case, the Telnet application--will pass various information to your custom application, and into which you may pass information back to the IBM application.
You can view and work with all the exit points on your system by going to an AS/400 command line and entering the Work with Registration Information (WRKREGINF) command. The exit point that we will be working with for our sample application is named:
Parameter List
As I mentioned earlier, your exit point application must use a predefined parameter list in order to communicate correctly with the IBM application (Telnet, in this case). The problem for most of us non-IBM programmers comes in trying to figure out what the parameter list for a given IBM exit point should be. Exit point parameter information is not widely published for some reason, and as a result, when you want to write an exit program for an IBM exit point, you usually end up having to scour IBM's Web site, AS/400 forums, and other nooks and crannies until you find what you need. 'But there is another way to find the parameter list information you need without a lot of searching.
If you install the System Openness Includes licensed program, which is included on the OS/400 installation CD's that come with your AS/400, you will get a library named QSYSINC installed on your system. Inside the QSYSINC library is a file named QRPGLESRC (as well as files named QRPGSRC, QCBLLESRC, and the like). In the QRPGLESRC file, you will find source members for pretty much every IBM exit point.
When you look at a source member, you'll see that it contains sample source of the exit point parameter list. When you want to write your own exit point application, you can simply copy the source from the sample source members in library QSYSINC into your own app, and you're ready to go. The one thing you won't find, sadly, is any documentation on how to use the parameter list or the particular exit point that it is for, so proceed with caution, and test, test, test!
For our Telnet exit point application, we'll use the sample source defined in a member named ETGDEVEX. Create a new RPG IV source member in your own library and copy the ETGDEVEX source into it.
Sample Telnet Application
Once you have the parameter list, the rest of your work is really easy. While not heavily documented, the sample source you get from QSYSINC does include some very basic information about each parameter item. Usually, this is enough that you can easily figure out how to use it for your own needs.
For example, a Telnet application might want to log who is signing on to your AS/400. You can get this information from the parameter named ETGUP. When the Telnet server passes control to the exit point application (your program), the field named ETGUP will contain the user ID of the person attempting to log on to your system. Based on that value, you may choose to either allow or disallow this person access. If you do allow access, you may want to log, to a database, who is signing on, as well as the date and time. In addition, you may want to send a message to a particular user, or group of users, when they log on. Perhaps some sort of tickler system that reminds them of upcoming appointments. Use your imagination. You can probably think of a lot of uses for an application such as this.
Attach to Exit Point
After you've written your custom exit point application, you need to attach it to the correct exit point. Use the WRKREGINF command to display the list of available exit points and scroll down until you see the exit point named QIBM_QTB_DEVINIT. This is the "Telnet Device Initialization" exit point. This is where you'll attach your own program. Follow the on-screen instructions for attaching your exit program to this exit point.
If you also want to track when your users are logging off of your system, you can repeat the steps described above and write an exit point program for the QIBM_QTG_DEVTERM ("Telnet Device Termination") exit point. The program attached to this exit point will be called every time someone logs off of your AS/400.
Try It
You now have the information you need to start writing exit point programs to create a very tightly controlled system. You've been given a powerful gift. Use it wisely, grasshopper.
A Telnet Exit Program Tells You Who's Knocking At Your Door

Fuerchau
01-07-13, 09:14
Dies betrifft ausschlißlich die Exitpoints.
Mit diesen ist der Datenstrom der Sitzung nicht anzapfbar.