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.
Enter:
-
<path_to_wd_diag>/wd_diag [-all]
Where:
-
path_to_wd_diag
Specify the path to wd_diag
-all
Optional. Flag used to generate general system diagnostic information
Example:
-
/usr/local/bin/wd_diag
The above command will create a snapshot of CyFlex diagnostic information
/usr/local/bin/wd_diag -all
The above command will create a snapshot of CyFlex and general system diagnostic information.
If the wd_diag script is part of the PATH then you may run:
wd_diag
Notes:
-
The text files containing snapshots will be placed in subdirectories of the /data/errors/wd_diag directory 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 without the -all argument:
- ms_diag output
- The last 100 errors in the error database
- The latest limit_rpt
- The last 200 lines from the trace file from the main (test) instance of gp_test is collected.
- Last 200 lines of all evnt_rsp trace files currently running
- The following additional information is gathered when the -all argument is specified:
- dumpit output
- Latest timestamp of all CyFlex variables
- Snapshot output of ‘top’ showing CPU and memory usage
- Latest network statistics
- Available memory
- EtherCAT slave and domain information (if relevant)
- Current list of CyFlex processes running
- Last 200 lines of all gp_test trace files currently running
- To install wd_diag, execute the following command:
sudo yum install wd_diag
- 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 '/usr/local/bin/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 /usr/local/bin/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, wd_diag can be execute at the end of the afix script. This would give a snapshot of the system after the script is executed.
- 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.