icinga2/dyntest/dyntest.cpp

30 lines
713 B
C++
Raw Normal View History

2012-05-31 10:16:32 +02:00
#include <i2-dyn.h>
//#include <i2-jsonrpc.h>
2012-05-30 10:43:58 +02:00
using namespace icinga;
int main(int argc, char **argv)
{
if (argc < 2) {
cout << "Syntax: " << argv[0] << " <filename>" << endl;
return 1;
}
2012-06-11 08:21:47 +02:00
for (int i = 0; i < 1; i++) {
vector<ConfigItem::Ptr> objects = ConfigCompiler::CompileFile(string(argv[1]));
ConfigVM::ExecuteItems(objects);
}
2012-06-11 08:21:47 +02:00
/* ObjectSet<DynamicObject::Ptr>::Iterator it;
for (it = DynamicObject::GetAllObjects()->Begin(); it != DynamicObject::GetAllObjects()->End(); it++) {
DynamicObject::Ptr obj = *it;
cout << "Object, name: " << obj->GetName() << ", type: " << obj->GetType() << endl;
MessagePart mp(obj->GetConfig());
cout << mp.ToJsonString() << endl;
}
2012-06-11 08:21:47 +02:00
*/
2012-05-30 10:43:58 +02:00
return 0;
}