Configuring Service Diagnosis
Context
Service diagnosis affects system performance. Therefore, enable service diagnosis only when fault locating is required. After locating faults, immediately run the undo trace enable command to disable service diagnosis.
You can create diagnosis objects based on user attributes, which vary according to services.
- DHCP service: based on the MAC address.
- AAA and NAC services: based on the MAC address, IP address, user name, user VLAN ID, access mode, or interface number.
The configurations of the trace enable, trace object duration threshold, trace object output syslog-server, trace object process enable, and trace syslog source commands are not recorded in the configuration file. Therefore, run these commands again to make the corresponding functions take effect.
Procedure
- Run system-view
The system view is displayed.
- Run trace enable [ brief ]
Service diagnosis is enabled.
By default, service diagnosis is disabled.- The trace enable brief command configures the device to export brief service diagnosis information.
- The trace enable command configures the device to export detailed service diagnosis information.
- Run trace object { mac-address mac-address | ip-address ip-address [ vpn-instance vpn-instance-name ] | interface interface-type interface-number | user-vlan user-vlan-id [ qinq-vlan qinq-vlan-id ] | user-name user-name | access-mode { dot1x | mac-authen | portal | wlan } } * [ slot slot-id | process-wlan ] [ slot slot-id ] [ output { command-line | file file-name | syslog-server syslog-server-ip } ]
A diagnosis object is created.
By default, no diagnosis object is created. If you do not specify the direction at which information is exported, the default direction is the CLI.
It is recommended that you export the diagnosis information to a specified file.
The diagnosis output file cannot exceed 1 MB. The excessive diagnosis information is not recorded.
- (Optional) Run save trace information
Diagnosis information in the device buffer is saved as a file.
When you specify the device to export diagnosis information as a file, to view real-time diagnosis information, save diagnosis information in the buffer area as a file.
- (Optional) Run trace syslog source interface-type interface-number
An interface is configured for exporting diagnosis information to a log server.
By default, no interface is specified to export diagnosis information to a log server.
When you specify the device to export diagnosis information to a log server, configure an interface for exporting diagnosis information to the log server.
Verifying the Configuration
- Run the display trace information command to view information about service diagnosis.
Run the display trace instance [ instance-start-id [ instance-end-id ] | mac-address mac-address | ip-address ip-address [ vpn-instance vpn-instance-name ] | interface interface-type interface-number | cid cid ] [ slot slot-id | process-wlan ] command to view diagnosis instances on the device.
Run the display trace object [ service-object-id ] [ slot slot-id | process-wlan ] command to view the configuration about a diagnosis object.