def probe_to_graphsrv(probe):
config = probe.config<EOL>if "<STR_LIT>" in config:<EOL><INDENT>source, group = config["<STR_LIT>"].split("<STR_LIT:.>")<EOL>group_field = config.get("<STR_LIT>", "<STR_LIT:host>")<EOL>group_value = config[group_field]<EOL>graphsrv.group.add(source, group, {group_value:{group_field:group_value}}, **config)<EOL>return<EOL><DEDENT>for k, v in list(config.items()):<EOL><INDENT>if isinstance(v, dict) and "<STR_LIT>" in v:<EOL><INDENT>r = {}<EOL>for host in v.get("<STR_LIT>"):<EOL><INDENT>if isinstance(host, dict):<EOL><INDENT>r[host["<STR_LIT:host>"]] = host<EOL><DEDENT>else:<EOL><INDENT>r[host] = {"<STR_LIT:host>":host}<EOL><DEDENT><DEDENT>graphsrv.group.add(probe.name, k, r, **v)<EOL><DEDENT><DEDENT>
takes a probe instance and generates
a graphsrv data group for it using the
probe's config