virgo-agent-toolkit / rackspace-monitoring-agent

Rackspace Cloud Monitoring Agent
http://virgoagent.com/rackspace-monitoring-agent/
Apache License 2.0
118 stars 39 forks source link

Inconsistent Filesystem metrics #964

Closed travisce closed 6 years ago

travisce commented 6 years ago

Howdy Agent Devs,

I'm seeing inconsistent metrics on the filesystem monitoring check for Cloud Databases. In the JPG attached, you can see that "Available 0.00B" and "Used 94.95%". Shouldn't "Used" be 100% here?

This was brought to my attention because the check's alarm did not fire a CRITICAL above 95% (it only reached 94.95%). The alarm condition is: "(percentage(metric['used'], metric['total']) > 95)"

/etc/debian_version => 7.6 df --version => df (GNU coreutils) 8.13 dpkg -l rackspace-monitoring-agent => 2.6.10

Thanks! maas-graphs-20171207

itzg commented 6 years ago

We'll investigate further but looking at docs it might actually be "working as designed" since the Rackspace Agent docs declare used as

Used space on the filesystem, in kilobytes. This number does not include the reserved space. This is calculated as total - free

That corresponds to the statvfs definition of f_bavail:

free blocks for unprivileged users

As a solution/workaround, you can flip the numerical condition and use available such as

if (percentage(metric['avail'], metric['total']) < 5) {
  return new AlarmStatus(CRITICAL, '...');
}
jjbuchan commented 6 years ago

Closing this out due to "working as designed". The alternative solution proposed by @itzg will work.