Announcement

Collapse
No announcement yet.

Daily email including all errors in the log over the past 24 hrs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SteveMSJ
    replied
    Originally posted by mrceolla View Post

    FYI, my script does look through the entire log line when searching, log type and log text included.
    You are of course correct. Serves me right for making assumptions based on my own stumblings without looking properly at your script😳. As I say, my approach is a bit different.

    Steve

    Leave a comment:


  • mrceolla
    replied
    Originally posted by SteveMSJ View Post

    mrceolla
    I hope you don't mind but I was prompted(inspired) by your idea to build something similar into my free SDJ-Health pi. I go about it a bit differently because everything is grouped around Interfaces (plug-ins) in the General Devices section of SDJ-Health. One other thing I do slightly differently, which you may want to consider in your script, is that I run matches on the LogType as well as the LogText. The reason being that some plug-ins tend to add words to their name in the LogType. For example the Z-Wave pi uses LogTypes 'Z-Wave', Z-Wave Warning' and 'Z-Wave Error'.

    The update is almost complete and will be in the next SDJ-Health beta.

    Steve
    I certainly don't mind. Seems like the idea fits into the "health" category. I don't quite understand exactly how this would work in your plugin in regards to adding things to look for, and what things to ignore, but I'm sure you'll figure out something people will like.

    FYI, my script does look through the entire log line when searching, log type and log text included.

    Leave a comment:


  • SteveMSJ
    replied
    Originally posted by mrceolla View Post
    I created my own little script to do this. In case anyone else is interested, I pasted it below. I setup an event to run this about every 24 hrs. You can pass in the number of hours you want to look backwards, otherwise it defaults to 25 hours. You can specify an array of words to look for within the log entries.
    mrceolla
    I hope you don't mind but I was prompted(inspired) by your idea to build something similar into my free SDJ-Health pi. I go about it a bit differently because everything is grouped around Interfaces (plug-ins) in the General Devices section of SDJ-Health. One other thing I do slightly differently, which you may want to consider in your script, is that I run matches on the LogType as well as the LogText. The reason being that some plug-ins tend to add words to their name in the LogType. For example the Z-Wave pi uses LogTypes 'Z-Wave', Z-Wave Warning' and 'Z-Wave Error'.

    The update is almost complete and will be in the next SDJ-Health beta.

    Steve

    Leave a comment:


  • mrceolla
    replied
    Originally posted by sirbooker View Post
    i got it to work this morning by doing the following


    this is awsome Thank you for sharing the script.
    Glad you got it working how you wanted. And my pleasure!

    Leave a comment:


  • sirbooker
    replied
    i got it to work this morning by doing the following
    Dim WordsArr(0) As String
    WordsArr(0) = "Daily News"
    this is awsome Thank you for sharing the script.

    Leave a comment:


  • mrceolla
    replied
    Yes. The easiest way to accomplish what I think you're asking is to make a copy of the script, and edit it as you wish for your Daily News purposes. The script searches through the entire log line for a match, so it'll pick up your LogType of "Daily News". Does that answer your question?

    Leave a comment:


  • sirbooker
    replied
    mrceolla
    i have a question for you
    i use this command a lot to write to the log &nhs.WriteLog ("Daily News", ("Motion Has Been Detected In Backyard"))
    Daily News
    is it possible to run the script manually and have it just email me my (Daily News)
    and then a copy of the script to email me with any problems.

    Paul.

    Leave a comment:


  • sirbooker
    replied
    you were correct
    i commented out the lines needed
    then un comment the lines above for my email

    all is working
    thank you very much for sharing this script, great way to monitor homeseer

    Paul.

    Leave a comment:


  • mrceolla
    replied
    Did your alter the script? The error sounds like you have "Dim subject" in there twice. Note the lines with a single quote in front are comments and not executed.

    Leave a comment:


  • sirbooker
    replied
    any chance of updating your script to work with hs4 ?
    current errors

    Compiling script EmailErrLogEntries.vb: Local variable 'subject' is already declared in the current block.


    9/30/2020 9:41:13 AM

    HomeSeer
    Error
    Compiling script EmailErrLogEntries.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.


    Leave a comment:


  • 123qweasd
    replied
    Thanks for the feedback.
    ​​​​​

    Leave a comment:


  • mrceolla
    replied
    Originally posted by 123qweasd View Post
    Thanks for this useful script, just installed.
    Works fine on HS3/Win10

    I know you mentioned above that it has to be commented out for most people but would you mind providing details on this part of the script and it's original purpose?

    ' Send message via script
    ' Dim subject As String = "HS Log Alerts - Reminder"
    ' Dim sendTo As String = "$$DSR:359:"
    ' hs.RunScriptFunc("SendEmail.vb", "Main", sendTo & "|" & subject & "|" & errList, True, False)
    Yeah, sorry about that. I should've just left that out to avoid confusion. I store all of my email addresses and other recipient information in virtual devices so if something changes I only need to change it in one place. And I send all of my messaging (email, text, Pushover) through a custom script, bypassing HS's built in email abilities, for a number of reasons, some of which don't apply anymore, and other's that are likely unique to me. For example, I used to run my own email server, but it had no failover if something crashed or I was simply rebooting it, so messages sent during that time would never be received since HS apparently has no retry mechanism. My script would make sure my email server was online and the message was successfully sent, if not, it would send through a different email account on a different server. Another example, Pushover allows you to specify a sound when sending a message. With my script I can check the message subject line and/or body for certain words and automatically specify a specific sound for that message. Similarly, based on body or subject content, I can decide which method I want to use to send the message (email, text, Pushover). This has saved me from having to create a lot of Pushover events.

    Glad to hear it's working for you!

    Leave a comment:


  • 123qweasd
    replied
    Thanks for this useful script, just installed.
    Works fine on HS3/Win10

    I know you mentioned above that it has to be commented out for most people but would you mind providing details on this part of the script and it's original purpose?

    ' Send message via script
    ' Dim subject As String = "HS Log Alerts - Reminder"
    ' Dim sendTo As String = "$$DSR:359:"
    ' hs.RunScriptFunc("SendEmail.vb", "Main", sendTo & "|" & subject & "|" & errList, True, False)

    Cheers,

    Leave a comment:


  • zwolfpack
    replied
    Originally posted by Igorski88 View Post

    Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4ubuntu1)
    That's an issue ... current mono version is 6.12.

    Leave a comment:


  • Igorski88
    replied
    Originally posted by zwolfpack View Post
    Also what version of mono?
    Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4ubuntu1)

    Leave a comment:

Working...
X