zabbix low discovery example use python(web_site_url)
#!/usr/bin/env python
# coding=utf8
# Last modified: 2013-04-12 14:47
# Author: itnihao
# Mail: itnihao@qq.com
import os
import json
#r=open('web.txt','r').readlines()
r=open('web.txt','r').read().split()
devices = []
for devpath in r:
device = os.path.basename(devpath)
devices += [{
'{#SITENAME}':device}]print json.dumps({
'data':devices},sort_keys=True,indent=7,separators=(',',':'))
web.txt内容如下
#cat web.txt
http://www.baidu.com
http://www.google.com.hk.c44c