mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 14:14:45 +02:00
CompatIDO: implement first draft of {en,dis}able objects supported in ido2db 1.8 refs #3157
This commit is contained in:
parent
3c36a3c0fb
commit
1b0a482742
@ -243,6 +243,71 @@ void CompatIdoComponent::EndConfigDump(void)
|
|||||||
m_IdoSocket->SendMessage(message.str());
|
m_IdoSocket->SendMessage(message.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enables host config object in ido
|
||||||
|
*/
|
||||||
|
void CompatIdoComponent::EnableHostObject(const Host::Ptr& host)
|
||||||
|
{
|
||||||
|
stringstream message;
|
||||||
|
message << "\n"
|
||||||
|
<< 500 << ":" << "\n" /* enableobject */
|
||||||
|
<< 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */
|
||||||
|
<< 53 << "=" << host->GetName() << "\n" /* host */
|
||||||
|
<< 999 << "\n\n"; /* enddata */
|
||||||
|
|
||||||
|
m_IdoSocket->SendMessage(message.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enables service config object in ido
|
||||||
|
*/
|
||||||
|
void CompatIdoComponent::EnableServiceObject(const Service::Ptr& service)
|
||||||
|
{
|
||||||
|
stringstream message;
|
||||||
|
message << "\n"
|
||||||
|
<< 500 << ":" << "\n" /* enableobject */
|
||||||
|
<< 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */
|
||||||
|
<< 53 << "=" << service->GetHost()->GetName() << "\n" /* host */
|
||||||
|
<< 114 << "=" << service->GetAlias() << "\n" /* service */
|
||||||
|
<< 999 << "\n\n"; /* enddata */
|
||||||
|
|
||||||
|
m_IdoSocket->SendMessage(message.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* disables host config object in ido
|
||||||
|
*/
|
||||||
|
void CompatIdoComponent::DisableHostObject(const Host::Ptr& host)
|
||||||
|
{
|
||||||
|
stringstream message;
|
||||||
|
message << "\n"
|
||||||
|
<< 501 << ":" << "\n" /* disableobject */
|
||||||
|
<< 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */
|
||||||
|
<< 53 << "=" << host->GetName() << "\n" /* host */
|
||||||
|
<< 999 << "\n\n"; /* enddata */
|
||||||
|
|
||||||
|
m_IdoSocket->SendMessage(message.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* disables service config object in ido
|
||||||
|
*/
|
||||||
|
void CompatIdoComponent::DisableServiceObject(const Service::Ptr& service)
|
||||||
|
{
|
||||||
|
stringstream message;
|
||||||
|
message << "\n"
|
||||||
|
<< 501 << ":" << "\n" /* disableobject */
|
||||||
|
<< 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */
|
||||||
|
<< 53 << "=" << service->GetHost()->GetName() << "\n" /* host */
|
||||||
|
<< 114 << "=" << service->GetAlias() << "\n" /* service */
|
||||||
|
<< 999 << "\n\n"; /* enddata */
|
||||||
|
|
||||||
|
m_IdoSocket->SendMessage(message.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dump host config to ido
|
* dump host config to ido
|
||||||
*
|
*
|
||||||
@ -629,6 +694,8 @@ void CompatIdoComponent::DumpConfigObjects(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DumpHostObject(host);
|
DumpHostObject(host);
|
||||||
|
//FIXME remove me, debug only XXX
|
||||||
|
//DisableHostObject(host);
|
||||||
}
|
}
|
||||||
|
|
||||||
pair<String, vector<String > > hgt;
|
pair<String, vector<String > > hgt;
|
||||||
@ -673,6 +740,8 @@ void CompatIdoComponent::DumpConfigObjects(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DumpServiceObject(service);
|
DumpServiceObject(service);
|
||||||
|
//FIXME remove me, debug only XXX
|
||||||
|
//DisableServiceObject(service);
|
||||||
}
|
}
|
||||||
|
|
||||||
pair<String, vector<Service::Ptr> > sgt;
|
pair<String, vector<Service::Ptr> > sgt;
|
||||||
|
@ -53,6 +53,11 @@ private:
|
|||||||
void StartConfigDump(void);
|
void StartConfigDump(void);
|
||||||
void EndConfigDump(void);
|
void EndConfigDump(void);
|
||||||
|
|
||||||
|
void EnableHostObject(const Host::Ptr& host);
|
||||||
|
void EnableServiceObject(const Service::Ptr& service);
|
||||||
|
void DisableHostObject(const Host::Ptr& host);
|
||||||
|
void DisableServiceObject(const Service::Ptr& service);
|
||||||
|
|
||||||
void DumpConfigObjects(void);
|
void DumpConfigObjects(void);
|
||||||
void DumpHostObject(const Host::Ptr& host);
|
void DumpHostObject(const Host::Ptr& host);
|
||||||
void DumpServiceObject(const Service::Ptr& service);
|
void DumpServiceObject(const Service::Ptr& service);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user