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..

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.

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.


On 08/30/2010 02:20 PM, Mirza Dedic wrote:
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: The tool that I run locally on the AIX host to check our servers outputs the following:
#asbman --name production --query
PID   State     Port  nRq    nRcvd  nSent  Started          Last Change
2175264 AVAILABLE 15614 006968 007643 008661 Aug 29, 2010 19:03 Aug 30, 2010 11:16 922080 AVAILABLE 15616 002675 002970 003465 Aug 30, 2010 09:22 Aug 30, 2010 11:16 483832 AVAILABLE 15607 001740 001939 002204 Aug 30, 2010 10:02 Aug 30, 2010 11:16 2936902 AVAILABLE 15620 001753 001955 002236 Aug 30, 2010 10:02 Aug 30, 2010 11:16 3658058 AVAILABLE 15623 001742 001921 002190 Aug 30, 2010 10:02 Aug 30, 2010 11:16 3027394 AVAILABLE 15608 001297 001377 001493 Aug 30, 2010 10:21 Aug 30, 2010 11:16 *3965150 *_*SENDING*_* ** 15611 001290 001352 001465 Aug 30, *_*2010 10:21 Aug 30, 2010 *__*06*__*:*__*12*_* * 4186168 AVAILABLE 15615 001300 001379 001549 Aug 30, 2010 10:21 Aug 30, 2010 11:16 2044322 AVAILABLE 15617 001298 001369 001558 Aug 30, 2010 10:21 Aug 30, 2010 11:16 I would want Nagios to raise an alert if State = SENDING for more than 6 hours (Last Change)? Would this be possible?
Anyone have an idea of how I would do this?
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.
Any help on this is appreciated.
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.



------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd


_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue.
::: Messages without supporting info will risk being sent to /dev/null

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Reply via email to