This plugin provides native process instrumentation for monitoring and metrics collection, including: process status, uptime, thread count, and others.
This script should assume that the pid file location provided by the admin should be correct and ALWAYS present. The absence of this pid file should be interpreted as the process is no longer functioning as intended. In it's current form, this script will only catch instances in which the application crashed or exited improperly resulting in the pid file being left behind and not cleaned up. It's my belief that if the application is shutdown gracefully (pid file being removed), it should still result in a CRITICAL state since the application is no longer running. I understand that, technically, providing only the expected pid is not enough information to to actually determine without doubt whether or not the process is running or not, hence the UNKNOWN state. However, if the application is providing a pid, we should trust it and alert critical in it's absence, or at least provide another switch which behaves in this manner.
GRACEFUL SHUTDOWN
systemctl stop monit
/opt/sensu/embedded/bin/check-process.rb -f /var/run/monit.pid
CheckProcess UNKNOWN: Could not read pid file /var/run/monit.pid
This script should assume that the pid file location provided by the admin should be correct and ALWAYS present. The absence of this pid file should be interpreted as the process is no longer functioning as intended. In it's current form, this script will only catch instances in which the application crashed or exited improperly resulting in the pid file being left behind and not cleaned up. It's my belief that if the application is shutdown gracefully (pid file being removed), it should still result in a CRITICAL state since the application is no longer running. I understand that, technically, providing only the expected pid is not enough information to to actually determine without doubt whether or not the process is running or not, hence the UNKNOWN state. However, if the application is providing a pid, we should trust it and alert critical in it's absence, or at least provide another switch which behaves in this manner.
GRACEFUL SHUTDOWN
FORCED SHUTDOWN/CRASH