if symbol_strict then
local r = recvh[1]
-- Unresolved host
- if not r['real_hostname'] or r['real_hostname'] == 'unknown' or string.match(r['real_hostname'], '(%d+)\.(%d+)\.(%d+)\.(%d+)') then
+ if not r['real_hostname'] or r['real_hostname'] == 'unknown' or string.match(r['real_hostname'], '^%d+%.%d+%.%d+%.%d+$') then
task:insert_result(metric, symbol_strict, 1)
end
local i = true
function dns_cb(task, to_resolve, results, err)
if results then
- local _,_,rbl = string.find(to_resolve, '%d+\.%d+\.%d+\.%d+\.(.+)')
+ local _,_,rbl = string.find(to_resolve, '%d+%.%d+%.%d+%.%d+%.(.+)')
task:insert_result(metric, symbol, 1, rbl)
end
end
for _,rh in ipairs(recvh) do
for k,v in pairs(rh) do
if k == 'real_ip' then
- local _,_,o1,o2,o3,o4 = string.find(v, '(%d+)\.(%d+)\.(%d+)\.(%d+)')
+ local _,_,o1,o2,o3,o4 = string.find(v, '(%d+)%.(%d+)%.(%d+)%.(%d+)')
for _,rbl in ipairs(rbls) do
rbl_str = o4 .. '.' .. o3 .. '.' .. o2 .. '.' .. o1 .. '.' .. rbl
task:resolve_dns_a(rbl_str, 'dns_cb')