]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/snmp/sensors.cpp
tariffChangeUsers param added to the SMUX plugin
[stg.git] / projects / stargazer / plugins / other / snmp / sensors.cpp
index a9f8efc77af4bc9063576fa3801c112e9a237d1a..57fec93dc1da147f9bea1a5328a223567f0266b3 100644 (file)
@@ -192,3 +192,23 @@ users.CloseSearch(handle);
 Int2OS(objectSyntax, count);
 return true;
 }
+
+bool TariffChangeUsersSensor::GetValue(ObjectSyntax_t * objectSyntax)
+{
+int handle = users.OpenSearch();
+if (!handle)
+    return false;
+
+USER_PTR user;
+size_t count = 0;
+while (!users.SearchNext(handle, &user))
+    {
+    if (!user->GetProperty().nextTariff.ConstData().empty())
+        ++count;
+    }
+
+users.CloseSearch(handle);
+
+Int2OS(objectSyntax, count);
+return true;
+}