Author Topic: Report Issues into Event Logs  (Read 1225 times)

Offline vletroye

  • Hero Member
  • *****
  • Posts: 714
  • Karma: +7/-0
    • View Profile
Report Issues into Event Logs
« on: August 17, 2014, 04:05:24 am »
On my Windows Server, from the "EventVwr" interface, I can easily "Create Basic Tasks" (=Scheduled Tasks) to be triggered when certain types of event occurs.
This is based on the Log (Ex.: System), the Source: (Ex.: disk) and the Event Id.


Couldn't the Host service of tRaid log "Warnings" in the "System" log when "blocks out of sync" are detected by Verify/Verify+/Verify and Sync ...
I could then easily execute my own scripts to, e.g., send me a SMS/email or ... in such cases


I know that we can already get an email when a task fails, but we get it only at the end.
With an event, we could be notified in real-time (in my case, I only do complete Verify (not using "range") and it takes up to  14 hours.
With an event, we could also execute whatever we went and you could log events (Information/Warning/Error) for many other things, like Pool start or stop, Array start or stop, etc...

To go a bit further, I could write a script that parse the details of the Event message logged by a Verify... Reading the First byte failure and the amount of 4 blocks, I could programmaticaly trigger a Verify&Sync on that range and nothing else.

For sure, depending if the running task is a Verify, a Verify+ or a Verify&Sync, the Event ID should ideally be different in case of blocks out of sync, so scripts can be customized appropriately  8).

V.
« Last Edit: August 17, 2014, 05:28:03 am by vletroye »

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,537
  • Karma: +204/-16
    • View Profile
Re: Report Issues into Event Logs
« Reply #1 on: August 17, 2014, 06:23:55 am »
Hum... interesting use case.

I will do you one better and expand this to being able to define and configure event triggers.
Only a select few users can parse the Windows logs and trigger things on their own.

The trigger could then be internal actions or external scripts being called.
So, what would be useful now is defining all the events of interest.

So far, we have:
- Verification reports
- Disk drop out
- Smart warnings

This does not have to be limited to issues, we could have triggers on even successful actions.

- On array start/stop
- On pool start/stop
- On RAID initialization
- Before and After task completion

What else?


Offline vletroye

  • Hero Member
  • *****
  • Posts: 714
  • Karma: +7/-0
    • View Profile
Re: Report Issues into Event Logs
« Reply #2 on: August 17, 2014, 08:50:30 am »
Maybe also "Information" log entries when a Scheduled jobs like "File Statistics", "DB backup", etc... "Starts" or "Stops & Succeeds"
+ "Error" log entries when a Scheduled job "Stops & Fails"...



Notice: companies using their own monitoring tool, such as SCOM (the System Center Operations Manager of Microsoft), also usually monitor the event logs.
It's indeed the easiest way to integrate third parties within their own monitoring and alerting policies.
I am not used to such systems, but  to be further inspired, you could see if those have any specific requirements...
Maybe they expect something special (???) to be published with the event ?

V.

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,537
  • Karma: +204/-16
    • View Profile
Re: Report Issues into Event Logs
« Reply #3 on: August 17, 2014, 10:29:58 am »
I see where you are going with that. This needs further brainstorming.
Tools that operate on logs would do better tailing the Web UI and host service logs.

I prefer a solution that is not only cross-platform but that is also at the reach of mere mortals.
Going back to the triggers idea, those that need Windows specific log entries can insert them as need using their own callbacks.

Defining the trigger points will be easy, but what to do on those trigger is where more elaboration is needed.
The simplest is to call an external script or program. However, being able to do internal this is most valuable.

I can certainly embed a scripting engine: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino
However, this will be only on request of a serious developer wishing to do something interesting.

Offline vletroye

  • Hero Member
  • *****
  • Posts: 714
  • Karma: +7/-0
    • View Profile
Re: Report Issues into Event Logs
« Reply #4 on: August 17, 2014, 11:55:30 am »
That's actually really too much for my purpose (first idea).

Monitoring services via the event logs, on Microsoft systems platform, is however IMO the most common approach (Many tool exists for that purpose).
Up next to SysOp to handle those events to trigger further actions...

My first idea was to monitor FlexRaid's events to notify me in real-time as soon as Verify errors occur.
Actually, I always have to wait for 14 hours before being notified if a full Verify+ (or a Verify&Sync) succeeds or not.
If events are logged in  real-time for each "block updated" or "byte failed", I can decide to stop immediately the Verify+ and do something else...

I thought next that it could be extended to monitor in real-time any other operation...

V.