本文整理汇总了C++中Oam::getEC2VolumeStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ Oam::getEC2VolumeStatus方法的具体用法?C++ Oam::getEC2VolumeStatus怎么用?C++ Oam::getEC2VolumeStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oam
的用法示例。
在下文中一共展示了Oam::getEC2VolumeStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: diskMonitor
//.........这里部分代码省略.........
//get dbroot name
string::size_type pos = dbrootDir.rfind("/",80);
if (pos != string::npos)
dbrootName = dbrootDir.substr(pos+1,80);
//get ID
dbrootID = dbrootName.substr(4,80);
string fileName = dbrootDir + "/OAMdbrootCheck";
// retry in case we hit the remount window
for ( int retry = 0 ; ; retry++ )
{
bool fail = false;
//first test, check if OAMdbrootCheck exists
ifstream file (fileName.c_str());
if (!file)
fail = true;
else
{ //second test for amazon, check volume status
if ( cloud != oam::UnassignedName ) {
string volumeNameID = "PMVolumeName" + dbrootID;
string volumeName = oam::UnassignedName;
try {
oam.getSystemConfig( volumeNameID, volumeName);
}
catch(...)
{}
if ( volumeName.empty() || volumeName == oam::UnassignedName )
fail = false;
else
{
string status = oam.getEC2VolumeStatus(volumeName);
if ( status == "attached" )
fail = false;
else
{
fail = true;
LoggingID lid(SERVER_MONITOR_LOG_ID);
MessageLog ml(lid);
Message msg;
Message::Args args;
args.add("dbroot monitoring: Volume not attached");
args.add(volumeName);
args.add("/");
args.add(dbrootName);
msg.format(args);
ml.logCriticalMessage(msg);
}
}
}
else
fail = false;
}
if (fail) {
//double check system status before reporting any error BUG 5078
SystemStatus systemstatus;
try {
oam.getSystemStatus(systemstatus);
}
catch (exception& ex)
{}
if (systemstatus.SystemOpState != oam::ACTIVE ) {