diff --git a/TestON/tests/RCOnosScale4nodes/check_status.py b/TestON/tests/RCOnosScale4nodes/check_status.py
new file mode 100755
index 0000000..c725cec
--- /dev/null
+++ b/TestON/tests/RCOnosScale4nodes/check_status.py
@@ -0,0 +1,111 @@
+#! /usr/bin/env python
+import json
+import os
+import sys
+
+# http://localhost:8080/wm/core/topology/switches/all/json
+# http://localhost:8080/wm/core/topology/links/json
+# http://localhost:8080/wm/registry/controllers/json
+# http://localhost:8080/wm/registry/switches/json"
+
+def get_json(url):
+  try:
+    command = "curl -s %s" % (url)
+    result = os.popen(command).read()
+    parsedResult = json.loads(result)
+  except:
+    print "REST IF %s has issue" % command
+    parsedResult = ""
+
+  if type(parsedResult) == 'dict' and parsedResult.has_key('code'):
+    print "REST %s returned code %s" % (command, parsedResult['code'])
+    parsedResult = ""
+
+  return parsedResult 
+
+def check_switch(RestIP,correct_nr_switch ):
+  buf = ""
+  retcode = 0
+  RestPort="8080"
+
+  url="http://%s:%s/wm/core/topology/switches/all/json" % (RestIP, RestPort)
+  parsedResult = get_json(url)
+
+  if parsedResult == "":
+    retcode = 1
+    return (retcode, "Rest API has an issue")
+
+  url = "http://%s:%s/wm/registry/switches/json" % (RestIP, RestPort)
+  registry = get_json(url)
+
+  if registry == "":
+    retcode = 1
+    return (retcode, "Rest API has an issue")
+
+
+  buf += "switch: total %d switches\n" % len(parsedResult)
+  cnt = 0
+  active = 0
+
+  for s in parsedResult:
+    cnt += 1
+
+    if s['state']  == "ACTIVE":
+      active += 1
+
+    if not s['dpid'] in registry:
+      buf += "switch:  dpid %s lost controller\n" % (s['dpid'])
+
+  buf += "switch: network %d : %d switches %d active\n" % (0+1, cnt, active)
+  if correct_nr_switch != cnt:
+    buf += "switch fail: network %d should have %d switches but has %d\n" % (1, correct_nr_switch, cnt)
+    retcode = 1
+
+  if correct_nr_switch != active:
+    buf += "switch fail: network %d should have %d active switches but has %d\n" % (1, correct_nr_switch, active)
+    retcode = 1
+
+  return (retcode, buf)
+
+def check_link(RestIP, nr_links):
+  RestPort = "8080"
+  buf = ""
+  retcode = 0
+
+  url = "http://%s:%s/wm/core/topology/links/json" % (RestIP, RestPort)
+  parsedResult = get_json(url)
+
+  if parsedResult == "":
+    retcode = 1
+    return (retcode, "Rest API has an issue")
+
+  buf += "link: total %d links (correct : %d)\n" % (len(parsedResult), nr_links)
+  intra = 0
+  interlink=0
+
+  for s in parsedResult:
+    intra = intra + 1 
+
+  if intra != nr_links:
+    buf += "link fail: network %d should have %d intra links but has %d\n" % (1, nr_links, intra)
+    retcode = 1
+
+  return (retcode, buf)
+
+#if __name__ == "__main__":
+def check_status(ip, numoswitch, numolink):
+
+  switch = check_switch(ip, numoswitch)
+  link = check_link(ip, numolink)
+  value = switch[0]
+  value += link[0]
+  if value != 0:
+    print "FAIL"
+    return 0
+  else: 
+    print "PASS"
+    return 1
+  print "%s" % switch[1]
+  print "%s" % link[1]
+ # print "%s" % check_switch_local()[1]
+ # print "%s" % check_controllers(8)[1]
