Answer the question
In order to leave comments, you need to log in
How to monitor application activity in Linux?
The application does not provide logs. I don't use it very often, once every few days. And often it turns out to be unloaded. I want to track the approximate frequency with which it completes its work, so that later, through cron, for example, restart it every few hours.
Answer the question
In order to leave comments, you need to log in
Run a primitive checker on cron, which will announce to the log the fact that the application has been restarted, or that it is running. For example, I wrote a cheat for the winbind process a long time ago
entries=`ps -ax | grep winbindd | grep -v grep | wc -l`
if [ $entries -eq 0 ]; then
cd /usr/local/etc/rc.d
samba start
/usr/bin/logger -4 -i -t chkwinbind -p daemon.info Winbindd crash detected, process restarted
else
/usr/bin/logger -4 -i -t chkwinbind -p daemon.info Running $entries winbindd process\(es\)
fi
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question