This is an actual sample. I would say, that contrarily to the other examples that were designed for showing the way Kazimir's works, this
one is an event I really use on my machines. The context is as follows: I have a process (in my example, the binary is called 'toto'2.7 and it should be restarted when it crashed. Its path is /usr/local/bin/toto.
What the following configuration file does is making kazimir use 'ps -edf | grep toto | grep -v grep' periodically. If a process named toto
exists, I will see it that way, if no such process exists, when the output will be totally blank. A pattern is defined to keep track on the
last time the process 'toto' was seen in the output of the 'ps' command. It is then use to defined an event, but on a negative way: event is
realized when the pattern could not be found in the event window time, which means the process was not up in this interval.
An action is correlated to this action, it re-spawns the process, making that way the pattern be realized and.
On this example, I use explicitly 'NONE' as TimeFormat. I have said in this document to avoid using this format, but here it is pretty well
adapted there, because 'ps' provides only an 'instant view' on the existing process, but nothing about the past processes, no there is no danger
to identify a past information as up to date.
For testing this create a binary 'toto' (during my test is was just a test who ran a 'sleep 5000'). Then run kazimir and look at the log.
Then try to kill toto and see how kazimir restart it.
On this example, I have used very short Update value and window time value. They are clearly too short, but they fit well for a demo. So if
you want to use a similar event and pattern, use a longer 'UpdateInt' for the PsEdf Log and a longer window size for the event.