TAIL for OVMS IA64? (12998 Views)
Reply
Regular Advisor
roose
Posts: 137
Registered: ‎01-19-2006
Message 1 of 13 (12,998 Views)
Accepted Solution

TAIL for OVMS IA64?

Hi Guys,

 

Just wanted to check if there is an existing port of the TAIL binary for OpenVMS IA64? We were using previously the TAIL freeware from Hunter Goatley on our Alpha servers, but I was getting errors when I tried to compile it in our Itanium server. I tried doing a type/tail on our Oracle alert log, but I was getting the error "-RMS-F-ORG, invalid file organization value". I also tried a Perl implementation of tail but it was not functioning properly. I don't want to install GNV on our production servers, so we are only looking for a native tail binary on OVMS IA64.

 

Thanks in advance for your help!

 

Regards,

Roose

Honored Contributor
Steven Schweda
Posts: 9,096
Registered: ‎02-23-2005
Message 2 of 13 (12,993 Views)

Re: TAIL for OVMS IA64?

> [...] the TAIL freeware from Hunter Goatley [...]

   Not a very detailed description of the program, or where you found
it.

> [...] I was getting errors [...]

   Not a very detailed description of what happened.

>  [...] when I tried to compile it in our Itanium server.

   Not a very detailed description of what you did, or of your system.

   As usual, showing actual commands with their actual output can be
more helpful than vague descriptions or interpretations.

> [...] but I was getting the error [...]

   What was the _whole_ message?

> [...] I also tried a Perl implementation [...]

   Not a very detailed description of anything.

> [...] but it was not functioning properly.

   Not a very detailed description of what happened, here, either.

Regular Advisor
roose
Posts: 137
Registered: ‎01-19-2006
Message 3 of 13 (12,989 Views)

Re: TAIL for OVMS IA64?

Hi Steven,

 

1. Hunter Goatley's TAIL archive freeware http://vms.process.com/scripts/fileserv/fileserv.com?TAIL

2. I am attaching the log when I tried to compile the source code for Hunter's program.

3. I am doing the compilation on a standalone HP Integrity rx2660 with OpenVMS 8.3-1H1, and compiling it using HP C v7.3-018.

4. Problem with the Perl script TAIL implementation is if I tried to put the parameter to specify the number of lines I would like to see, e.g $ tail -n10 operator.log,  it will still print out the whole file. I am attaching the TAIL Perl script that I got from the internet (already forgot which site I got it).

 

Thanks.

Regular Advisor
roose
Posts: 137
Registered: ‎01-19-2006
Message 4 of 13 (12,987 Views)

Re: TAIL for OVMS IA64?

Here was the error when I used type/tail=10 on our Oracle alert log file:

ORACLE10G_S1P0A::> dir s1p0c_prod_alert*.log/size

Directory DISK$PKG:[1020.ADMIN.PROD.bdump]

S1P0C_PROD_alert.log;1
3576

Total of 1 file, 3576 blocks.
ORACLE10G_S1P0A::> type/tail=10 s1p0c_prod_alert.log
%TYPE-W-OPENIN, error opening DISK$PKG:[1020.ADMIN.PROD.bdump]S1P0C_PROD_alert.log;1 as input
-SYSTEM-E-UNSUPPORTED, unsupported operation or function
-RMS-F-ORG, invalid file organization value
ORACLE10G_S1P0A::> dir/full S1P0C_PROD_alert.log;1

Directory DISK$PKG:[1020.ADMIN.PROD.bdump]

S1P0C_PROD_alert.log;1 File ID: (16194,4,0)
Size: 3576/3584 Owner: [DBA,ORACLE10G]
Created: 13-JUL-2011 15:38:09.33
Revised: 2-SEP-2011 14:02:26.52 (21300)
Expires: <None specified>
Backup: <No backup recorded>
Effective: <None specified>
Recording: <None specified>
Accessed: <None specified>
Attributes: <None specified>
Modified: <None specified>
Linkcount: 1
File organization: Sequential
Shelved state: Online
Caching attribute: Writethrough
File attributes: Allocation: 3584, Extend: 0, Global buffer count: 0, No version limit
Record format: Variable length, maximum 0 bytes, longest 904 bytes
Record attributes: Carriage return carriage control
RMS attributes: None
Journaling enabled: None
File protection: System:RWED, Owner:RWED, Group:, World:
Access Cntrl List: None
Client attributes: None

