wd_diag
Purpose:
-
To create a snapshot of CyFlex tasks, trace files, variable values, last update times, and general system statistics at the time the script is called. This can be used to diagnose watchdog trips, or when a system is locking up if the cause of the lockup is repeatable.
If it doesn’t exist, the following directory is created /data/errors/wd_diag The text files containing snapshots will be placed in subdirectories of this folder named with the current date and timestamp. For example, on July 15, 2022, at 1:04:40 PM the following directory would be created /data/errors/wd_diag/07.15.22_13.04.40
The following information is gathered:
- ms_diag output
- The last 100 errors in the error database
- The latest limit_rpt
- dumpit output
- Latest timestamp of all CyFlex variables
- Snapshot output of ‘top’ showing CPU and memory usage
- Last 200 lines of all gp_test trace files currently running
- Last 200 lines of all evnt_rsp trace files currently running
- Latest network statistics
- Available memory
- EtherCAT slave and domain information (if relevant)
- Current list of CyFlex processes running
Enter:
-
<path_to_wd_diag>/wd_diag
Where:
-
path_to_wd_diag
Specify the path to wd_diag
Example:
-
/cyflex/cmds/wd_diag
If the wd_diag script is part of the PATH then you may run:
wd_diag
Notes:
-
As an example use, if a computer is locking up in mode 44 of HDTranem_main, you could add the following to that mode:
@BACKGROUND #start code command_string kill_option(optional) AT_START '/cyflex/cmds/wd_diag' NONE
This would then take a system snapshot when you enter this mode.
Another example is if you are diagnosing watchdog trips and you have a digital input reading the watchdog PLC status which triggers an event called e_watchdog_tripped, then in your er_specs file you could add:
@INPUT_EVENT e_watchdog_tripped @SCRIPT /cyflex/cmds/wd_diag @END
And this would cause the script to execute at the time your watchdog PLC trips. Similarly, the script could be tied to abort_limit.
Another example, if afix causes a watchdog trip or your system to lock up, at the end of your afix script you could put
/cyflex/cmds/wd_diag
And this would give you a snapshot of the system after the afix script is executed.
Lastly, the script can be copied to /specs/cmds and modified by the user to include any additional diagnostic information which may be relevant to the situation you are troubleshooting.