The FILENAME statement specifies the path to and name of a file to monitor. It also specifies the monitor conditions for the file trigger.
Supported Job Type
This statement is required for the File Trigger job type.
Syntax
This statement has the following format, except for CA WA Agent for HP Integrity NonStop:
FILENAME file_name
{CREATE [SIZE(integer[K|M])]
[OWNER(owner)][GROUP(group)]
[NOCHANGE(min)]
[CONTINUOUS(alertid)]
[RECURSIVE]}
{DELETE [OWNER(owner)][GROUP(group)]
[CONTINUOUS(alertid)]
[RECURSIVE]}
{EXIST [OWNER(owner)][GROUP(group)]
[RECURSIVE]}
{EXPAND SIZE(integer[K|M])|DELTA(integer[K|M])|PERCENT(integer)
[OWNER(owner)][GROUP(group)]
[NOCHANGE(min)]
[CONTINUOUS(alertid)]
[RECURSIVE]}
{NOTEXIST [OWNER(owner)][GROUP(group)]
[RECURSIVE]}
{SHRINK SIZE(integer [K|M])|DELTA(integer [K|M])|PERCENT(integer)
[OWNER(owner)][GROUP(group)]
[NOCHANGE(min)]
[CONTINUOUS(alertid)]
[RECURSIVE]}
{UPDATE [OWNER(owner)][GROUP(group)]
[NOCHANGE(min)]
[CONTINUOUS(alertid)]
[RECURSIVE]}
This statement has the following format for CA WA Agent for HP Integrity NonStop:
FILENAME file_name
{CREATE [CONTINUOUS(alertid)]}
{UPDATE [CONTINUOUS(alertid)]}
Specifies the path to and name of the file to monitor.
Limits: Up to 128 characters; case-sensitive
UNIX/Windows: You can use wildcards and spaces in your UNIX and Windows file names and paths.
i5/OS:
/QSYS.LIB/library.LIB/object.type/
/QSYS.LIB/library.LIB/object.FILE/member.MBR
library/object/type
library/object/*FILE(member)
Specifies the name of the library that contains the object. The value must be a valid i5/OS library name.
Limits: Up to 10 characters
Notes:
Specifies the name of the object. The value must be a valid i5/OS object name.
Limits: Up to 10 characters
Notes:
Specifies the type of object.
Limits: Up to 10 characters
Note: You can specify *ALL to match any name.
Example: FILE
Specifies a member in the *FILE object. The value must be a valid i5/OS member name.
Limits: Up to 10 characters
Notes:
File Trigger Types
Specify one of the following file trigger types to monitor for. For each trigger type, you can specify additional criteria.
Indicates that the file trigger occurs when the file is created. This is the default file trigger type.
Indicates that the file trigger occurs when the file is deleted.
Indicates that the file trigger occurs if the file exists. If the file does not exist, the job fails.
Indicates that the file trigger occurs when the file size increases. If the file does not exist, the job fails.
Note: If you specify the EXPAND file trigger type, you must specify one of the SIZE, DELTA, or PERCENT operands.
Indicates that the file trigger occurs if the file does not exist. If the file exists, the job fails.
Indicates that the file trigger occurs when the file size decreases. If the file does not exist, the job fails.
Note: If you specify the SHRINK file trigger type, you must specify one of the SIZE, DELTA, or PERCENT operands.
Indicates that the file trigger occurs when the file is updated.
Additional Criteria
You can specify the following additional criteria depending on the file trigger type. For information on the criteria that applies to each trigger type, refer to the Syntax.
(Optional) Specifies the identifier of an alert to be triggered when the specified file trigger conditions occur. Defines the job as continuous. To end continuous monitoring, you must complete the job manually or cancel it. If you do not specify this operand, the job completes when the specified file trigger conditions occur.
Specifies the alert identifier to be triggered.
Limits: 1-8 alphanumeric characters; the first character must be alphabetic
Note: The alert must have been previously defined to the scheduling manager. Not all scheduling managers support the CONTINUOUS operand.
Notes:
Note: If the CONTINUOUS operand is specified with the NOCHANGE operand and a wildcard is used in the file name value, all of the matching files must remain unchanged for the duration of the NOCHANGE interval. If another file satisfying the trigger criteria is updated during the NOCHANGE interval, the trigger waits until the trigger interval lapses on the first file before monitoring the second file for the duration of the NOCHANGE interval.
Defines the number of bytes the file size must change for the file trigger to occur.
Limits: Up to 10 characters; the first character must be numeric
Note: You can specify the file size in kilobytes (KB) or megabytes (MB) instead of bytes by appending K or M.
(Optional) Specifies the name of the group that owns the file to be monitored.
Limits: Up to 16 characters; case-sensitive; it cannot contain delimiters (such as spaces)
Notes:
(Optional) Defines the number of minutes the file must remain unchanged to satisfy the monitor condition.
Limits: Up to 8 numeric digits
Example: 60
(Optional) Specifies the user ID that owns the file to be monitored.
Limits: Up to 16 characters; case-sensitive; it cannot contain delimiters (such as spaces)
Notes:
Defines the percentage the file size must change for the file trigger to occur.
Limits: Up to 10 characters; the first character must be numeric
(Optional) Specifies that the job monitors for file activity in the specified directory and all of its subdirectories.
Defines a limit on the file size in bytes. If the file trigger type is CREATE or EXPAND, the file trigger occurs when the file size is equal to or greater than the specified size. If the file trigger type is SHRINK, the file trigger occurs when the file size is equal to or less than the specified size.
Limits: Up to 10 characters; the first character must be numeric
Note: You can specify the file size in kilobytes (KB) or megabytes (MB) instead of bytes by appending K or M.
i5/OS: When monitoring a *FILE object in QSYS with no member specified in the file name value, the job monitors the entire object size. The entire object size includes the size of the file object itself and the total size of the file object's members. To only monitor the total size of the file object's members, specify *ALL as the member name.
Notes:
FILENAME 'c:\data files\pay.dat' CREATE
In the following example, the agent monitors for any file in the /usr/data directory:
FILENAME '/usr/data/*' CREATE
In the following example, the agent monitors for any file in the /usr/data directory that has a file name with four characters and any extension:
FILENAME '/usr/data/????.*' CREATE
FILENAME /usr/data/* UPDATE
The /* characters are interpreted as the beginning of a comment, so the scheduling manager interprets the statement as follows:
FILENAME /usr/data CREATE /* UPDATE
Instead of monitoring for updates to all files in the /usr/data/ directory, the agent monitors for the data file in the /usr/ directory. Also, since CREATE is the default file trigger type and UPDATE is considered part of the comment, the CREATE file trigger type is used instead of the intended UPDATE file trigger type.
The following statement monitors for the creation of any file object in the QSYS file system with a file name that matches the PAY* generic name:
FILENAME 'LIB/PAY*/*FILE' CREATE
Note: A name cannot contain only a single asterisk and no other characters. To specify all possible names, use the special value *ALL.
CREATE file trigger type Notes:
FILENAME /usr/data/payroll CREATE OWNER(JDOE)
If the payroll file is created, but it is not owned by JDOE, the job does not complete. It waits until all specified criteria are satisfied, including the OWNER criteria. If you change the owner of the file to JDOE, the job completes.
DELETE file trigger type Notes:
FILENAME /usr/data/pay* DELETE CONTINUOUS(INFO)
EXIST file trigger type Notes:
EXPAND file trigger type Notes:
|
The file size when the Agent scans the Directory |
Does the file trigger occur? |
|---|---|
|
15 KB |
Yes. The file is bigger than 10 KB when the directory is first scanned. 15 KB becomes the new upper limit. |
|
20 KB |
Yes. 20 KB exceeds the upper limit of 15K. 20 KB becomes the new upper limit. |
|
35 KB |
Yes. 35 KB becomes the new upper limit. |
|
30 KB |
No. The upper limit is now 35K. The size needs to exceed 35 KB for the trigger to occur. |
|
40 KB |
Yes. 40 KB exceeds the upper limit of 35K. 40 KB becomes the new upper limit. |
|
45 KB |
Yes. 45 KB becomes the new upper limit. |
|
60 KB |
Yes. 60 KB becomes the new upper limit. |
|
50 KB |
No. The upper limit is now 60K. The size needs to exceed 60 KB for the trigger to occur. |
|
65 KB |
Yes. 65 KB exceeds the upper limit of 60K. 65 KB becomes the new upper limit. |
NOTEXIST File Trigger Type Notes:
SHRINK file trigger type Notes:
SHRINK DELTA(10K) CONTINUOUS(INFO)
UPDATE file trigger type Notes:
Example: Monitor for an Increase in File Size to a Certain Amount
This example monitors the test file in the data directory. When the test file reaches one byte or more, the job completes.
AGENT NT_NY FILENAME /data/test EXPAND SIZE(1)
Example: Monitor for an Increase in File Size by a Certain Amount
This example monitors the record file in the credit directory. When the record file expands by two megabytes or more, the job completes.
AGENT UNIX_TOR FILENAME /credit/record EXPAND DELTA(2M)
Example: Monitor for a Decrease in File Size by a Certain Percentage
This example monitors the test file in the c:\amount directory. When the test file shrinks by 65% or more, the job completes.
AGENT NT_TOR FILENAME c:\amount\test SHRINK PERCENT(65)
Example: Check that a File Exists in a Directory
This example monitors the money file in the c:\bank\account directory. If the money file exists in that directory, the job completes. If the money file does not exist in that directory, the job fails.
AGENT NT_TOR FILENAME c:\bank\account\money EXIST
Example: Check that a File Exists in a Directory or Its Subdirectories
This example monitors the c:\bank\account directory and its subdirectories for the money file. If the money file exists in any of the monitored directories, the job completes. If the money file does not exist in any of the monitored directories, the job fails.
AGENT NT_TOR FILENAME c:\bank\account\money EXIST RECURSIVE
Example: Check that a File Does Not Exist in a Directory
This example monitors the vacation file in the /start/term/ directory. If the vacation file does not exist in that directory, the job completes. If the vacation file exists in that directory, the job fails.
AGENT UNIX_NY FILENAME /start/term/vacation NOTEXIST
Example: Monitor for an Increase in File Size to a Certain Amount with an Unchanged Condition
This example monitors the analysis file in the research directory. When the analysis file expands by 1 byte or more and remains unchanged for 5 minutes or more, the job completes.
AGENT UNIX_CHI FILENAME /research/analysis EXPAND SIZE(1) NOCHANGE(5)
Example: Monitor for a Decrease in File Size to a Certain Amount
This example monitors the distribute file in the /cash/items directory. When the distribute file shrinks to 1 KB or less, the job completes.
AGENT UNIX_CHI FILENAME /cash/items/distribute SHRINK SIZE(1K)
Example: Monitor for a Decrease in File Size by a Certain Amount
This example monitors the cash file in the c:\cost directory. When the cash file shrinks by 10 bytes, the job completes.
AGENT NT_TOR FILENAME c:\cost\cash SHRINK DELTA(10)
Example: Monitor for an Update to a File in a Directory and its Subdirectories
This example monitors the /usr/data/ directory and its subdirectories for the payroll file. When the payroll file is updated in any of the monitored directories, the job completes.
AGENT UNIX_NY FILENAME /usr/data/payroll UPDATE RECURSIVE
Example: Monitor for Updates to All Files in a Directory and its Subdirectories
This example monitors all the files in the /usr/data/ directory and its subdirectories. When any file is updated in any of the monitored directories, the job completes.
AGENT UNIX_NY FILENAME '/usr/data/*' UPDATE RECURSIVE
Example: Use Wildcards to Specify a File Name on the Root File System
This example monitors for files that are created in the /home/cybesp/ directory in the root file system:
AGENT I5AGENT FILENAME '/home/cybesp/PID????.*' CREATE
The job completes if a file is created with a file name that matches the following criteria:
Example: Use a Generic Name to Specify a QSYS File Object
In this example, the job completes when any file object with a file name that starts with PAY and ends with any characters is created in the QSYS file system. Note that the file name is enclosed in single quotation marks so that the text following /* is not interpreted as a comment.
AGENT I5AGENT FILENAME 'LIB/PAY*/*FILE' CREATE
Example: Monitor the Size of a QSYS File Object
In this example, the job completes when the EXPOBJ file object in the QSYS file system increases by 10 bytes or more. Since no member is specified in the file name, the job monitors the entire object size. The entire object size includes the size of the file object itself and the total size of the file object’s members.
AGENT I5AGENT FILENAME 'LIB/EXPOBJ/*FILE' EXPAND SIZE(10)
Notes:
Example: Monitor the Same File Using Multiple File Trigger Jobs
In this example, two File Trigger jobs monitor the same file for a change in size by 10 KB and trigger the same alert. One job monitors for an increased change in size and the other job monitors for a decreased change in size. The jobs are independent and do not relate to each other in any way.
AGENT NT_TOR FILENAME c:\data\totals EXPAND DELTA(10K) CONTINUOUS(MGMT)
AGENT NT_TOR FILENAME c:\data\totals SHRINK DELTA(10K) CONTINUOUS(MGMT)
Suppose that the initial file size of totals (c:\data\totals) is 100 KB and it changes as follows:
80 KB, 90 KB, 110 KB, 50 KB, 60 KB
The following triggers occur:
|
Copyright © 2013 CA Technologies.
All rights reserved.
|
|