Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 126 of 807  Not logged in ELOG logo
New entries since:Thu Jan 1 01:00:00 1970
    icon2.gif   Re: Monitoring a logbook for changes, posted by Johan Forsberg on Wed Jan 13 10:29:54 2016 

Yeah, I suppose something like that would be both faster and more efficient than polling ELOG itself. Fortunately the ELOG disk format looks easily parsed.

Thanks for the pointer!

Tamas Gal wrote:

I recommend monitoring directly on the server. Here is an example of a very simply Python script (https://github.com/tamasgal/elog-slack) which monitors the files very efficiently and immediately pushes notifications to Slack (slack.com). Just look at the code, it's pretty straight forward and very easy to adapt it to other (web) services.

Btw. here is an ELOG entry of it https://midas.psi.ch/elogs/Forum/68224

Johan Forsberg wrote:

Hi again!

I've another need that you probably already thought of :)

I'd like to be able to efficiently monitor a logbook for changes (new or edited posts) somehow. The most reasonable way I've found so far is to periodically poll a search that looks for posts after the time of the last poll. But that might note be very efficient, especially if the polling period gets short (or number of clients grows).

Is there some other feature that could be used for this? I was thinking maybe the ETag or Last-Modified HTTP header field could be used to show changes to a logbook by just reading the headers, but it would also require HEAD request support which does not seem to be there.

Cheers,

Johan

 

 

    icon2.gif   Re: Monitoring a logbook for changes, posted by Tamas Gal on Wed Jan 13 17:04:34 2016 

I just noticed that there are multiple messages per file, so I have to adapt the parser. I'll update this thread when I'm done!

Johan Forsberg wrote:

Yeah, I suppose something like that would be both faster and more efficient than polling ELOG itself. Fortunately the ELOG disk format looks easily parsed.

Thanks for the pointer!

Tamas Gal wrote:

I recommend monitoring directly on the server. Here is an example of a very simply Python script (https://github.com/tamasgal/elog-slack) which monitors the files very efficiently and immediately pushes notifications to Slack (slack.com). Just look at the code, it's pretty straight forward and very easy to adapt it to other (web) services.

Btw. here is an ELOG entry of it https://midas.psi.ch/elogs/Forum/68224

Johan Forsberg wrote:

Hi again!

I've another need that you probably already thought of :)

I'd like to be able to efficiently monitor a logbook for changes (new or edited posts) somehow. The most reasonable way I've found so far is to periodically poll a search that looks for posts after the time of the last poll. But that might note be very efficient, especially if the polling period gets short (or number of clients grows).

Is there some other feature that could be used for this? I was thinking maybe the ETag or Last-Modified HTTP header field could be used to show changes to a logbook by just reading the headers, but it would also require HEAD request support which does not seem to be there.

Cheers,

Johan

 

 

 

    icon2.gif   Re: Monitoring a logbook for changes, posted by Stefan Ritt on Wed Jan 13 17:21:56 2016 

You guys know that there is the possibility to execute an arbitrary script on each submission of a new messge? Just use "Execute new = <script>". In the script you have access to all parameters of the message. That's maybe simple than to watch the file set.

Tamas Gal wrote:

I just noticed that there are multiple messages per file, so I have to adapt the parser. I'll update this thread when I'm done!

Johan Forsberg wrote:

Yeah, I suppose something like that would be both faster and more efficient than polling ELOG itself. Fortunately the ELOG disk format looks easily parsed.

Thanks for the pointer!

Tamas Gal wrote:

I recommend monitoring directly on the server. Here is an example of a very simply Python script (https://github.com/tamasgal/elog-slack) which monitors the files very efficiently and immediately pushes notifications to Slack (slack.com). Just look at the code, it's pretty straight forward and very easy to adapt it to other (web) services.

Btw. here is an ELOG entry of it https://midas.psi.ch/elogs/Forum/68224

Johan Forsberg wrote:

Hi again!

I've another need that you probably already thought of :)

I'd like to be able to efficiently monitor a logbook for changes (new or edited posts) somehow. The most reasonable way I've found so far is to periodically poll a search that looks for posts after the time of the last poll. But that might note be very efficient, especially if the polling period gets short (or number of clients grows).

Is there some other feature that could be used for this? I was thinking maybe the ETag or Last-Modified HTTP header field could be used to show changes to a logbook by just reading the headers, but it would also require HEAD request support which does not seem to be there.

Cheers,

Johan

 

 

 

 

    icon2.gif   Re: Monitoring a logbook for changes, posted by Tamas Gal on Wed Jan 13 18:37:32 2016 

Where is this feature documented?

Stefan Ritt wrote:

You guys know that there is the possibility to execute an arbitrary script on each submission of a new messge? Just use "Execute new = <script>". In the script you have access to all parameters of the message. That's maybe simple than to watch the file set.

 

    icon2.gif   Re: Monitoring a logbook for changes, posted by Stefan Ritt on Wed Jan 13 19:08:09 2016 

In the documentation of course :-)

Tamas Gal wrote:

Where is this feature documented?

Stefan Ritt wrote:

You guys know that there is the possibility to execute an arbitrary script on each submission of a new messge? Just use "Execute new = <script>". In the script you have access to all parameters of the message. That's maybe simple than to watch the file set.

 

 

    icon2.gif   Re: Monitoring a logbook for changes, posted by Tamas Gal on Wed Jan 13 19:13:47 2016 

I'm probably too tired or I don't know, but of course I looked at the user's guide and the admin's guide but did not found anything about this ;-) Is there another documention which I missed somehow?

Stefan Ritt wrote:

In the documentation of course :-)

