Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi Team,
We are trying to leverage on the Edge MicroServer (EMS) which when hosted on remote server and communicate back to ThingWorx on situation like Services are running or monitor event viewer logs and alert on particular exception etc
Looking forward to hear from the community
Solved! Go to Solution.
Hi @SC_10151701 ,
I'm guessing you probably need to raise something called Remote Events in EMS.
There is a file called "example.lua" in the /etc/custom/templates EMS folder that should give you idea on how to fire such an event, in the Remote Service "FireExampleEvent".
Now on when to trigger such an event, that is not something very sophisticated, since you'll probably need to do a polling to the event viewer logs to see if you want to raise such an event. You should use a task concept (basically a local edge timer) to check on that, then raise the event if needed.
Another point is that the code you'll write to check that will need to either be in LUA (don't know how familiar you're with that) or, as I did it many times, you can create a program that does that in your favorite programming language, then execute it from LUA.
Looking on your requirements, I do have the feeling you're using Windows as the source device, so I must advise to check on the .NET SDK, as probably it will be easier to interact with Windows' subsystems - lots of wrappers out there in .NET grace of Microsoft.
Some useful information:
Hi Vladimir,
Thank you for your response. My question is about how EMS can communicate back to thingworx on situation like Services are running or monitor event viewer logs and alert on particular exception. My question is not about how use EMS to connect to ThingWorx rather after that, how to leverage EMS connection to notify thingworx on on such special situations where EMS is running.
Hi @SC_10151701 ,
I'm guessing you probably need to raise something called Remote Events in EMS.
There is a file called "example.lua" in the /etc/custom/templates EMS folder that should give you idea on how to fire such an event, in the Remote Service "FireExampleEvent".
Now on when to trigger such an event, that is not something very sophisticated, since you'll probably need to do a polling to the event viewer logs to see if you want to raise such an event. You should use a task concept (basically a local edge timer) to check on that, then raise the event if needed.
Another point is that the code you'll write to check that will need to either be in LUA (don't know how familiar you're with that) or, as I did it many times, you can create a program that does that in your favorite programming language, then execute it from LUA.
Looking on your requirements, I do have the feeling you're using Windows as the source device, so I must advise to check on the .NET SDK, as probably it will be easier to interact with Windows' subsystems - lots of wrappers out there in .NET grace of Microsoft.