ANI
ANI

Reputation: 1

How to check port response time by using MONIT

I'm having problems checking my server port 8080 response time. Even when the port don't answer or needs to much time to answer, monit status tells that the port is answering immediately (in 0.000 seconds). This is how I configured monit for this process

check process process_name matching "process_name"
 start program = "/bin/bash -c 'path_to_sh_start.sh'"
 stop program = "/bin/bash -c 'pat_to_sh_stop.sh'"
 if failed port 8080 type tcp with timeout 10 seconds then restart

Upvotes: 0

Views: 1732

Answers (1)

Alex Mazzariol
Alex Mazzariol

Reputation: 2546

The "port with timeout" does not check that your server answers anything, but only that it accepts the connection.

To check for responses, you may use the generic SEND/EXPECT or, if your 8080 port is used for HTTP, specify that protocol and either check for a positive status code (eg. 2xx) or some string to be found in the response.

Upvotes: 1

Related Questions