Closed hobbyquaker closed 6 years ago
Ich weiß nicht was dir vorschwebt, aber so könnte es aussehen:
[{"id":"50104e94.8152b8","type":"tab","label":"Error Monitoring","disabled":false,"info":""},{"id":"5d48d65c.e24b48","type":"tail","z":"50104e94.8152b8","name":"","filetype":"text","split":true,"filename":"/var/log/messages","x":130,"y":160,"wires":[["6595e35d.530f24"]]},{"id":"6595e35d.530f24","type":"switch","z":"50104e94.8152b8","name":"Filter Errors","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"^.*Error\\:.*$","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":160,"wires":[["e9d593c5.3deb1"]]},{"id":"e9d593c5.3deb1","type":"counter","z":"50104e94.8152b8","name":"Count Errors","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":2,"x":510,"y":160,"wires":[["253f1e33.ae4aea"],["ba691feb.d30d08","bd901793.899028"]]},{"id":"253f1e33.ae4aea","type":"ui_gauge","z":"50104e94.8152b8","name":"Show Error Count","group":"d79a8eea.a905c","order":0,"width":"6","height":"4","gtype":"gage","title":"Anzahl Fehler","label":"Fehler","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":710,"y":100,"wires":[]},{"id":"ba691feb.d30d08","type":"function","z":"50104e94.8152b8","name":"Rotate Entries","func":"var dashboardLog = context.get('dashboardLog')|| [];\n \ndashboardLog.push(msg);\nif (dashboardLog.length > 20) {\n // Delete oldest message if > 20\n dashboardLog.shift();\n dashboardLog.length = 20;\n} \n \n// store the value back\ncontext.set('dashboardLog',dashboardLog);\n \n// make it part of the outgoing msg object\nmsg = {};\nmsg.payload = dashboardLog;\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":220,"wires":[["f4ef2a5d.f01c18"]]},{"id":"bd901793.899028","type":"join","z":"50104e94.8152b8","name":"Prepare Message","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\r\\n\\r\\n","joinerType":"str","accumulate":false,"timeout":"","count":"5","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":710,"y":160,"wires":[["2e0650.3ce4e9b"]]},{"id":"f4ef2a5d.f01c18","type":"ui_template","z":"50104e94.8152b8","group":"2bf72e51.a156aa","name":"Event Log","order":0,"width":"6","height":"4","format":"<ul>\n <li ng-repeat=\"x in msg.payload\">\n <font color=\"red\">{{x.topic}}</font>\n <ul>\n <li>{{x.payload}}</li>\n </ul>\n </li>\n</ul>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":900,"y":220,"wires":[[]]},{"id":"2e0650.3ce4e9b","type":"e-mail","z":"50104e94.8152b8","server":"smtp.gmail.com","port":"465","secure":true,"name":"","dname":"Send Email","x":910,"y":160,"wires":[]},{"id":"b8d3f654.c03e9","type":"comment","z":"50104e94.8152b8","name":"Fehlerüberwachung","info":"Überwacht /var/log/messages\nZeigt die letzten 20 Fehler in einem Log-Fenster\nZeigt die Gesamtzahl der Fehler\nSchickt Email nach 5 Fehlern mit Fehlerprotokoll","x":130,"y":80,"wires":[]},{"id":"d79a8eea.a905c","type":"ui_group","z":"","name":"Monitoring","tab":"a5b5c3f2.ffeeb8","disp":true,"width":"6","collapse":false},{"id":"2bf72e51.a156aa","type":"ui_group","z":"","name":"EventLog","tab":"a5b5c3f2.ffeeb8","disp":true,"width":"6","collapse":false},{"id":"a5b5c3f2.ffeeb8","type":"ui_tab","z":"","name":"Monitoring","icon":"dashboard"}]
Zusätzliche Node: https://www.npmjs.com/package/node-red-contrib-counter
Hey vielen Dank! Werde bei Gelegenheit ein bebilderten kommentierten Wiki Artikel draus machen, außer Du kommst mir zuvor ;-)
Kann ich gerne übernehmen. Deine Zeit ist besser in der Entwicklung investiert ;-)
https://github.com/hobbyquaker/RedMatic/wiki/Fehler%C3%BCberwachung-der-CCU
Du müsstest mir bitte noch den Screenshot Ordner hochladen. errorlog.zip
/var/log/messages
überwachen und Häufigkeit von ReGa-Fehlermeldungen ermitteln, bei überschreiten einer Häufigkeit x per Email benachrichtigen