Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. English
    3. ioBroker general
    4. adapter LOGs monitoring for errors with mail notifications

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    adapter LOGs monitoring for errors with mail notifications

    This topic has been deleted. Only users with topic management privileges can see it.
    • shaarkys
      shaarkys last edited by

      Hi,
      I'm quite new with ioBroker and using is mostly for integrations with WeConnect, HaasSoohn, Easee, which I share then via MQTT to Homey. From time to time it may happen that one of the adapter is in error state - I tried to search but didn't find answer - is there any way how to monitor logs for errors or adapter states and send fatal errors via email ? I'm not looking for a way to script everything from scratch, rather I wonder I have overlooked some module with such functionality ?
      Can someone share some info / guidance ?

      What I have found so far is Log parser, which is mainly used for Visualisation and it's kind of overkill for the basic need...

      Much appreciated.

      Thank you.

      liv-in-sky 1 Reply Last reply Reply Quote 0
      • liv-in-sky
        liv-in-sky @shaarkys last edited by

        @shaarkys

        I played around with this script - long ago

        maybe you can change this for your task

        if a special error or warning appears - the script sends a true to the datapoint and after 2 seconds the datapoint will be switched to false again

        
        
        
        
        const dpPrefix = "javascript."+ instance +".";
        
        //definition des dp's - BLOCK 1
        
        createState(dpPrefix + "OwnLogEntries.Meross",false, { name: 'Meross',  type: 'boolean', role:"switch", read:  true,  write: true,});
        createState(dpPrefix + "OwnLogEntries.Test",false, { name: 'Test',  type: 'boolean', role:"switch", read:  true,  write: true,});
        createState(dpPrefix + "OwnLogEntries.Warn515",false, { name: 'Test',  type: 'boolean', role:"switch", read:  true,  write: true,});
        createState(dpPrefix + "OwnLogEntries.Display7219Matrix",false, { name: 'Test',  type: 'boolean', role:"switch", read:  true,  write: true,});
        
        
        
        // für jeden definierten fehler der trigger - BLOCK 2
        
        function checkErrors(data) {
          //Alarm 1 
         // hier mit regex um genauer zu filtern
            if(data.message.match(/ Error Test /g)){                               // hier angleichen fehler meldung
           setState(dpPrefix + "OwnLogEntries.Test",true);                         // hier angleichen dp
           setStateDelayed(dpPrefix + "OwnLogEntries.Test",false,2000);            // hier angleichen dp
           }
        
           //Alarm2
           if(data.message.includes("instance system.adapter.meross.0 terminated with code 156")){       // hier angleichen fehler meldung
           setState(dpPrefix + "OwnLogEntries.Meross",true);                                             // hier angleichen dp
           setStateDelayed(dpPrefix + "OwnLogEntries.Meross",false,2000);                                // hier angleichen dp
           }
        
        
         
        }
        
        function checkWarnings(data) {
                   //Warn1
           if(data.message.includes("(515) BT already scanning!")){       // hier angleichen warning meldung
           setState(dpPrefix + "OwnLogEntries.Warn515",true);                                             // hier angleichen dp
           setStateDelayed(dpPrefix + "OwnLogEntries.Warn515",false,2000);                                // hier angleichen dp
           }
        }
        
        
        function checkWarnings2(data) {
              log("bin drin","warn")     //Warn1
           if(data.message.includes("7219Matrix")){       // hier angleichen warning meldung
           setState(dpPrefix + "OwnLogEntries.Display7219Matrix",true);                                             // hier angleichen dp
           setStateDelayed(dpPrefix + "OwnLogEntries.Display7219Matrix",false,2000);                                // hier angleichen dp
           }
        }
        
        onLog("error", checkErrors);
        onLog("warn", checkWarnings);
        onLog("warn", checkWarnings2);
        
        
        
        
        

        shaarkys 1 Reply Last reply Reply Quote 1
        • shaarkys
          shaarkys @liv-in-sky last edited by

          @liv-in-sky thank you, I was worried that there is no adapter I can simply re-use. Will take a look, thank you very much for sharing!

          liv-in-sky 1 Reply Last reply Reply Quote 0
          • liv-in-sky
            liv-in-sky @shaarkys last edited by

            @shaarkys

            if you have any questions - don't hesitate to ask

            1 Reply Last reply Reply Quote 1
            • First post
              Last post

            Support us

            ioBroker
            Community Adapters
            Donate

            913
            Online

            31.8k
            Users

            80.0k
            Topics

            1.3m
            Posts

            2
            4
            359
            Loading More Posts
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes
            Reply
            • Reply as topic
            Log in to reply
            Community
            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
            The ioBroker Community 2014-2023
            logo