Page 1 of 1

check_http socket timed out

Posted: Wed Feb 23, 2022 3:10 am
by netanelp
Hey guys,
I've started having a weird issue with my Nagios plugin check_http getting 'socket timed out'.
When running the plugin/check it sometimes works and other times times out, even in a matter or running the check > getting timed out and re running it getting a good response. As I'm using nginx in this server i've also extracted the access.log for my requests.
Things suggested i've tried:
- Increasing the timeout of the plugin (-t 30 seconds even)
- Skipping content (-N )
- Completely taking the machine offline(clone) and checking there - same results

First request - timed out
Command:

Code: Select all

$ /usr/local/nagios/libexec/check_http -H 127.0.0.1 -u "/574ec9eb97ff8fc41ca47991.jpg" -p 80 --verbose
GET /574ec9eb97ff8fc41ca47991.jpg HTTP/1.1
User-Agent: check_http/v1.5 (nagios-plugins 1.5)
Connection: close
Host: 127.0.0.1


CRITICAL - Socket timeout after 10 seconds
Answer:

Code: Select all

127.0.0.1 - - [23/Feb/2022:07:28:46 +0000] "GET /574ec9eb97ff8fc41ca47991.jpg HTTP/1.1" 499 60.026 0 "-" "check_http/v1.5 (nagios-plugins 1.5)" "-"
Second request - success

Code: Select all

$ /usr/local/nagios/libexec/check_http -H 127.0.0.1 -u "/574ec9eb97ff8fc41ca47991.jpg" -p 80 --verbose
GET /574ec9eb97ff8fc41ca47991.jpg HTTP/1.1
User-Agent: check_http/v1.5 (nagios-plugins 1.5)
Connection: close
Host: 127.0.0.1


http://127.0.0.1:80/574ec9eb97ff8fc41ca47991.jpg is 29580 characters
STATUS: HTTP/1.1 200 OK
**** HEADER ****
Server: nginx/1.9.12
Date: Wed, 23 Feb 2022 07:36:13 GMT
Content-Type: image/jpeg
Content-Length: 29138
Connection: close
Access-Control-Allow-Origin: https://XXXURL.COM
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,PATCH,OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Expires: Fri, 25 Mar 2022 07:36:13 GMT
Cache-Control: max-age=2592000
X-Proxy-Cache: UPDATING
Cache-Control: public
**** CONTENT ****
��)%�%[7p~J�7�l�A�X�8}{�ك�������|/��E�tn��!��6N�B�-% �0�H���4���U�
ӌ^�.?�eX�^_x�!D���CA!m�����D��?8\r����,��]CղVy�'-�����P`\-A/1�F�     9�Az�栏6�-�ﺂ[wڂRO�A��w�I@��#�<~���^K;��vZ��m6���%��s�5���g 7��1--�qζ��'�jJ9W�嵪�^"�n��:s�|�O���7Y��
                                                                               �(q^�)^>iW/([^&���֌s'�u�M�:��̜��@�U�\     ȡ���J�����v�`Xވc���I����{�$�E�%��I#�����w�A�PSN�>��e�dt�v��KYV+5���_r�w�#��݅Py+BtkK��WuQ�M-�w��>
�_�e��f�ݗHU����M8
                  z��u�vs:�S�D�C���O�\�X�}|�i��N�s�P        N/
�X�R��B��fSHM���
������
�3d�j3�<9�-\���i��?��m䱚��̆��`�Sb<v��X�������y�$��
                                                      '�
                                                        �;��>��:M�5�S3Zu�g��ŀ1�p[�乙��)$,�l,�p s�G��(ڿT�
    v
&ZF�λ�ۜr0 5���^�1�|����!�吷
HTTP OK: HTTP/1.1 200 OK - 29580 bytes in 0.001 second response time |time=0.000903s;;;0.000000 size=29580B;;;0
Answer:

Code: Select all

127.0.0.1 - - [23/Feb/2022:07:28:21 +0000] "GET /574ec9eb97ff8fc41ca47991.jpg HTTP/1.1" 200 0.000 29138 "-" "check_http/v1.5 (nagios-plugins 1.5)" "-"
As you can see the tests are being done from the machine itself so i've ruled out network issues.

Thanks!

Re: check_http socket timed out

Posted: Sun Feb 27, 2022 2:13 am
by netanelp
bump