X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=zabbix%2Fzabbixsite.py;h=052b200b575d0dfd148e0bb01cb4bace65193e00;hb=60ecfa840f2cf65ef910975d8e9443ac9c1b02db;hp=5ff964f1dc0c0d671739425b83c4a805bb38e811;hpb=d593259f5f88cb6a30bb6093b2b18ede67af46c2;p=monitor.git diff --git a/zabbix/zabbixsite.py b/zabbix/zabbixsite.py index 5ff964f..052b200 100755 --- a/zabbix/zabbixsite.py +++ b/zabbix/zabbixsite.py @@ -40,6 +40,8 @@ def delete_site(loginbase): #user.delete() pass ug.delete() + else: + print usergroupname, " not found" hg = HostGroup.get_by(name=hostgroupname) if hg: @@ -48,16 +50,21 @@ def delete_site(loginbase): for host in hg.host_list: host.delete() hg.delete() + else: + print hostgroupname, " not found" # delete dr dr = DiscoveryRule.get_by(name=discovery_rule_name) if dr: dr.delete() + else: print discovery_rule_name, " not found" da = Action.get_by(name=discovery_action_name) if da: da.delete() + else: print discovery_action_name, " not found" ea = Action.get_by(name=escalation_action_name) if ea: ea.delete() + else: print escalation_action_name, " not found" return @@ -118,7 +125,7 @@ def setup_global(): print "checking scripts" script1 = Script.find_or_create(name="RebootNode", set_if_new = { - 'command':"%s/reboot.py {HOST.CONN}" % config.MONITOR_SCRIPT_ROOT, + 'command':"%s/monitor/reboot.py {HOST.CONN}" % config.MONITOR_SCRIPT_ROOT, 'host_access':3 # r/w) }) script2 = Script.find_or_create(name="NMap", @@ -237,15 +244,15 @@ def setup_site(loginbase, techemail, piemail, iplist): ] # THEN a.actionoperation_list=[ - # Send Email - ActionOperation( - operationtype=defines.OPERATION_TYPE_MESSAGE, - shortdata=mailtxt.node_discovered_subject, - longdata=mailtxt.node_discovered, - object=defines.OPERATION_OBJECT_GROUP, - objectid=site_user_group.usrgrpid, - esc_period=0, esc_step_to=1, esc_step_from=1, - ), + ## Send Email + #ActionOperation( + # operationtype=defines.OPERATION_TYPE_MESSAGE, + # shortdata=mailtxt.node_discovered_subject, + # longdata=mailtxt.node_discovered, + # object=defines.OPERATION_OBJECT_GROUP, + # objectid=site_user_group.usrgrpid, + # esc_period=0, esc_step_to=1, esc_step_from=1, + #), # Add Host ActionOperation( operationtype=defines.OPERATION_TYPE_HOST_ADD, @@ -348,17 +355,17 @@ def setup_site(loginbase, techemail, piemail, iplist): esc_step_from=17, esc_step_to=17, esc_period=0, shortdata="", - longdata="%s:%s/checkslices.py {HOSTNAME} disableslices" % ( config.MONITOR_HOSTNAME, config.MONITOR_SCRIPT_ROOT ), + longdata="%s:%s/monitor/reboot.py {HOSTNAME}" % ( config.MONITOR_HOSTNAME, config.MONITOR_SCRIPT_ROOT ), # TODO: send notice to users of slices operationcondition_list=[ OperationConditionNotAck() ]), - ActionOperation(operationtype=defines.OPERATION_TYPE_MESSAGE, - shortdata=mailtxt.nodedown_three_subject, - longdata=mailtxt.nodedown_three, - esc_step_from=17, esc_step_to=17, - esc_period=0, - object=defines.OPERATION_OBJECT_GROUP, - objectid=site_user_group.usrgrpid, - operationcondition_list=[ OperationConditionNotAck() ] ), + #ActionOperation(operationtype=defines.OPERATION_TYPE_MESSAGE, + # shortdata=mailtxt.nodedown_three_subject, + # longdata=mailtxt.nodedown_three, + # esc_step_from=17, esc_step_to=17, + # esc_period=0, + # object=defines.OPERATION_OBJECT_GROUP, + # objectid=site_user_group.usrgrpid, + # operationcondition_list=[ OperationConditionNotAck() ] ), # STAGE 4++ ActionOperation(operationtype=defines.OPERATION_TYPE_COMMAND, esc_step_from=21, esc_step_to=0,