Comments (3)
Fixed in the main branch via commit 224b1e5
from nagios-plugins.
I don't believe this is a bug, although I would agree it could be documented better.
-s is for checking strings within the content section
-d is for checking strings within the headers
-e is for checking from status down.
I wrote a really simple app to receive the http request and returns "HTTP/1.0 200 ok\n\r\n\rOK!!! $date\0". Using -s does fail to match the string as there is no content section, -d does work properly for checking OK but not ok, as expected. Please let me know if you see anything different, but I believe that is all the changes you should need.
from nagios-plugins.
I'm not sure I follow your response. In your test return, shouldn't \n\r\n\r be \r\n\r\n ?
Please could you post the output of check_http when using -s together with -v? I would be very interested to see whether the 'OK!!! $date\0" is reported in the "**** HEADER *_" or "_* CONTENT ****" section. This is the behaviour I'm querying. I have no reason to believe that -s, -d or -e work incorrectly but I do suspect that check_http is incorrectly parsing the http response when deciding which bit is the status line, headers & content sections.
An easy way to reproduce, in one terminal:
nc -l 12345
and in the second:
check_http -H localhost -p 12345 -v
then in the first, paste:
HTTP/1.0 200 OK
OK!!!
(with a few hits of the return key that i can't manage to show in markdown) before control+c'ing.
In the second, I see:
GET / HTTP/1.1
User-Agent: check_http/v1.4.16 (nagios-plugins 1.4.16)
Connection: close
Host: localhost:12345http://localhost:12345/ is 24 characters
STATUS: HTTP/1.0 200 OK
**** HEADER ****
OK!!!
**** CONTENT ****HTTP OK: HTTP/1.0 200 OK - 24 bytes in 3.933 second response time |time=3.932539s;;;0.000000 size=24B;;;0
and I think that the 'OK!!!' in the HEADER section should actually be in the CONTENT section?
Or am I producing an invalid http response?
from nagios-plugins.
Related Issues (20)
- check_dig: -T soa broken as of version 2.4.3 HOT 12
- check_ssl_validity and 0 days warning or critical
- check_snmp: broken parse for hrSystemUptime HOT 1
- check_snmp issue on release-2.4.7: No valid data returned HOT 21
- Inconsistent release archive url under GitHub release page HOT 1
- check_snmp issue on release-2.4.8: No valid data returned (28) HOT 1
- check_mysql returns SSL connection error: unknown error HOT 1
- check_mailq with mailscanner HOT 29
- PS_COMMAND undeclared in rockylinux 9 build HOT 1
- check_http multiple regex logical AND HOT 1
- check_http does not support post-hostshake authentication with TLS 1.3
- nagios-plugins-ssl_validity missing dependency RHEL 7 HOT 1
- check_dig: 2.4.8 broke monitoring of the root zone (.)
- check_dig: 2.4.8 not checking for record type in the answer
- check_icmp does not handle duplicates well/correctly
- check_dig 2.4.8 not using quotes for TXT record
- check_snmp 2.4.8 shows "No valid data returned" while warnging/crirital range was set HOT 2
- Command line option --continue-after-certificate causes confusing output if certificate is about to expire
- check_mysql not working with mysql 8.4.0 LTS HOT 2
- check_disk -L or --stat-remote-fs returns Disk Unknown for nfs and cifs filesystems. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nagios-plugins.