<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
You will have to write your script in a way that it is able to parse
the date fields in that output and calculate the difference between
that time and the current time..<br>
<br>
Is it possible to have that program output UNIX timestamps instead? If
not, it will require you to get creative with awk, Perl, shell, etc.
scripting to parse the fields properly in order to do the required math
to determine how long it has been in that state.<br>
<br>
Depending on how long that binary takes to run (e.g., if it takes less
than a few seconds), you may not need to have it run separately and
output data to a text file. You may be able to just have your custom
plugin script run it and parse the output directly.<br>
<br>
<br>
On 08/30/2010 02:20 PM, Mirza Dedic wrote:
<blockquote
 cite="mid:CF757435B64CD64798912313712C7B325A3A96ADAC@van-mail01.vand1.oppy.com"
 type="cite">
  <meta http-equiv="Content-Type"
 content="text/html; charset=ISO-8859-1">
  <meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
  <style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style><font
 face="Calibri, sans-serif" size="2">
  <div>I am trying to monitor our OpenEdge Database Application Servers
on our AIX box with Nagios, and to send an alert based on a “tricky”
situation, described below:</div>
  <div> </div>
  <div>The tool that I run locally on the AIX host to check our servers
outputs the following:</div>
  <div> </div>
  <div>#asbman –name production –query</div>
  <div><font face="Courier New, monospace" size="2">PID   State    
Port  nRq    nRcvd  nSent  Started          Last Change      </font></div>
  <div><font face="Courier New, monospace" size="2">2175264 AVAILABLE
15614 006968 007643 008661 Aug 29, 2010 19:03 Aug 30, 2010 11:16 </font></div>
  <div><font face="Courier New, monospace" size="2">922080 AVAILABLE
15616 002675 002970 003465 Aug 30, 2010 09:22 Aug 30, 2010 11:16 </font></div>
  <div><font face="Courier New, monospace" size="2">483832 AVAILABLE
15607 001740 001939 002204 Aug 30, 2010 10:02 Aug 30, 2010 11:16 </font></div>
  <div><font face="Courier New, monospace" size="2">2936902 AVAILABLE
15620 001753 001955 002236 Aug 30, 2010 10:02 Aug 30, 2010 11:16 </font></div>
  <div><font face="Courier New, monospace" size="2">3658058 AVAILABLE
15623 001742 001921 002190 Aug 30, 2010 10:02 Aug 30, 2010 11:16</font></div>
  <div><font face="Courier New, monospace" size="2">3027394 AVAILABLE
15608 001297 001377 001493 Aug 30, 2010 10:21 Aug 30, 2010 11:16 </font></div>
  <div><font face="Courier New, monospace" size="2" color="#c00000"><b>3965150
  </b><u><b>SENDING</b></u><b> </b><b> 15611 001290 001352 001465 Aug
30, </b><u><b>2010 10:21 Aug 30, 2010 </b></u><u><b>06</b></u><u><b>:</b></u><u><b>12</b></u><b>
  </b></font></div>
  <div><font face="Courier New, monospace" size="2">4186168 AVAILABLE
15615 001300 001379 001549 Aug 30, 2010 10:21 Aug 30, 2010 11:16 </font></div>
  <div><font face="Courier New, monospace" size="2">2044322 AVAILABLE
15617 001298 001369 001558 Aug 30, 2010 10:21 Aug 30, 2010 11:16</font></div>
  <div> </div>
  <div>I would want Nagios to raise an alert if State = SENDING for
more than 6 hours (Last Change)? Would this be possible?</div>
  <div> </div>
  <div>Anyone have an idea of how I would do this?</div>
  <div> </div>
  <div>I guess one way would be to make a shell script to output
“asbman –name production –query | grep “SENDING” >> status.txt”
and have a check log type check read it and raise an error if stuff is
found? But it does not exactly implement the “Last Change”
date time idea, we will always have PIDs going from AVAILABLE to
SENDING and back, but those that are stuck in SENDING for 6+ hours is
of concern.</div>
  <div> </div>
  <div>Any help on this is appreciated.</div>
  <div> </div>
  </font>
  <pre>The Oppenheimer Group ---- CONFIDENTIAL

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
<a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/intel-thread-sfd">http://p.sf.net/sfu/intel-thread-sfd</a></pre><pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Nagios-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null</pre></pre>
</blockquote>
<br>
</body>
</html>