Configuring the Interface Profile
An interface profile specifies the information collected and written to a log file. You can configure a profile to collect error and statistic information for input and output packets on a particular physical or logical interface.
To configure an interface profile, include the interface-profile statement at the [edit accounting-options] hierarchy level:
Each accounting profile must have a unique profile-name. To apply a profile to a physical or logical interface, include the accounting-profile statement at either the [edit interfaces interface-name] or the [edit interfaces interface-name unit logical-unit-number] hierarchy level. You can also apply a accounting profile at the [edit firewall family family-type filter filter-name] hierarchy level. For more information, see the Junos Policy Framework Configuration Guide.
To configure an interface profile, you perform the tasks described in the following sections:
- Configuring Fields
- Configuring the File Information
- Configuring the Interval
- Example: Configuring the Interface Profile
Configuring Fields
An interface profile must specify what statistics are collected. To configure which statistics should be collected for an interface, include the fields statement at the [edit accounting-options interface-profile profile-name] hierarchy level:
Configuring the File Information
Each accounting profile logs its statistics to a file in the /var/log directory.
To configure which file to use, include the file statement at the [edit accounting-options interface-profile profile-name] hierarchy level:
You must specify a file statement for the interface profile that has already been configured at the [edit accounting-options] hierarchy level.
Configuring the Interval
Each interface with an accounting profile enabled has statistics collected once per interval time specified for the accounting profile. Statistics collection time is scheduled evenly over the configured interval. To configure the interval, include the interval statement at the [edit accounting-options interface-profile profile-name] hierarchy level:
![]() | Note: The minimum interval allowed is 1 minute. Configuring a low interval in an accounting profile for a large number of interfaces might cause serious performance degradation. |
The range for the interval statement is 1 through 2880 minutes. The default is 30 minutes.
Example: Configuring the Interface Profile
Configure the interface profile:
The two interface profiles, if-profile1 and if-profile2, write data to the same file, if-stats. The if-stats file might look like the following:
#FILE CREATED 976823478 2000-12-14-19:51:18 #hostname host #profile-layout if_profile2,epoch-timestamp,interface-name,snmp-index,input-bytes,output-bytes, input-packets,output-packets,input-multicast,output-multicast #profile-layout if_profile1,epoch-timestamp,interface-name,snmp-index,input-bytes,output-bytes, input-packets if_profile2,976823538,xe-1/0/0.0,8,134696815,3681534,501088,40723,0,0 if_profile1,976823538,xe-1/0/0,7,134696815,3681534,501088 ... #FILE CLOSED 976824378 2000-12-14-20:06:18