Skip to content

Commit

Permalink
Add more commands
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Jul 28, 2015
1 parent 8a32bd0 commit c4575a2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions get_os_info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

node -e '
var os = require("os");
console.log("%s/%s/%s/%s/%s", os.type(), os.hostname(), os.platform(), os.arch(), os.release());
'
3 changes: 0 additions & 3 deletions get_release

This file was deleted.

19 changes: 19 additions & 0 deletions get_status
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

node -e '
var os = require("os");
var status = function () {
var loadavg = os.loadavg();
return {
// cpu:
uptime: os.uptime(), // in ms
totalmem: os.totalmem(), // in byte
freemem: os.freemem(), // in byte
load1: loadavg[0],
load5: loadavg[1],
load15: loadavg[2]
};
};
console.log(JSON.stringify(status()));'

0 comments on commit c4575a2

Please sign in to comment.