mirror of https://github.com/Icinga/icinga2.git
parent
1d0a1564d9
commit
185f9b4080
|
@ -143,7 +143,7 @@ void ObjectListCommand::PrintObject(std::ostream& fp, bool& first, const String&
|
|||
fp << "Object '";
|
||||
|
||||
fp << ConsoleColorTag(Console_ForegroundBlue | Console_Bold) << internal_name << ConsoleColorTag(Console_Normal) << "'";
|
||||
fp << " of type '" << ConsoleColorTag(Console_ForegroundBlue | Console_Bold) << type << ConsoleColorTag(Console_Normal) << "':\n";
|
||||
fp << " of type '" << ConsoleColorTag(Console_ForegroundMagenta | Console_Bold) << type << ConsoleColorTag(Console_Normal) << "':\n";
|
||||
|
||||
PrintProperties(fp, properties, debug_hints, 2);
|
||||
|
||||
|
|
|
@ -133,12 +133,32 @@ void RepositoryUtility::PrintObjects(std::ostream& fp, const String& type)
|
|||
continue;
|
||||
}
|
||||
|
||||
fp << "Object Path: " << object << "\n";
|
||||
String file = Utility::BaseName(object);
|
||||
boost::algorithm::replace_all(file, ".conf", "");
|
||||
|
||||
fp << ConsoleColorTag(Console_ForegroundMagenta | Console_Bold) << type << ConsoleColorTag(Console_Normal)
|
||||
<< " '" << ConsoleColorTag(Console_ForegroundBlue | Console_Bold) << file << ConsoleColorTag(Console_Normal) << "'";
|
||||
|
||||
String prefix = Utility::DirName(object);
|
||||
|
||||
if (type == "Service") {
|
||||
std::vector<String> tokens;
|
||||
boost::algorithm::split(tokens, prefix, boost::is_any_of("/"));
|
||||
|
||||
String host_name = tokens[tokens.size()-1];
|
||||
fp << " (on " << ConsoleColorTag(Console_ForegroundMagenta | Console_Bold) << "Host" << ConsoleColorTag(Console_Normal)
|
||||
<< " '" << ConsoleColorTag(Console_ForegroundBlue | Console_Bold) << host_name << ConsoleColorTag(Console_Normal) << "')";
|
||||
|
||||
}
|
||||
|
||||
fp << "\n";
|
||||
|
||||
/*
|
||||
Dictionary::Ptr obj = GetObjectFromRepository(object); //TODO: config parser not implemented yet!
|
||||
|
||||
if (obj)
|
||||
fp << JsonEncode(obj);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue