riker1
riker1

Reputation: 1

Monit Measure Responsetime for http requests wrong status speed failed by responsetime < limit

using Monit to monitor http response and responsetime

strangewise monit shows speed failed even responsetime is lower than limit.

monit status: Speed failed Port response time 158.118 ms to 127.0.0.1:8086/fhem?detail=monit_test type TCP/IP protocol HTTP

Port If failed [127.0.0.1]:8086/fhem?detail=monit_test type TCP/IP protocol HTTP with timeout 4 s and responsetime equal to 500 ms then alert

so I am confused why status is failed.

also wonding about the message port: ...saying responsetime equal....

config file is like `check process fhemPort8086RT with pidfile /opt/fhem/fhem.pid

if failed host 127.0.0.1 port 8086 protocol http request "/fhem?detail=monit_test"
responsetime 500 ms timeout 4 seconds then alert`

what am I missing?

did not find anythin in manual about responsetime using <

I would expect a correct status

as responsetime is lower than limit set

update: I also added another check with responsetime < 1s.

monit status showing

Port response time  315.675 ms to 127.0.0.1:8086/fhem?detail=monit_test type TCP/IP protocol HTTP

Data collected Thu, 05 Oct 2023 16:38:25 Existence If doesn't exist then restart Port If failed [127.0.0.1]:8086/fhem?detail=monit_test type TCP/IP protocol HTTP with timeout 4 s and responsetime less than 1 s then alert

Now I am seeing a more locial port message responsetime less, but even condition is fulfilled, overall status is : speed error.

Upvotes: 0

Views: 71

Answers (1)

lutzmad
lutzmad

Reputation: 389

A suggestion only.

also wonding about the message port: ...saying responsetime equal....

You can see some additional information about the used/defined rules by using "monit -t -vv" to test your configuration and show the internal information also.

Based on your check, "responsetime 500 ms timeout 4 seconds then alert" is translated to "with timeout 4 s and responsetime equal to 500 ms then alert".

From my understanding you are interesing in defining something like "with timeout 4 s and responsetime greater than 500 ms then alert" therefore you should use "responsetime > 500 ms with timeout 4 seconds then alert".

Based on your modified definition you use "with timeout 4 s and responsetime less than 500 ms then alert", you send an alert if the timeout is below 500ms but you will get an alert if the response time is above 500ms, I think.

Upvotes: 0

Related Questions