Check if a cluster is online
Add support to do `nmo isonline mycluster` and it will check whether all
nodes are online.
diff --git a/doc/api/nmo-isonline.md b/doc/api/nmo-isonline.md
index f896a34..03f1e36 100644
--- a/doc/api/nmo-isonline.md
+++ b/doc/api/nmo-isonline.md
@@ -4,16 +4,22 @@
 ## SYNOPSIS
 
     nmo.commands.isonline(url, [url], ...)
+    nmo.commands.isonline(cluster,...)
 
 
 ## DESCRIPTION
 
 Check if nodes are online / available on the current network.
 
+url:
 The command takes multiple url arguments for checking multiple nodes
 at once. The url must be a `String`. The last argument must be an
 `Object` providing options.
 
+cluster:
+The command looks up the nodes defined in the config file for a given cluster
+and will check whether is node is online
+
 The command returns a promise which will return an `Object` where the
 keys are the provided urls and the values have the type `Boolean`.
 `true` indicates an online, available node.
diff --git a/doc/cli/nmo-isonline.md b/doc/cli/nmo-isonline.md
index 89d97e5..9088cf4 100644
--- a/doc/cli/nmo-isonline.md
+++ b/doc/cli/nmo-isonline.md
@@ -4,11 +4,17 @@
 ## SYNOPSIS
 
     nmo isonline <url> [<url>, <url> ...] [--json]
+    nmo isonline <cluster> [--json]
 
 
 ## DESCRIPTION
 
+  <url>:
 Check if one or several nodes are currently online or available.
 
+  <cluster>:
+If a cluster is defined in the nmo config file it will then check that each node
+in that cluster is online
+
 It will print the result as colored output. JSON output is also
 supported by passing the `--json` flag.
diff --git a/src/isonline.js b/src/isonline.js
index 804087b..a3a88aa 100644
--- a/src/isonline.js
+++ b/src/isonline.js
@@ -15,6 +15,10 @@
       return reject(err);
     }
 
+    if (urls.length === 1 && !utils.isUri(urls[0])) {
+      urls = getClusterUrls(urls[0]);
+    }
+
     isonline.apply(isonline, urls)
       .then((results) => {
         const jsonOut = nmo.config.get('json');
@@ -37,6 +41,15 @@
   });
 }
 
+export function getClusterUrls (clusterName) {
+  const nodes = nmo.config.get(clusterName);
+  if (!nodes) {
+    const err = new Error('Cluster does not exist');
+    err.type = 'EUSAGE';
+    throw err;
+  }
+  return Object.keys(nodes).map(key => nodes[key]);
+}
 
 export default isonline;
 function isonline (...args) {
diff --git a/test/cluster.js b/test/cluster.js
index e583c29..950b412 100644
--- a/test/cluster.js
+++ b/test/cluster.js
@@ -10,8 +10,8 @@
 import fs from 'fs';
 
 const data = `[clusterone]
-node0=127.0.0.1
-node1=192.168.0.1
+node0=http://127.0.0.1
+node1=http://192.168.0.1
 
 [onenodecluster]
 node1=iamalonelylnode
@@ -55,7 +55,7 @@
       cluster
         .get('clusterone', 'node0')
         .then((res) => {
-          assert.equal(res, '127.0.0.1');
+          assert.equal(res, 'http://127.0.0.1');
           done();
         });
     });
diff --git a/test/config.js b/test/config.js
index a1e6a8f..19df52d 100644
--- a/test/config.js
+++ b/test/config.js
@@ -11,8 +11,8 @@
 
 
 const data = `[clusterone]
-node0=127.0.0.1
-node1=192.168.0.1
+node0=http://127.0.0.1
+node1=http://192.168.0.1
 
 [gang]
 rocko=artischocko
@@ -29,8 +29,8 @@
     "mussman": "dermussmaen"
   },
   "clusterone": {
-    "node0": "127.0.0.1",
-    "node1": "192.168.0.1"
+    "node0": "http://127.0.0.1",
+    "node1": "http://192.168.0.1"
   }
 };
 
