You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Custom flags can be posted to Observer to mark an integration event such as success or failure. These flags can be used to alert as well. 

Procedure


The following steps describe how to create a method that will post your custom flag to Observer using Python and the AMQP Python client:

1. Create a method that will post the flag to Observer.

#!/usr/bin/env python

import pika
import sys
import socket
import os
import time

def postFlag():
	credentials = pika.PlainCredentials('username','password')
	connection = pika.BlockingConnection(pika.ConnectionParameters('instance-amqp.perspectium.net',5672,'/',credentials))
	channel = connection.channel()
	channel.queue_declare()
	channel.basic_publish(exchange='',routing_key='psp.in.servicenow',body='{ topic:"monitor", type:"label", key:"perspectiumdemo1", name:"integration.failed", value: "1"}')
	connection.close()

2. Call the postFlag() method in a try/catch block.

try:
    soapMethodToServiceNow();
except Exception e:
    print "Integration failed, posting integration flag to Observer"
    postFlag()

3. Log into Observer.

4. Click the cog icon. Click Alert Configurations. Then, click the Events tab.

5. Enter the name for your custom alert under the Name heading and select a Type from the dropdown.

6. Click Save.



Similar topics


There is no content with the specified labels




Contact Perspectium Support


US: 1 888 620 8880

UK: 44 208 068 5953

support@perspectium.com