In the first two articles NetServers for everyone we have configured the service And shared IFS resources . We did this using Navigator for io via OS API. There are very few commands available for NetServer. In short, you can start or stop the service via
STRTCPSVR SERVER(NETSVR) or
ENDTCPSVR SERVER ( NETSVR) .
If you find yourself unable to access Navigator for i, that can be a problem.
In this article we will see a rich set of commands that can be used in a 5250 session to carry out all operations with NetServer: the NetTools .
The NetTools are available from the IBM version V5R2. It takes a little effort to install these provided tools as-is from IBM in the library
QUSRTOOL extension .
If the QUSRTOOL library is not found on your system, you need to install the opt. 7 “Sample program library” of the operating system (product 5770SS1).
Having the library available, proceed with these simple instructions to install the NetTools:
CRTLIB LIB(NETSRVCMD) TEXT('iSeries NetServer menu and commands')
CALL QUSRTOOL/UNPACKAGE PARM('*ALL ' 1)
CRTCLPGM NETSRVCMD/TZLSINST QUSRTOOL/QATTCL
CALL NETSRVCMD/TZLSINST NETSRVCMD
That’s all. Now just add the library to the library list
NETSRVCMD extension and view the menu
NETS extension to have all these commands available:
Surely the most useful commands are 3. Add File Share (
ADDNSVFSHR ) to add shared resources, 12. Work with NetServer Users (
WRKNSVUSR ) to re-enable users and 15. Work with NetServer Sessions (
WRKNSVSSN ) to monitor all active client sessions on the NetServer.
Go into detail
Furthermore, this utility library is very interesting because we have the sources available, so there is excellent material for studying the operating system APIs.
TZLSINFO In the file
QATTINFO of the library
QUSRTOOL extension contains the NetTools technical documentation. It describes the purpose, installation instructions, and usage details. In the chapter “What is Created” all the sources that make up the NetTools are listed.
The NetServer APIs
In previous articles we had occasion to mention some of the APIs to manage and configure NetServer. Below you will find the complete list:
- Guest User ID Setting:
CALL QZLSCHSG (guest-user-profile X'00000000')
- Change Server Information (
- Change server name (
- Start NetServer:
CALL QZLSSTRS PARM('0' X'00000000')
- Shutdown NetServer:
CALL QZLSENDS extension PARM(X'00000000')
- Sharing a folder:
CALL QZLSADFS extension PARM(share-name 'folder-path' x'00000005' x'00000000' 'shared-description' x'00000001' x'ffffffff' x'00000000')
the third parameter is the length of the string ‘folder-path’
the sixth parameter sets the permission of the share (2 for read/write, 1 for read only)
- Unsharing a folder:
CALL QZLSRMS PARM(share-name x'00000000')
- Change File Server Share (
- Add Print Server Share (
- Change Print Server Share (
- List server information (
- Open List of Server Information (
- End Server Session (
The main page of the IBM documentation on NetServer can be consulted at this link: https://www.ibm.com/docs/en/i/7.5?topic=services-i-netserver . Other useful resources can be found in the attached document:
In the next article we will talk about how access shared resources from a client .