Running Gateway Scripts Query

Hello,

I have a timed gateway event script that does not seem to be running and I do not know why
Here is the code:

def runAction(self, event):
	subject = "Alert: Long Session Detected"
	body = "Testing"

    system.util.getLogger("Session Email Script").info("Email sent successfully")

	recipient = ["demo@email.com"]
	smtpProfile = "alertSmtp" # This matches the email profile in the Gateway

	try:
		system.net.sendEmail(
		smtpProfile=smtpProfile, 
		fromAddr="alert@station.com", 
		subject=subject, 
		body=body, 
		to=recipient
		)
		system.util.getLogger("Session Email Script").info("Email sent successfully")
	except Exception as e:
		system.util.getLogger("Session Email Script").info("Failed to send Email: %e" % str(e))

What could be the reason the code is not bring executed in the gateway?

Thank You

There is a gateway scripts page in the gateway web interface. It should show you when a gateway script executes and any errors if it fails. Status→Gateway Scripts

See this topic:

I managed to fix the issue. I was developing the timed gateway event script in a project that I used to inherit views instead of the main project.

Once I developed the gateway scripts in the main project, I was able to see it in the Gateway Script page in the Gateway and the code was executing at the rate I set.