I'm looking to migrate a monitoring script from Windows (Powershell) to Linux (Shell script). One of the things I check in Windows is whether an application is 'Not Repsonding'. (e.g. Open Task Manager and it says either Running or Not Responding)Is there an equivalent in Linux, and if so, how do I find it? I've been scouring the web, but can't find anything to say how to find them, only what to do when an application is not responding.
How to Find Non-Responding Applications in Linux
debian;monitoring
In linux, processes can be in different states:Running(R): This is a state where a process is either in running or ready to run.Interruptible(S): This state is a blocked state of a process which awaits for an event or a signal from another processUninterruptible(D): It is also a blocked state. The process is forced to halt for certain condition that a hardware status is waited and a signal could not be handled.Stopped(T): Once the process is completed, this state occurs. This process can be restartedZombie(Z): In this state, the process will be terminated and the information will still be available in the process table.You can run ps command and grep for the states. for eg:ps aux | awk '{if ($8 =D) print}'