mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
parent
2a761fb285
commit
52d2066995
@ -112,8 +112,9 @@ String PerfdataValue::Format(const Value& perfdata)
|
|||||||
{
|
{
|
||||||
if (perfdata.IsObjectType<PerfdataValue>()) {
|
if (perfdata.IsObjectType<PerfdataValue>()) {
|
||||||
PerfdataValue::Ptr pdv = perfdata;
|
PerfdataValue::Ptr pdv = perfdata;
|
||||||
|
std::ostringstream result;
|
||||||
|
|
||||||
String output = Convert::ToString(pdv->GetValue());
|
result << pdv->GetValue();
|
||||||
|
|
||||||
String unit;
|
String unit;
|
||||||
|
|
||||||
@ -126,25 +127,25 @@ String PerfdataValue::Format(const Value& perfdata)
|
|||||||
else if (pdv->GetUnit() == "bytes")
|
else if (pdv->GetUnit() == "bytes")
|
||||||
unit = "B";
|
unit = "B";
|
||||||
|
|
||||||
output += unit;
|
result << unit;
|
||||||
|
|
||||||
if (!pdv->GetWarn().IsEmpty()) {
|
if (!pdv->GetWarn().IsEmpty()) {
|
||||||
output += ";" + pdv->GetWarn();
|
result << ";" << pdv->GetWarn();
|
||||||
|
|
||||||
if (!pdv->GetCrit().IsEmpty()) {
|
if (!pdv->GetCrit().IsEmpty()) {
|
||||||
output += ";" + pdv->GetCrit();
|
result << ";" << pdv->GetCrit();
|
||||||
|
|
||||||
if (!pdv->GetMin().IsEmpty()) {
|
if (!pdv->GetMin().IsEmpty()) {
|
||||||
output += ";" + pdv->GetMin();
|
result << ";" << pdv->GetMin();
|
||||||
|
|
||||||
if (!pdv->GetMax().IsEmpty()) {
|
if (!pdv->GetMax().IsEmpty()) {
|
||||||
output += ";" + pdv->GetMax();
|
result << ";" << pdv->GetMax();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return output;
|
return result.str();
|
||||||
} else {
|
} else {
|
||||||
return perfdata;
|
return perfdata;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user