<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 22 June 2016 at 02:02, Robert Herron <span dir="ltr"><<a href="mailto:robert.herron@gmail.com" target="_blank">robert.herron@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><p dir="ltr">My Google-fu of the maillist archive is weak and I didn't see anything relevant on Xymonton.</p>
<p dir="ltr">I have a job pool that is restarted weekly via cron if no jobs are running.  I would like to be alerted if its process start time is more than 2 weeks ago.</p>
<p dir="ltr">Is there a native way to alert that a process hasn't has been running too long?  Sort of like the analysis.cfg "UP" check but for a process.</p></blockquote><div>There's nothing out-of-the-box, but the [ps] section of the client data for many systems shows the "STARTED" column, and could be parsed for the start time of your process, such as in a server-side script that did like so:</div><div><br></div><div>$XYMON $XYMSRV "clientlog $HN section=ps"<br></div><div><br></div><div>Example output can be seen here:</div><div><br></div><div><a href="https://www.xymon.org/xymon-cgi/svcstatus.sh?CLIENT=claudio.hswn.dk&section=ps">https://www.xymon.org/xymon-cgi/svcstatus.sh?CLIENT=claudio.hswn.dk&section=ps</a><br></div><div><br></div><div>Note that not all operating systems have the same "ps" output and so this technique might only work for some servers.</div><div><br></div><div>Hmm, my new xymon-procmem utility uses this very technique to alert on memory hogs.  It wouldn't take a lot to have it do the same for start time, although parsing different time/date formats could be challenging to do in an OS-agnostic way (that is, so that it can run on all/most POSIX Xymon servers).</div><div><br></div><div>Cheers</div><div>Jeremy</div><div><br></div></div></div></div>