#!/usr/bin/env python
#coding=utf-8

import os
import json

t = os.popen("""tcrmgr inform -st 127.0.0.1 | awk '/[0-9]+/' | grep -v '\.' | awk '{print $1}'""")

items = []
for item in  t.readlines():
        r = os.path.basename(item.strip())
        items += [{'{#TCRITEM}':r}]
print json.dumps({'data':items},sort_keys=True,indent=4,separators=(',',':'))
