<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<p>
Quoting "Dr. Ed Morbius" <dredmorbius@gmail.com>:<br />
<br />
> Terry:<br />
><br />
> on 23:37 Mon 08 Aug, Terry Carmen (terry@cnysupport.com) wrote:<br />
>> Quoting Edward Morbius <dredmorbius@gmail.com>:<br />
>> ><br />
>> > When some things are going well and others aren't fully up to speed (slow<br />
>> > database), we'll get a "DATABASE_TEST_RAN_LONG", which isn't ideal, but at<br />
>> > least for a few occurances (n <= 5) we can live with. In particular, we<br />
>> > DON'T want a single result sounding off pagers in the middle of the night.<br />
>><br />
>> You can specify -e "OK,DATABASE_TEST_RAN_LONG", then let the plugin<br />
>> decide if it's slow or not, with the -w, -c and -t parameters.<br />
>><br />
>> Terry<br />
><br />
> Thanks.<br />
><br />
> I'd considered that. It doesn't quite match what we want to test. I'm<br />
> thinking we may need to have a few different tests, possibly related to<br />
> one another.<br />
><br />
> If there's a 4xx/5xx error, it's a hard fail.<br />
><br />
> If there's no 4xx/5xx error, but we get the "DATABASE_TEST_RAN_LONG"<br />
> result, it's a soft fail, turning hard on 6 repeats. That string<br />
> appears in our application, it's not a nagios-determined slowness.<br />
> Alternately, we might want to have a separate test for DB performance<br />
> (there may well be, I'm still digging through rules and tests).<br />
><br />
> If there's an "OK" result, there's no error.<br />
><br />
><br />
> The 4xx/5xx errors are exclusive of the other two possible results. If<br />
> there's no 4xx/5xx error, we've got the option of either of the other<br />
> two conditions.<br />
><br />
> So: is this a three-check test? How would I set precedence among them?<br />
<br />
You can actually completely ignore the DATABASE_TEST_RAN_LONG result and let the plugin decide if it ran long or not. That's part of it's design. The plugin also handles the 4xx and 5xx errors.<br />
<br />
However if you insist on using the DATABASE_TEST_RAN_LONG result to determine if the server is happy, then you'll need to modify the plugin to catch the string and interpret it as a WARNING OR CRITICAL as appropriate. Nagios won't notify on it until it happens several times in a row, depending on your specific settings.<br />
<br />
Unless I'm misunderstanding something, The only result that matters is "OK" because everything else is "Not OK", regardless of whether it's a performance issue, an access issue or a server failure. I believe you're unnecessarily complicating the test.<br />
<br />
<br />
</p>
</body>
</html>