Total of 1 file, 3576/3584 blocks.
ORACLE10G_S1P0A::>
Esteemed Contributor
H.Becker
Posts: 373
Registered: ‎04-09-2009
Message 5 of 13 (12,979 Views)

Re: TAIL for OVMS IA64?

$ help type/tail

TYPE
  /TAIL
        /TAIL[=n]
     Displays the last several lines of a log file. The value, n,
     defaults to p-2 where p is the current terminal page length. You
     can use TYPE/TAIL only if all of the following criteria are true:
     o  File organization is sequential.
     o  The longest record is less than 512 bytes.
     o  The record format is either VAR, VFC, STM, STRCM or STMLF
        (for more information, see the description of FAB$B_RFM in the
        OpenVMS Record Management Services Reference Manual).
     o  The file being typed is on a device that supports random
        access. The TYPE/TAIL command does not work on magnetic tape
        drives.
     Even with this criteria, some file conditions cannot be
     anticipated and may not allow display of the last several lines
     of a log file, resulting in the following error message:
     %TYPE-W-READERR, error reading DEVICE:[DIRECTORY]FILE.EXT;1
     -SYSTEM-E-UNSUPPORTED, unsupported operation or function
$
It seems the longest record length doesn't meet the above criteria. 
The GNV tool will not help, here. It expects a stream_lf file.
Honored Contributor
Hoff
Posts: 4,962
Registered: ‎01-29-2006
Message 6 of 13 (12,952 Views)

Re: TAIL for OVMS IA64?

That file might well have the LOG extension, but (based on the posted settings, and particularly that 904 byte record length) it is apparently not intended for use by humans.  (A situation which reminds me of this forum software, reading that last and garbled post from Hartmut.  But I digress.)

 

Check with whatever is writing that log, and see if you can adjust the record length to something more appropriate.

 

Alternatively, I used a gnv tool to wrap gonzo file text to fix a long-line issue with a text file.

Honored Contributor
Steven Schweda
Posts: 9,096
Registered: ‎02-23-2005
Message 7 of 13 (12,948 Views)

Re: TAIL for OVMS IA64?

> 1. Hunter Goatley's TAIL archive freeware http://vms.process.com/scripts/fileserv/fileserv.com?TAIL


   Did you look at the dates in that fossil?

   It's too old.  It doesn't know about ODS5 extended file names.  It
has a very unfortunate default_string.  I'm sure that if I looked at it
longer, I could find any number of reasons for a complete re-write.
However, I took out some of the most lame parts ("#ifdef __alpha"), so
that it might get past a modern compiler in more places, and it's
attached here.


   I deny everything.

 

 

   Well, I would have attached it here, but today I'm on a Mac with
Firefox, so I can post a message normally instead of as a text
attachment (which is all I've gotten to work with SWB on my main VMS
system), but here I can't seem to get an attachment accepted.  So, for a
limited time only:

      http://antinode.info/ftp/misc/tail.c


   I still deny everything.

Honored Contributor
Hein van den Heuvel
Posts: 6,588
Registered: ‎05-19-2003
Message 8 of 13 (12,917 Views)

Re: TAIL for OVMS IA64?

Roose>>. I tried doing a type/tail on our Oracle alert log, but I was getting the error "-RMS-F-ORG, invalid file

organization value".

 

It is unfortunate that the type/tail implementor highjacked a fine error message for a lowly cause.

The error should have been "TYPE-F-ing_too_lazy. We know what is good for you." 

 

One single long record can spoil the fun for a file.

I don't have an Oracle-on-openvms handy, but I suspect Oracle does not keep the file open.

In that case you can just make a white lie about the LRL using SET FILE/ ATTR=LRL=511 and hope for the best.

You  could  rename it away, have Oracle create a fresh one, and then use SET FILE

 

HB> It seems the longest record length doesn't meet the above criteria. 

 

Yeah sure, but how LAME are those criteria?

