.. _setting-lua-health-checks-expire-delay:
``lua-health-checks-expire-delay``
------------------------------
+----------------------------------
- Integer
- Default: 3600
.. _setting-lua-health-checks-interval:
``lua-health-checks-interval``
------------------------------
+------------------------------
- Integer
- Default: 5
#ifdef HAVE_LUA_RECORDS
::arg().setSwitch("enable-lua-records", "Process LUA records for all zones (metadata overrides this)")="no";
::arg().set("lua-records-exec-limit", "LUA records scripts execution limit (instructions count). Values <= 0 mean no limit")="1000";
- ::arg().set("lua-health-checks-expire-delay", "Stops doing health checks after the record hasn't been unused for that delay (in seconds)")="3600";
+ ::arg().set("lua-health-checks-expire-delay", "Stops doing health checks after the record hasn't been used for that delay (in seconds)")="3600";
::arg().set("lua-health-checks-interval", "LUA records health checks monitoring interval in seconds")="5";
- ::arg().set("lua-health-checks-timeout", "Maximum time in milliseconds that you allow the LUA monitoring health checks to take")="500";
#endif
::arg().setSwitch("axfr-lower-serial", "Also AXFR a zone from a master with a lower serial")="no";
throw std::runtime_error(boost::str(boost::format("unable to match content with `%s`") % cd.opts.at("stringmatch")));
}
if(!status) {
- g_log<<Logger::Warning<<"LUA record monitoring declaring "<<cd.rem.toString()<<" UP for URL "<<cd.url<<"!"<<endl;
+ g_log<<Logger::Info<<"LUA record monitoring declaring "<<cd.rem.toString()<<" UP for URL "<<cd.url<<"!"<<endl;
}
setUp(cd);
}
catch(std::exception& ne) {
if(status || first)
- g_log<<Logger::Warning<<"LUA record monitoring declaring "<<cd.rem.toString()<<" DOWN for URL "<<cd.url<<", error: "<<ne.what()<<endl;
+ g_log<<Logger::Info<<"LUA record monitoring declaring "<<cd.rem.toString()<<" DOWN for URL "<<cd.url<<", error: "<<ne.what()<<endl;
setDown(cd);
}
}
}
s.connect(cd.rem, timeout);
if (!status) {
- g_log<<Logger::Warning<<"Lua record monitoring declaring TCP/IP "<<cd.rem.toStringWithPort()<<" ";
+ g_log<<Logger::Info<<"Lua record monitoring declaring TCP/IP "<<cd.rem.toStringWithPort()<<" ";
if(cd.opts.count("source"))
g_log<<"(source "<<src.toString()<<") ";
g_log<<"UP!"<<endl;
}
catch (const NetworkError& ne) {
if(status || first) {
- g_log<<Logger::Warning<<"Lua record monitoring declaring TCP/IP "<<cd.rem.toStringWithPort()<<" DOWN: "<<ne.what()<<endl;
+ g_log<<Logger::Info<<"Lua record monitoring declaring TCP/IP "<<cd.rem.toStringWithPort()<<" DOWN: "<<ne.what()<<endl;
}
setDown(cd);
}
void setStatus(const CheckDesc& cd, bool status)
{
+ ReadLock lock{&d_lock};
auto& state = d_statuses[cd];
state->status = status;
if (state->first) {
return iter->second->status;
}
}
+ // try to parse options so we don't insert any malformed content
+ if (cd.opts.count("source")) {
+ ComboAddress src(cd.opts.at("source"));
+ }
+ if (cd.opts.count("timeout")) {
+ int timeout = std::atoi(cd.opts.at("timeout").c_str());
+ }
{
WriteLock lock{&d_lock};
// Make sure we don't insert new entry twice now we have the lock
ret.push_back(DNSRecordContent::mastermake(qtype, QClass::IN, content_it ));
}
} catch(std::exception &e) {
- g_log<<Logger::Error<<"Lua record reported: "<<e.what();
+ g_log << Logger::Info << "Lua record reported: " << e.what();
try {
std::rethrow_if_nested(e);
g_log<<endl;