cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to use Edge MicroServer (EMS) to monitor Event view logs and communicate back to ThingWorx

SC_10151701
5-Regular Member

How to use Edge MicroServer (EMS) to monitor Event view logs and communicate back to ThingWorx

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 

 

ACCEPTED SOLUTION

Accepted Solutions

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.

 

View solution in original post

3 REPLIES 3
SC_10151701
5-Regular Member
(To:VladimirN)

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.

 

Announcements


Top Tags