@@ -74,7 +74,7 @@
         .then((res) => {
           config.set('cluster1337', 'node1337', '192.168.133.7').then((e) => {
             const c = ini.parse(fs.readFileSync(__dirname + '/fixtures/randomini', 'utf-8'));
-            assert.equal(c.clusterone.node1, '192.168.0.1');
+            assert.equal(c.clusterone.node1, 'http://192.168.0.1');
             assert.equal(c.gang.rocko, 'artischocko');
             assert.equal(c.cluster1337.node1337, '192.168.133.7');
             done();
@@ -287,7 +287,7 @@
         .then((res) => {
           config.cli('set', 'cluster1337', 'node1337', '192.168.133.7').then((e) => {
             const c = ini.parse(fs.readFileSync(__dirname + '/fixtures/randomini', 'utf-8'));
-            assert.equal(c.clusterone.node1, '192.168.0.1');
+            assert.equal(c.clusterone.node1, 'http://192.168.0.1');
             assert.equal(c.gang.rocko, 'artischocko');
             assert.equal(c.cluster1337.node1337, '192.168.133.7');
             done();
@@ -310,4 +310,3 @@
   });
 
 });
-
diff --git a/test/isonline.js b/test/isonline.js
index 14fac85..aa9cc5a 100644
--- a/test/isonline.js
+++ b/test/isonline.js
@@ -2,12 +2,12 @@
 import Lab from 'lab';
 
 import isonline from '../src/isonline.js';
-import {cli} from '../src/isonline.js';
+import {cli, getClusterUrls } from '../src/isonline.js';
 
 import * as common from './common.js';
-import log from 'npmlog';
 import nmo from '../src/nmo.js';
 
+import nock from 'nock';
 
 export let lab = Lab.script();
 const oldConsole = console.log;
@@ -41,8 +41,60 @@
           done();
         });
     });
-  });
 
+    lab.test('executes correct url for cluster name', (done) => {
+      nock('http://127.0.0.1')
+        .get('/')
+        .reply(200);
+
+      nock('http://192.168.0.1')
+        .get('/')
+        .reply(200);
+
+      nmo
+        .load({nmoconf: __dirname + '/fixtures/randomini', json: true})
+        .then(() => {
+          return cli('clusterone');
+        }).then(res => {
+          assert.deepEqual(res, {'http://127.0.0.1': true, 'http://192.168.0.1': true });
+          done();
+        });
+    });
+
+    lab.test('still executes for urls', (done) => {
+     nock('http://127.0.0.1')
+       .get('/')
+       .reply(200);
+
+     nmo
+       .load({nmoconf: __dirname + '/fixtures/randomini', json: true})
+       .then(() => {
+         return cli('http://127.0.0.1');
+       }).then(res => {
+         assert.deepEqual(res, {'http://127.0.0.1': true });
+         done();
+       });
+     });
+
+     lab.test('executes correct for multiple urls', (done) => {
+       nock('http://127.0.0.1')
+         .get('/')
+         .reply(200);
+
+       nock('http://192.168.0.1')
+         .get('/')
+         .reply(200);
+
+       nmo
+         .load({nmoconf: __dirname + '/fixtures/randomini', json: true})
+         .then(() => {
+           return cli('http://127.0.0.1', 'http://192.168.0.1');
+         }).then(res => {
+           assert.deepEqual(res, {'http://127.0.0.1': true, 'http://192.168.0.1': true });
+           done();
+         });
+     });
+  });
 
   lab.experiment('api', () => {
     lab.beforeEach((done) => {
@@ -62,6 +114,26 @@
       });
     });
 
+    lab.test('getClustersUrl returns correct urls', (done) => {
+      nmo
+        .load({nmoconf: __dirname + '/fixtures/randomini'})
+        .then(() => {
+          const urls = getClusterUrls('clusterone');
+          assert.deepEqual(['http://127.0.0.1', 'http://192.168.0.1'], urls);
+          done();
+        });
+    });
+
+    lab.test("getClustersUrl throws an error if the cluster doesn't exist", (done) => {
+        try {
+          getClusterUrls('doesnt-exist');
+        } catch(e) {
+          assert.ok(/Cluster does not exist/.test(e.message));
+          done();
+        }
+
+    });
+
     lab.test('returns error for all other errors', (done) => {
       isonline({})
         .catch((err) => {
@@ -138,7 +210,7 @@
         assert.ok(/online/.test(args[1]), 'returns online for online nodes');
         done();
       };
-      nmo.load({nmoconf: __dirname + '/fixtures/randomini'})
+      nmo.load({nmoconf: __dirname + '/fixtures/randomini', json: false})
         .then(() => {
           cli(common.NODE);
         });