Skip to main content
Question

Writing to the windows eventlog

  • April 20, 2015
  • 4 replies
  • 19 views

Forum|alt.badge.img
We have a bunch of jobs running on FME Desktop, these jobs are run by windows scheduled tasks. However we are migrating to FMEServer and plan to schedule the jobs with the builtin scheduler. The problem is that in order for our outsourcing-partner to easily monitor these jobs it would be ideal if FME could write to the windows eventlog. Has anyone out there done this ?

 

In know of a few cmd-line programs that can write to the eventlog calling them from a workbench is one way to go or are there better options ?
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

helmoet
Forum|alt.badge.img+8
  • March 7, 2016
You can use a python caller to execute the following script import fme import fmeobjects import subprocess # Template Function interface: def WriteEvent(feature): s = "eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO FMEJOBFAILURE /D \\"Job Failed\\"" subprocess.call(s, shell=True) pass

helmoet
Forum|alt.badge.img+8
  • March 7, 2016
You can use a python caller to execute the following script import fme import fmeobjects import subprocess # Template Function interface: def WriteEvent(feature): s = "eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO FMEJOBFAILURE /D \\"Job Failed\\"" subprocess.call(s, shell=True) pass
Remember writing new event type needs Administrator privilege. Sorry for the clumsy formatting, here is the script again: import fme import fmeobjects import subprocess # Template Function interface: def WriteEvent(feature): s = "eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO FMEJOBFAILURE /D \\"Job Failed\\"" subprocess.call(s, shell=True) pass

helmoet
Forum|alt.badge.img+8
  • March 7, 2016
You can use a python caller to execute the following script import fme import fmeobjects import subprocess # Template Function interface: def WriteEvent(feature): s = "eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO FMEJOBFAILURE /D \\"Job Failed\\"" subprocess.call(s, shell=True) pass
hm... bad formatting stays. Anyway, doesn't seem to differ much from you Original suggestion.

david_r
Celebrity
  • March 7, 2016
You can use a python caller to execute the following script

import fme
import fmeobjects
import subprocess
# Template Function interface:
def WriteEvent(feature):
    s = "eventcreate /ID 1 /L APPLICATION /T INFORMATION  /SO FMEJOBFAILURE /D \"Job Failed\""
    subprocess.call(s, shell=True)
    pass

You can format it using the CODE tag, like this:

import fme
import fmeobjects
import subprocess
def WriteEvent(feature):
    s = 'eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO FMEJOBFAILURE /D "Job Failed"'
    subprocess.call(s, shell=True)