Log->print_service_object("New Service object from command line options:", service->get_protocol(), service->get_hostname(), service->get_login() ,service->get_password(), service->get_update_interval(), service->get_max_updates_within_interval(), service->get_dns_cache_ttl() , service->get_actual_ip(), service->get_last_updates());
}
else
- return -1;
+ {
+ Log->print_invalid_service_config();
+ }
}
else if ( VariablesMap.count("protocol") || VariablesMap.count("host") || VariablesMap.count("login") || VariablesMap.count("password") )
{
ba::split(fqhn_parts,hostname,boost::is_any_of("."));
if ( fqhn_parts.size() < 3 )
{
- Log->print_invalid_hostname(protocol);
+ Log->print_invalid_hostname(hostname);
Service::Ptr service;
return service;
}
Log->print_service_object("New Service object from config:", service->get_protocol(), service->get_hostname(), service->get_login() ,service->get_password(), service->get_update_interval(), service->get_max_updates_within_interval(), service->get_dns_cache_ttl() , service->get_actual_ip(), service->get_last_updates());
}
else
- return -1;
+ {
+ Log->print_invalid_service_config();
+ }
}
else if ( vm.count("protocol") || vm.count("host") || vm.count("login") || vm.count("password") )
{
*/
void Logger::print_caught_sighup() const
{
- int level = 1;
+ int level = 0;
if ( level <= Loglevel )
{
log_notice("Caught SIGHUP. Reloading config...");
*/
void Logger::print_caught_siguser2() const
{
- int level = 1;
+ int level = 0;
if ( level <= Loglevel )
{
log_notice("Caught SIGUSR2. Switching to online mode...");
*/
void Logger::print_caught_sigrtmin() const
{
- int level = 1;
+ int level = 0;
if ( level <= Loglevel )
{
log_notice("Caught SIGRTMIN. Switching to online mode with webcheck enabled...");
*/
void Logger::print_offline_mode() const
{
- int level = 0;
+ int level = 1;
if ( level <= Loglevel )
{
log_notice("Offline mode...");
*/
void Logger::print_ip_is_local(const string& ip) const
{
- int level = 0;
+ int level = 1;
if ( (level <= Loglevel) || ((level <= ExternalWarningLevel) && (!ExternalWarningLog.empty())) )
{
ostringstream msg;
*/
void Logger::print_webcheck_exceed_interval( const time_t last_webcheck, const int webcheck_interval, const time_t current_time ) const
{
- int level = 0;
+ int level = 1;
if ( level <= Loglevel )
{
ostringstream msg;
*/
void Logger::print_no_wan_ip() const
{
- int level = 0;
+ int level = 1;
if ( level <= Loglevel )
{
ostringstream msg;
log_error(msg.str());
}
}
+
+
+/**
+ * Invalid service config was detected.
+ */
+void Logger::print_invalid_service_config() const
+{
+ int level = 0;
+ if ( level <= Loglevel )
+ {
+ log_error("Ignoring invalid service. Please check.\n");
+ }
+}
void print_no_update_needed(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_last_update, const std::string& ip_host, const time_t lastupdated) const;
void print_error_getting_local_wan_ip(const std::string& system_call, const std::string& error) const;
+
+ void print_invalid_service_config() const;
};
#endif