Why would they even bother to validate a record length for a stream-lf file?

Why are fixed length records not allowed? Those are the easiest to implement of all!

(Cobol applications often make those.)

 

Hoff>> it is apparently not intended for use by humans.  

BS. The Oracle alert log is strictly, and only, intended for use by humans.

Now it may have made tricky or even erroneous choices but that is not up to TYPE to judge.

 

Fwiw, I have raised the type malfunction with engineering in a meeting last month and got some traction.

 

Regards,

Hein.

 

 

Honored Contributor
Hoff
Posts: 4,962
Registered: ‎01-29-2006
Message 9 of 13 (12,911 Views)

Re: TAIL for OVMS IA64?

I've seen this sort of code before and know a porting error when I see it.  This is an Oracle error.  

 

It might have been the intent of the programmers here to use this log for humans, but (as I stated) that wasn't the result.    This isn't a file intended for (VMS-using) humans.

 

These results are typically usable only after file modifications are made; wrapping or related.

 

While you're raising this testing coverage issue with Oracle, the test coverage likely need generic LRL and related checks of the resulting files; I'd likely add checks to detect and flag any other questionable RMS file constructions might exist here.

Honored Contributor
John Gillings
Posts: 2,995
Registered: ‎07-31-2003
Message 10 of 13 (12,903 Views)

Re: TAIL for OVMS IA64?

I'm with Hein on this, the way TYPE/TAIL works (or rather, doesn't work) is rather silly and could be improved significantly with little effort, if engineering cared about usability.

 

Something I've seen with log files is the phenomenon of TYPE/TAIL working for a particular log file while it's being actively written, but then failing with -RMS-F-ORG once it's been closed. It's usually a STREAM_LF log file from a C program. What happens is the MRS and LRL of the open file are 0 while the file is being written, so TYPE is happy, but once it's closed, LRL is set to 32767, which TYPE doesn't like.

 

$ SET FILE/ ATTR=LRL=511 on an affected file is one way around it, another is to reset the DECC default LRL:

 

$ DEFINE/SYSTEM DECC$DEFAULT_LRL 511 

A crucible of informative mistakes
Esteemed Contributor
H.Becker
Posts: 373
Registered: ‎04-09-2009
Message 11 of 13 (12,882 Views)

Re: TAIL for OVMS IA64?

>>> Yeah sure, but how LAME are those criteria?

As lame as the implementation of a Unix, aka coreutils tool in VMS. However, this has been this way for years and nobody asked (until last month?) to improve it or got through with her/his request.

 

>>> $ DEFINE/SYSTEM DECC$DEFAULT_LRL 511

I wouldn't dare to do this, even if I had the privileges. DEFINE/USER is what I use and recommend when setting a CRTL feature logical. No, I didn't write the HELP text:

 

$ help crtl Feature_Logical_Names
...
                                     NOTES
          o  Do not set C RTL feature logical names for the system.
             Set them only for the applications that need them,
             because other applications including OpenVMS components
             depend on the default behavior of these logical names.
...
Honored Contributor
Hoff
Posts: 4,962
Registered: ‎01-29-2006
Message 12 of 13 (12,877 Views)

Re: TAIL for OVMS IA64?

Those DECC$ logical names and the related non-modular morass can be stabiility kryptonite.  

 

I'd recommend those are either defined /USER only, or are embedded within specific and task-dedicated processes.   Defining those logical names with /SYSTEM risks knocking over something else, and quite possibly with an obscure error.

 

And I'm not arguing that TYPE /TAIL is a mess.  Just that a "log" file that's over 132 or so characters in width isn't intended for (VMS) humans.  

 

Like TYPE /TAIL's various issues, the lack of baked-in word-wrapping are related parts of the UI-level problems and omissions.  (When the easiest way to wrap text is GNV, there's something missing in the base OS.)

Regular Advisor
roose
Posts: 137
Registered: ‎01-19-2006
Message 13 of 13 (12,843 Views)

Re: TAIL for OVMS IA64?

Hi Steven,

 

I was able to compile the attached code and it seems to work! I'll test it first again with my test server before I port it over to our production cluster.

 

Thanks!

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.