Hi,
habe eben erst euren Post gesehen … wie weit seit Ihr den damit ich habe bzw. bin an was ähnlichem zu SNOW dran
1. Parameter Erweiterung
Assigment Group und andere Parameter
Parameter
def handle_problem(url, proxies, user, pwd, short_desc, desc, hostname, servicename, problem_id,
caller, urgency, impact, timeout):
url += "/api/now/table/incident"
headers = {"Content-Type": "application/json", "Accept": "application/json"}
response = requests.post(url,
proxies=proxies,
auth=(user, pwd),
headers=headers,
timeout=timeout,
json={
"short_description": short_desc,
"description": desc,
"urgency": urgency,
"impact": impact,
"caller_id": caller,
"u_requester": caller, ####################custom made
"category": "event", ####################custom made
"contact_type": "interface", ####################custom made
"business_service": "ITPF Monitoring/Infrastructure", ####################custom made
"cmdb_ci": hostname, ####################custom made
"assignment_group": "it_production_control", ####################custom made
"work_notes": "Check_MK Problem ID: %s" % problem_id ####################custom made
})
2. Ticket Nummer
wird als comment in CMK an den Host angehangen
TicketNr
if response.status_code != 201:
sys.stderr.write('Status: %s\n' % response.status_code)
return 2
incident_nr = response.json()["result"]["number"]
sys.stdout.write('Ticket successfully created with incident number: %s.\n' % incident_nr)
socket_path="unix:"+omd_root+"/tmp/run/live"
connection=livestatus.SingleSiteConnection(socket_path)
connection.command("[%s] ADD_HOST_COMMENT;%s;1;%s;Ticket created with IncidentNr: %s\n"%(int(time.time()),hostname,caller,incident_nr)) ####################custom made
sys.stdout.write('Ticket successfully add comment\n')
return 0
3. Snappin
Ticket Erstellung und Status