Sha256: d1b698dac5d01b6a0669a93510b34fce8037cb05d0cad39facd68c677f3d291d

Contents?: true

Size: 429 Bytes

Versions: 2

Compression:

Stored size: 429 Bytes

Contents

module StatsLite
  DEFAULT_COMMANDS = {
    host: {
      hostname: "hostname",
      ip: {
        public: "curl -s ifconfig.me"
      }
    },
    cpu: {
      model: "lscpu | grep 'Model name' | cut -f 2 -d \":\" | awk '{$1=$1}1'",
      cores: "nproc",
      usage: <<-CMD
(grep 'cpu ' /proc/stat;sleep 0.1;grep 'cpu ' /proc/stat)|awk -v RS="" '{print ""($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)"%"}'
      CMD
    }
  }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stats_lite-0.5.4 lib/stats_lite/default_commands.rb
stats_lite-0.5.3 lib/stats_lite/default_commands.rb