X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=zabbix%2Fzabbixsync.py;h=407d80182ec71f6bd8b3bb1b1a717b8e2055ebda;hb=16b7bc48471b0695e72320fbcf761db695af032e;hp=5cc2cd35ce7d8341120159a5c7ab7c8d3c731503;hpb=d428ca60fd1eb7283291b8f47cdd86dce4986925;p=monitor.git diff --git a/zabbix/zabbixsync.py b/zabbix/zabbixsync.py index 5cc2cd3..407d801 100755 --- a/zabbix/zabbixsync.py +++ b/zabbix/zabbixsync.py @@ -22,8 +22,8 @@ def get_site_iplist(loginbase): # TODO: if it is, then we need to break up the discovery rule. ip_list = "" for node in node_list: - if len(node['nodenetwork_ids']) > 0: - ip = netid2ip[node['nodenetwork_ids'][0]] + if len(node['interface_ids']) > 0: + ip = netid2ip[node['interface_ids'][0]] if len(ip_list) > 0: ip_list += "," ip_list += ip @@ -44,7 +44,7 @@ if __name__=="__main__": from monitor import parser as parsermodule parser = parsermodule.getParser(['cacheset']) - parser.set_defaults( setupglobal=False, syncsite=True, site=None, setupids=False) + parser.set_defaults( setupglobal=False, syncsite=True, site=None, sitelist=None, setupids=False) parser.add_option("", "--setupids", action="store_true", dest="setupids", help="Setup global IDs.") parser.add_option("", "--setupglobal", action="store_true", dest="setupglobal", @@ -53,6 +53,8 @@ if __name__=="__main__": help="Do not sync sites.") parser.add_option("", "--site", dest="site", help="Sync only given site name.") + parser.add_option("", "--sitelist", dest="sitelist", + help="Sync only given site names in the list.") opts = parsermodule.parse_args(parser) os.system("""echo '' > /usr/share/monitor/nodelist.txt""")