X
X
Xaber2017-01-17 08:44:17
linux
Xaber, 2017-01-17 08:44:17

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

2 answer(s)
C
CityCat4, 2017-01-17
@Xaber

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

S
sim3x, 2017-01-17
@sim3x

unix.stackexchange.com/questions/15348/writing-base...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question