Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For this item configuration
UserParameter=cb.bucket.quotapercent[*],/usr/bin/curl -s -u $1:$2 http://localhost:8091/pools/$3/buckets | /usr/bin/jq ".[0].basicStats.quotaPercentUsed"
The "quotaPercentUsed" field is calculated with the following couchbase code:
QuotaBytes = ns_bucket:ram_quota(BucketConfig),
Stats = last_bucket_stats(ns_bucket:bucket_type(BucketConfig), BucketName, Nodes),
MemUsed = proplists:get_value(memUsed, Stats),
QuotaPercent = try (MemUsed * 100.0 / QuotaBytes) of
X -> X
catch
error:badarith -> 0
end,
[{quotaPercentUsed, lists:min([QuotaPercent, 100])}
For example, the default bucket:
QuotaBytes = 200 mb = 200000 kb = 200000000 bytes
MemUsed = 61.3 mb = 61300 kb = 61300000 bytes
QuotaPercent = MemUsed * 100.0 / QuotaBytes
= 61300000 * 100 / 200000000
= 6130000000 / 200000000
= 30.65 %
[Item]
[default] Bucket used(percent)
= cb.bucket.quotapercent[{$CBUSERNAME},{$CBPASSWORD},default
= 30.65 %
[Trigger]
[default] Lack of free bucket quota warning on server {HOST.NAME}
= {LVCPFMTCCMWP04:cb.bucket.quotapercent[{$CBUSERNAME},{$CBPASSWORD},default].last()}<70
The problem is with the trigger definition
= {LVCPFMTCCMWP04:cb.bucket.quotapercent[{$CBUSERNAME},{$CBPASSWORD},default].last()}<70
The relational operator < should be >
The "quotapercent" returns the amount which is currently used, however, the trigger is measuring the amount which is free.