X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/78bad7b5d52407128d5069cb4003f7d6d0d10dd1..4421aa6a60965483085dbb95d969a1674434126a:/projects/stargazer/plugins/other/snmp/sensors.cpp diff --git a/projects/stargazer/plugins/other/snmp/sensors.cpp b/projects/stargazer/plugins/other/snmp/sensors.cpp index a9f8efc7..57fec93d 100644 --- a/projects/stargazer/plugins/other/snmp/sensors.cpp +++ b/projects/stargazer/plugins/other/snmp/sensors.cpp @@ -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; +}