System Troubleshooting
Saving Core Files Generated by Junos OS Processes
By default, when an internal Junos OS process generates a core file, the file and associated context information are saved for debugging purposes in a compressed tar file named /var/tmp/process-name.core.core-number.tgz. The contextual information includes the configuration and system log message files.
To disable the saving of core files and associated context information:
[edit system] no-saved-core-context;
To save the core files only:
[edit system] saved-core-files number;
Where number is the number of core files to save and can be a value from 1 through 10.
To save the core files along with the contextual information:
[edit system] saved-core-context;
Viewing Core Files from Junos OS Processes
When an internal Junos OS process generates a core file, you can find the output at /var/crash/ and /var/tmp/. For Junos OS Evolved, you can find the output core files at /var/core/ for Routing Engine core files and /var/lib/ftp/in/ for FPC core files. Using these directories provides a quick method of finding core issues across large networks.
Use the CLI command show system core-dumps to view core files.
root@host> show system core-dumps -rw------- 1 root wheel 268369920 Jun 18 17:59 /var/crash/vmcore.0 -rw-rw---- 1 root field 3371008 Jun 18 17:53 /var/tmp/rpd.core.0 -rw-r--r-- 1 root wheel 27775914 Jun 18 17:59 /var/crash/kernel.0
See Also
Collect System-State Counters to Capture Information for System Debugging
You can collect and archive system-state counters on your network device. When you request help from JTAC in debugging an issue on your system, you and your JTAC support team can see what was happening on your system at periodic instances before the system issue occurred.
Network devices that support this feature run a shell script that periodically collects RE, PFE, and SHELL counters and other system-state counters. The counters are either protocol-related or CPU-related. The collected counters are saved in counter.log files in the var/log directory. A counter.info file in the same directory records settings for script-execution parameters.
The counters are written in the counter.log file with
timestamps, which are helpful in the debugging process.
You have two ways to customize the script's execution:
You can change default script-execution parameter values by editing the counter.info file. You must be logged in as
super-userto do this task. See How to Change Script-Execution Parameter Values.You can restart and then later stop the script's execution. Typically you would do this because the counter.info file was deleted or edited. See How to Restart or Stop the Script's Execution.
- What's In the Shell Script and How Does It Run?
- How to Change Script-Execution Parameter Values
- How to Restart or Stop the Script's Execution
What's In the Shell Script and How Does It Run?
Two sets of counters are collected periodically:
-
SET1— This set collects system state for time-sensitive applications periodically at fast intervals of 9 seconds.
-
SET2— This set collects system state periodically at slow intervals of 60 minutes.
The software checks CPU usage before it starts collecting SET1 and SET2 counters. If the software detects high CPU usage (85 percent or more), it does not collect the usually specified counters—instead it collects different counters that make up a smaller set than the set of usually specified counters.
Here's how the script runs:
The shell script starts running 240 seconds after bootup of the network device.
SET1 runs first.
If any command in SET1 doesn't finish in the allotted time, the script truncates the run of that command, saving the CLI output collection to the
counter.logfile and moving on to the next command.When SET1's run is finished, SET2 kicks off. Again, any command not finished in the allotted time is truncated, with the CLI output collection saved to the
counter.logfile and the script moving on to the next line item.If the script run is restarted or stopped during any CLI output collection, the script completes the ongoing CLI output collection and then exits gracefully.
super-user and then edit the
script's execution parameters, including the CLI lists of
SET1 and SET2. See How to Change Script-Execution Parameter Values .How to Change Script-Execution Parameter Values
You can change shell script-execution parameter values—such as
the CLI lists for SET1 and SET2 or the number of log files
to be archived. You must be logged in as super-user
to make changes to the parameter values.
Table 1 lists the parameter settings that you can edit in the counter.info file.
| Setting | Description | Default | Usage Notes |
|---|---|---|---|
| SET1_TIME | Time interval to run SET1 collection of line items, at fast time intervals (in seconds) | 9 seconds | Set to < SET2_TIME |
| SET2_TIME | Time interval to run SET2 collection of line items,at slow time intervals (in seconds) | 3600 seconds | Set to > SET1_TIME |
| MAX_CLI_EXECUTION_TIME | Maximum time interval (in seconds) to wait for the completion of each CLI output collection | 25 seconds | If CLI output collection takes longer than this time, the script terminates that specific CLI output collection and executes the next statement in the script. This behavior ensures that the script executes all statements. |
| SET1_ON | For enabling and disabling fast counter collection | 1 (enable) | |
| SET2_ON | For enabling and disabling slow counter collection | 1 (enable) | |
| LOG_FILE_ARCHIVE_MIN_SIZE | Minimum size of counter.log file to be archived | 1024k | |
| LOG_FILE_ARCHIVE_COUNT | Number of counter.log files to be archived | 10 | |
| VERSION | Version number of the counter.info file |
CAUTION: Do
not update the VERSION value in the
/var/log/counter.infofile.
|
|
| SET1 and SET2 CLI lists of commands that are run in the script | The CLI lists are broken into the following
sublists:
Note: If CPU
utilization is detected as >85%,outputs of CLI
mentioned in RE_CPU, PFE_CPU,and SHELL_CPU are
collected at the intervals of SET1_TIME and
SET2_TIME.
|
Each set comes with a default list of CLI commands. | If the default CLI lists don't provide all the system information you need, edit the CLI lists to obtain counters for the additional system information that you require. |
How to Restart or Stop the Script's Execution
If you make changes in the counter.info
file, use the restart command to
run the script manually:
user@host> request restart system-counter-script
Use the stop command to stop the script's
run:
user@host> request stop system-counter-script