|
|
The LogRemover application does more than remove logs. It constantly monitors logs and moves or deletes them as defined by the rules in the LogRemover.ini file. Default rules are automatically configured during the initial configuration of your system.
By default, LogRemover acts on logs generated by Cisco on the GateServer. If it is necessary, System Administrators can define the LogRemover rules for individual log files, for example you might want to delete one log file and move another. They can also configure periodic delays during rules processing to minimize LogRemover's impact on CPU and I/O usage, and configure a time period that must elapse before the LogRemover utility can start rules processing again.
Before you start administering LogRemover application, ensure that the following tasks have been completed.
You perform the following tasks:
You can make the following changes to LogRemover rules processing:
Step 1 Go to the GateServer where the LogRemover application resides.
Step 2 Log in as spmaster.
Step 3 Type: cd $PARMLIB/apps/LogRemover
Step 4 Edit the LogRemover.ini files and set the following attributes (Table 6-1).
[General]
PostRuleProcessingDelay=
FileBatchSize=
FileBatchDelay=
[ActiveRules]
Rule1
Rule2
[Rule1]
FileList=
LogRetentionPeriod=
LogRetentionUnits=
Action=
MovePath=
| Attribute | Description | Valid Values |
|---|---|---|
[General] | Section label. This section controls how often the application processes all rules, how many files the application will process before delaying, and how long the application will delay after each batch of files has been processed. It should not be edited. | NA |
Indicates how long, in minutes, the delay that will be encountered from the time the current round of rule processing is complete and next round begins. | 1 - 1440 minutes | |
Indicates how many files will be processed before a configurable delay is introduced. | 1 - 60 | |
FileBatchDelay | Indicates how long, in seconds, to delay before another FileBatchSize file is processed. | 1 - 60 seconds |
[ActiveRules] | Section label. This section lists which Rules Section(s) will be processed by LogRemover. It should not be edited. | NA |
Rule | A listing of all the rules sections that will processed by LogRemover. | This can be any name you choose. |
[Rule] | Section label. This section allows the administrator to configure which file(s) are moved or deleted, whether we should check the file or set of files on a daily or hourly basis, and how long to skip the files before moving or deleting them. It also allows the administrator to specify where files for a given rule should be moved. | Must match a Rule listed under [ActiveRules]. |
FileList | Informs the application which file(s) to process for this rule. If the application cannot expand any environment variable, the rule will be ignored (on the given iteration) and the following message will be written to the $PARMLIB/logs/logfiles/*LogRemover*Sof file: If wildcard characters cannot be expanded, the rule will be ignored and the following message will be written to the $PARMLIB/logs/logfiles/*LogRemover*Sof file: "[Rule <Current Rule Name>] Could not expand FileList." If FileList starts with any character other than / or $, then FileList will be prepended with $PARMLIB/ and then processed as if $PARMLIB/FileList were in the ini file. $PARMLIB/FileList is not written to the ini file in these cases. It is only prepended and later expanded in memory. | Valid file name(s) must start with either a backslash (/) or a dollar sign ($) or an alphabetic character. A "." or ".." are not allowed as the first character. FileList may have wildcard characters or environmental variables embedded within them. |
Indicates how long in LogRetentionUnits time intervals the file should be ignored. After the file is older than LogRetentionPeriod/LogRetentionUnit (e.g., 5 Day), the file is either deleted or moved based on Action. If LogRetentionPeriod is set to a negative value, the following message will be written to the $PARMLIB/logs/logfiles/*LogRemover*Sof file: "[Rule <Current Rule Name>] LogRetentionPeriod is invalid. Set LogRetentionPeriod to either zero (skip rule) or a positive value (process in n LogRetentionUnits)." | 0 - 32000 0 = rule is skipped | |
Indicates whether the LogRetentionPeriod is based on an hourly or daily basis. If this field is set to any other value, the following message will be written to the $PARMLIB/logs/logfiles/*LogRemover*Sof file: | day, DaySets retention based on days hour, HourSets retention based on hours | |
Indicates whether to delete or move the file to <MovePath>/<Current Filename>.old. If this field is set to any other value, the following message will be written to the $PARMLIB/logs/logfiles/*LogRemover*Sof logfile: "[Rule <Current Rule Name>] Action is invalid. | move, MoveMoves the current file. delete, DeleteDeletes the current file. | |
When Action is set to move, indicates location of directory. If the application cannot expand any environment variable, the rule will be ignored (on the given iteration) and the following message will be written to the $PARMLIB/logs/logfiles/*LogRemover*Sof file: Wildcard characters may not be included in the MovePath. If they are included, the files will not to be processed and the following message will be written to the $PARMLIB/logs/logfiles/*LogRemover*Sof file: "Could NOT Move <Current Filename> No such file or directory." If MovePath starts with any character other than "." or "/", then MovePath will be prepended with $PARMLIB/ and then processed as if $PARMLIB/MovePath were in the ini file. $PARMLIB/MovePath is not written to the .ini file in these cases. It is only prepended and later expanded in memory. | A filepath, starting with either a slash (/), an alphabetic character, or a single period (with nothing following the period), which tells the application where to move the file on Actions of Move. MovePath may have environmental variables embedded within them. If MovePath is set to a period only, the current file is moved to current file.old. |
Figure 6-1 shows the default contents of the Samples/LogRemover.ini configuration file.
[General]
[AllEventLogs]
[AllResLogs]
[AllSofLogs]
[AllSNMPLog] FileList=logs/logfiles/*.log LogRetentionPeriod=2 LogRetentionUnits=Day Action=Delete MovePath=.
[AllSNMPErr] FileList=logs/logfiles/*.err LogRetentionPeriod=2 LogRetentionUnits=Day Action=Delete MovePath=.
[AllEscalation]
[AllErrlog] | [ErroutUMout]
[ErroutUMerr]
[ErroutFaxPrintOut]
[ErroutFaxPrintErr]
[ErroutMWIout] FileList=$HOME/errout/MWI*out* LogRetentionPeriod=2 LogRetentionUnits=Day Action=Delete MovePath=.
[ErroutMWIerr] FileList=$HOME/errout/MWI*err* LogRetentionPeriod=2 LogRetentionUnits=Day Action=Delete MovePath=.
[ErroutMHout]
[ErroutMHerr]
[ErroutAmisaout] FileList=$HOME/errout/amisaout.*.out LogRetentionPeriod=2 LogRetentionUnits=day Action=delete MovePath=.
[ErroutAmisaerr] FileList=$HOME/errout/amisaout.*.err LogRetentionPeriod=2 LogRetentionUnits=day Action=delete MovePath=.
[ErroutReloadrules] FileList=$HOME/errout/reloadrules.* LogRetentionPeriod=8 LogRetentionUnits=Hour Action=delete MovePath=. |

The LogRemover application is added to Schedule.<hostname> file during the initial installation of your system. The following procedure shows how this application is manually set up in the Schedule file.
Step 1 Go to GateServer where the LogRemover application should reside and type:
$PARMLIB/parms/APP
Step 2 Add the following information to the Schedule.<hostname> file
STATIC_NOWAIT 100 1 1 1 * * LogRemover LogRemover/LogRemover
Step 3 If the system is operational and you are reloading changes to an existing LogRemover application, you must stop the application first.
Type: kill <PID>
where PID is the process ID of the application instance that you want to stop
Step 4 Reload the schedule table.Type:
umcli
resched static LogRemover
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Mon Sep 25 19:44:02 PDT 2000
Copyright 1989-2000©Cisco Systems Inc.