Skip to content

On Ubuntu 14.04, usagewatch seems not to work properly #14

@jpahullo

Description

@jpahullo

Hi all,

I have just upgraded to a Ubuntu 14.04 a server machine where we had a little script using your usagewatch gem, to return a json string just for monitoring. Before upgrading, the script showed a 20% of used hard disk. After upgrading, it always shows 0%.

After upgrading, as root, I run:

  1. gem install usagewatch
  2. gem install json

The script is as simple as this:

#/usr/bin/ruby

require 'usagewatch'
require 'json'

usw = Usagewatch

disk_io = usw.uw_diskioreads.to_i + usw.uw_diskiowrites.to_i
network = usw.uw_bandrx.to_i + usw.uw_bandtx.to_i
usage = {
  name: 'sredb',
  cpu: usw.uw_cpuused.to_s + ' %',
  memory: usw.uw_memused.to_s + ' %',
  disk_io: disk_io.to_s + ' op/s',
  disk_space: usw.uw_diskused_perc.to_s + ' %',
  network: network.to_s + ' Mbit/s'
}

puts usage.to_json

Do you know any issue related to this? Could you help me please? Can it be caused by some gem not installed yet?

Looking forward to hearing from you,

Saludos,

Jordi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions