when specifying a directory with -s to store the state file, the check naively assumes that there is only a single check against the given file.
If you are monitoring /var/log/nginx/access.log for instances of http_status=502 and specify -s /tmp, then a state file containing the last scanned line number gets created as /tmp/var/log/nginx/access.log.
The problem comes when you attempt to create a second check, say for instances of http_status=503 and specify the same -s /tmp directory. the two checks will end up clobbering the other's files, and detection of the regex match will be inconsistent and unreliable.
Perhaps the file's contents should contain the check name as well, i.e. /tmp/var/log/nginx/access.log should contain two lines, such as:
check_http_502:80105
check_http_503:79940
when specifying a directory with
-sto store the state file, the check naively assumes that there is only a single check against the given file.If you are monitoring
/var/log/nginx/access.logfor instances ofhttp_status=502and specify-s /tmp, then a state file containing the last scanned line number gets created as/tmp/var/log/nginx/access.log.The problem comes when you attempt to create a second check, say for instances of
http_status=503and specify the same-s /tmpdirectory. the two checks will end up clobbering the other's files, and detection of the regex match will be inconsistent and unreliable.Perhaps the file's contents should contain the check name as well, i.e.
/tmp/var/log/nginx/access.logshould contain two lines, such as:check_http_502:80105check_http_503:79940