/**
- * Updating service for the first time.
- * @param hostname Hostname
- * @param ip_dns_recheck Cached DNS entry
- * @param ip_host Hosts IP
- */
-void Logger::print_update_service_firttime(const string& hostname, const string& ip_dns_recheck, const string& ip_host) const
-{
- int level = 1;
- if ( level <= Loglevel )
- {
- ostringstream msg;
- msg << "Updating service for the first time. Hostname: " << hostname << " DNS-Record: " << ip_dns_recheck << " Hosts IP: " << ip_host << endl;
- log_notice(msg.str());
- }
-}
-
-
-/**
* Updating service
* @param hostname Hostname
* @param ip_dns_recheck Cached DNS entry
void print_cached_dns_entry(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_last_update, const std::string& ip_host) const;
- void print_update_service_firttime(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_host) const;
-
void print_update_service(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_update_service_ttl_expired(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 int dns_cache_ttl, const time_t current_time) const;
continue;
}
- // Check if the service will be updated for the first time.
- if ( lastupdated == 0 )
- {
- // Update for the firt time.
- Log->print_update_service_firttime(hostname, ip_dns_recheck, ip_host);
- service->update(ip_host,current_time);
-
- // Update done, go to next service
- continue;
- }
-
// We already have updated, check if the IP set in last update differs from the actual host's ip.
if ( ip_last_update != ip_host )
{