User Tools

Site Tools


howto:rollover_operators_logfile

How To Rollover Operator's Logfile

1. Locate and check the size of the current OPERATOR.LOG file:

$ SET DEFAULT SYS$MANAGER
$ DIRECTORY /SIZE /DATE /PROTECTION OPERATOR.LOG

Directory DSA2:[COMMON]

OPERATOR.LOG;379       51904  17-NOV-2018 08:46:13.29  (RWED,RWED,RE,)
OPERATOR.LOG;378          59  17-NOV-2018 08:16:23.24  (RWED,RWED,RE,)
OPERATOR.LOG;377          45  17-NOV-2018 08:02:09.28  (RWED,RWED,RE,)
OPERATOR.LOG;376          45  17-NOV-2018 07:50:00.22  (RWED,RWED,RE,)
OPERATOR.LOG;375       28990   9-NOV-2018 09:24:52.82  (RWED,RWED,RE,)
  ...
Total of 32 files, 2395594 blocks.

If your DIRECTORY command gives you a %DIRECT-W-NOFILES, no files found (instead of a list of OPERATOR.LOG files), then your Operator's logfile is likely relocated (sometimes done for VMScluster configurations)… So:

$ SHOW LOGICAL /SYSTEM OPC$LOG*

(LNM$SYSTEM_TABLE)

  "OPC$LOGFILE_ENABLE" = "TRUE"
  "OPC$LOGFILE_NAME" = "COMMON:OPERATOR_CLASS8.LOG"

(LNM$SYSCLUSTER_TABLE)
   "OPC$LOGFILE_NAME" = "COMMON:OPERATOR_CLASS8.LOG" (LNM$SYSTEM_TABLE)

$ DIRECTORY /SIZE /DATE /PROTECTION OPC$LOGFILE_NAME

Directory DSA2:[COMMON]

OPERATOR_CLASS8.LOG;379
                       51904  17-NOV-2018 08:46:13.29  (RWED,RWED,RE,)
OPERATOR_CLASS8.LOG;378
                          59  17-NOV-2018 08:16:23.24  (RWED,RWED,RE,)
OPERATOR_CLASS8.LOG;377
                          45  17-NOV-2018 08:02:09.28  (RWED,RWED,RE,)
OPERATOR_CLASS8.LOG;376
                          45  17-NOV-2018 07:50:00.22  (RWED,RWED,RE,)
OPERATOR_CLASS8.LOG;375
                       28990   9-NOV-2018 09:24:52.82  (RWED,RWED,RE,)
  ...
Total of 32 files, 2395594 blocks.

2. Create a new version of the OPERATOR.LOG logfile:

$ ! Requires only OPER privilege:
$ REPLY /ENABLE=CENTRAL
%%%%%%%%%%%  OPCOM  30-NOV-2018 15:00:05.72  %%%%%%%%%%%
Operator _CLASS8$FTA17: has been enabled, username LRICKER

%%%%%%%%%%%  OPCOM  30-NOV-2018 15:00:05.72  %%%%%%%%%%%
Operator status for operator _CLASS8$FTA17:
CENTRAL

$ REPLY /LOG
%%%%%%%%%%%  OPCOM  30-NOV-2018 15:00:10.23  %%%%%%%%%%%
Logfile was closed by operator _CLASS8$FTA17:
Logfile was CLASS8::DSA2:[COMMON]OPERATOR_CLASS8.LOG;379

$
%%%%%%%%%%%  OPCOM  30-NOV-2018 15:00:10.29  %%%%%%%%%%%
Logfile has been initialized by operator _CLASS8$FTA17:
Logfile is CLASS8::DSA2:[COMMON]OPERATOR_CLASS8.LOG;380

$
%%%%%%%%%%%  OPCOM  30-NOV-2018 15:00:10.29  %%%%%%%%%%%
Operator status for operator CLASS8::DSA2:[COMMON]OPERATOR_CLASS8.LOG;380
CENTRAL

$ REPLY /DISABLE
%%%%%%%%%%%  OPCOM  30-NOV-2018 15:00:21.41  %%%%%%%%%%%
Operator _CLASS8$FTA17: has been disabled, username LRICKER

Your terminal must first be enabled as an operator terminal (REPLY /ENABLE=CENTRAL), then it's the REPLY /LOG command that creates (rolls-over) the new version of OPERATOR.LOG – and you can disable the operator terminal status immediately after (REPLY /DISABLE).

3. Purge old file versions to free up space – keep as many recent versions as you like, but consider whether you'll ever actually need to investigate events in those older files (it hardly ever happens, but again, YMMV).

$ ! ...either
$ PURGE /KEEP=2 OPERATOR.LOG
$ !
$ ! ...or
$ PURGE /KEEP=2 OPC$LOGFILE_NAME

Of course, you can PURGE /KEEP= any number of versions that you like or need – just don't “keep everything,” as most older versions of this file are just obsolete junk-data (past a certain reasonable “shelf-life”).

Done.

How Often Should OPERATOR.LOG Be Rolled-Over?

Different systems and business environments have different operational requirements, but here are a few rules of thumb, and your own specific requirement is likely a combination of two or more of these:

  • Whenever the Operator's Logfile size gets larger than “a few hundred-MB.”
  • Monthly.
  • Quarterly.
  • Maybe even annually.
  • With every system reboot (not suitable for systems which run for months or years without rebooting).
howto/rollover_operators_logfile.txt · Last modified: 2018/12/03 20:07 by lricker

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki