- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Scripting ANA/SYS
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2007 06:09 AM
тАО07-17-2007 06:09 AM
1) Create a one line cmd for ANA/SYS (for example, TCPIP SHOW DEV TNA6/FULL)
2) Using PIPE (preferable to using intermediate files), pass the above cmd to ANA/SYS then scan the output to extract the field of interest.
Can anyone point me to examples of scripting ANA/SYS?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2007 06:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2007 06:33 AM
тАО07-17-2007 06:33 AM
Re: Scripting ANA/SYS
the example misses a vertical bar before the '(read'.
regards Kalle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2007 07:19 AM
тАО07-17-2007 07:19 AM
Re: Scripting ANA/SYS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2007 10:27 AM
тАО07-17-2007 10:27 AM
Re: Scripting ANA/SYS
I know it was misleading, but the TCPIP cmd I gave as an example is an actual ANA/SYS subcmd (try it!).
Hoff,
It's long story, but in short: the F$GETDVI("TT:", "TT_ACCPORNAM") does return the remote host's IP address and the remote host's IP port #, BUT if the remote host is a VMS host, the port # field is replaced by something called "Location", and I want the port #.
Using ANA/SYS w/the example cmd I gave returns the port #. I've tried various cmds to get that port #, and ANA/SYS w/the TCPIP cmd seems the best I can find. If I had some Macro or other language skills, I might try to poke into the system, but I don't have that expertise, so I'm trying to figure out some way to use ANA/SYS within a PIPE (because I hate creating temp files!).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2007 12:19 PM
тАО07-17-2007 12:19 PM
Re: Scripting ANA/SYS
Kalle's example (with correction) works for me. Complete example (assuming you want your own terminal):
$ PIPE WRITE SYS$OUTPUT -
"tcpip show device/full ",F$TRNLNM("TT")-"_" |-
ANALYZE/SYSTEM |-
SEARCH sys$pipe "Port:" | -
(READ sys$pipe p ; -
p=F$ELEMENT(3,":",p) ; -
DEFINE/JOB/NOLOG port &p)
$ SHOW LOG/JOB port
For a more general mechanism for scripting variable input into programs, complex sequences of commands, either place multiple "WRITE SYS$OUTPUT" commands within brackets in the first pipe stage, or execute another command procedure to generate the output lines. (I tend to recurse into myself with p1 as a tag to avoid multiple files). Example for this problem:
$ IF F$EXTRACT(0,5,p1).EQS."STAGE" THEN GOTO 'p1'
$ self=F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))
$ PIPE @'self' STAGE1 |-
@'self' STAGE2 |-
@'self' STAGE3 |-
@'self' STAGE4
$ EXIT
$
$ STAGE1:
$ WRITE SYS$OUTPUT "tcpip show device/full "+F$GETDVI(F$TRNLNM("TT"),"DEVNAM")-"_"
$ EXIT
$
$ STAGE2:
$ DEFINE/USER SYS$INPUT SYS$PIPE:
$ ANALYZE/SYSTEM
$ EXIT
$
$ STAGE3:
$ SEARCH SYS$PIPE: "Port:"
$ EXIT
$
$ STAGE4:
$ READ SYS$PIPE p
$ p=F$ELEMENT(3,":",p)
$ DEFINE/JOB/NOLOG port 'p'
$ EXIT
Notes:
For this case, there are some peculiarities in device and logical names which require F$GETDVI to be used in this context to determine the terminal name, but not from the command line. The leading "_" also needs to be stripped for the SDA extension to recognise the device.
In general, only the complex cases need the self recursion. One liners can be coded directly into the PIPE command.
Testing can be done from the command line by invoking the stages explicitly:
$ PIPE @proc STAGE1 | @proc STAGE2
etc...
It also sometimes makes sense to parameterise the input pipe:
$ PIPE ...
@'self' STAGE3 SYS$PIPE: "Port:" | -
etc...
$ STAGE3:
$ SEARCH 'p2' "''p3'"
This means the stages can be used to process files, as well as piped input. Thus:
$ PIPE @proc STAGE1 | @proc STAGE2 > check.tmp
$ @proc STAGE3 check.tmp "Port:"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2007 03:38 AM
тАО07-18-2007 03:38 AM
Re: Scripting ANA/SYS
Thanks much for the long answer - it will take me a while to digest all the info!
I tried your example pertinant to my question, and it worked, but...
I now have a question about SDA. I have reduced your script to show the problem:
$ PIPE WRITE SYS$OUTPUT -
"tcpip show device/full ",F$TRNLNM("TT")-"_" |-
ANALYZE/SYSTEM
When I run this I get:
$ PIPE WRITE SYS$OUTPUT -
"tcpip show device/full ",F$TRNLNM("TT")-"_" |-
ANALYZE/SYSTEM
OpenVMS (TM) system analyzer
%TCPIP-I-LINKDATE, TCPIP$TNDRIVER linked on 20-APR-2006 18:22:33.17
%TCPIP-I-LINKDATE, TCPIP$BGDRIVER linked on 24-JUL-2006 15:40:09.29
%TCPIP-I-LINKDATE, TCPIP$PROXY_SERVICES linked on 18-SEP-2003 22:00:28.99
%TCPIP-I-LINKDATE, TCPIP$INTERNET_SERVICES linked on 24-JUL-2006 15:40:15.52
%TCPIP-I-VERSION, TCP/IP Services for OpenVMS Version 4196548608.0
-TCPIP-W-JUSTINCASE, In case you're curious, this is NOT a valid version of TCPI
P
-TCPIP-W-DISCLAIMER, You are proceeding at your own risk!
%TCPIP-W-NOREAD, unable to access location FFFFFFFF.B4DE0168
%TCPIP-I-LASTSTART, Driver last started 17-NOV-1858 00:00:00.45
-TCPIP-I-STARTCOUNT, Driver was started 1 time
-TCPIP-I-PREVSTART, Previously started at 7-JUN-2007 20:51:34.25
%TCPIP-W-NOREAD, unable to access location FFFFFFFF.B4DE0264
%TCPIP-I-TRACEINFO, Trace information is not available
%TCPIP-E-NOPWIP, Pathworks-over-IP (PWIP) driver is not present
%TCPIP-E-NONFSSVCS, NFS Services execlet is not present
%TCPIP-E-NOTBGDEVICE, Not a BG (INET network socket) device
-TCPIP-E-NOTTNDEVICE, Not a TN (network terminal) device
$ exit
If I run SDA interactively and type in the "TCPIP..." cmd, I first get the above display with a "Press RETURN to continue". Pressing RETURN gets the screen with the info I need, but yur script causes SDA to exit at the "Press..." prompt.
Just what is SDA doing here & how do I suppress this first screen?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2007 04:06 AM
тАО07-18-2007 04:06 AM
Re: Scripting ANA/SYS
Just talked to HP and what I'm seeing is info about the TCPIP subsystem which gets loaded and displayed the first time the cmd is used.
Any thoughts on how to modify your script to work around this?
Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2007 12:58 PM
тАО07-18-2007 12:58 PM
Re: Scripting ANA/SYS
> Any thoughts on how to modify
>your script to work around this?
First fix would be to fix the TCPIP mismatch.
Since I don't see that error, I can't test, but if all you need is a "Press return to continue" you should be able to get around that with:
$ PIPE (WRITE SYS$OUTPUT "" ; -
WRITE SYS$OUTPUT -
"tcpip show device/full ",F$TRNLNM("TT")-"_" ; WRITE SYS$OUTPUT "") |-
ANALYZE/SYSTEM
The additional CRs should be benign for systems that don't have the TCPIP mismatch, and if you filter the output with SEARCH you should be able to skip all the warnings.
That said, you really should be fixing the underlying mismatch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2007 05:16 AM
тАО07-19-2007 05:16 AM
Re: Scripting ANA/SYS
Sorry to keep dragging this on...
If I copy the cmd shown in your last email, and paste it into a Telnet session, it works.
If I put your cmd into a script and run it, ANA/SYS exits where it comes to the first prompt of Press RETURN to continue.
Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2007 07:03 AM
тАО07-19-2007 07:03 AM
Re: Scripting ANA/SYS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2007 09:54 AM
тАО07-23-2007 09:54 AM
Re: Scripting ANA/SYS
I've now got some useful ideas.