Tamas Gal wrote:

Where is this feature documented?

Stefan Ritt wrote:

You guys know that there is the possibility to execute an arbitrary script on each submission of a new messge? Just use "Execute new = <script>". In the script you have access to all parameters of the message. That's maybe simple than to watch the file set.

 

 

 

    icon2.gif   Re: Monitoring a logbook for changes, posted by Stefan Ritt on Wed Jan 13 19:22:35 2016 

You look here: http://midas.psi.ch/elog/config.html and scroll down to "Execute New". I wonder how you ever could run elog without looking at that page.

Tamas Gal wrote:

I'm probably too tired or I don't know, but of course I looked at the user's guide and the admin's guide but did not found anything about this ;-) Is there another documention which I missed somehow?

Stefan Ritt wrote:

In the documentation of course :-)

Tamas Gal wrote:

Where is this feature documented?

Stefan Ritt wrote:

You guys know that there is the possibility to execute an arbitrary script on each submission of a new messge? Just use "Execute new = <script>". In the script you have access to all parameters of the message. That's maybe simple than to watch the file set.

 

 

 

 

    icon2.gif   Re: Monitoring a logbook for changes, posted by Tamas Gal on Wed Jan 13 19:26:35 2016 

OK thanks I'll check that out. I did not configure ELOG by myself, I only use it and wrote the Slack plugin ;-)

Stefan Ritt wrote:

You look here: http://midas.psi.ch/elog/config.html and scroll down to "Execute New". I wonder how you ever could run elog without looking at that page.

Tamas Gal wrote:

I'm probably too tired or I don't know, but of course I looked at the user's guide and the admin's guide but did not found anything about this ;-) Is there another documention which I missed somehow?

Stefan Ritt wrote:

In the documentation of course :-)

Tamas Gal wrote:

Where is this feature documented?

Stefan Ritt wrote:

You guys know that there is the possibility to execute an arbitrary script on each submission of a new messge? Just use "Execute new = <script>". In the script you have access to all parameters of the message. That's maybe simple than to watch the file set.

 

 

 

 

 

ELOG V3.1.5-3fb85fa6