Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. iobroker und telegraf [gelöst]

    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

    iobroker und telegraf [gelöst]

    This topic has been deleted. Only users with topic management privileges can see it.
    • jahnbes
      jahnbes @liv-in-sky last edited by jahnbes

      @liv-in-sky

      Nun ist es geschafft, die Systemdaten des Windows-PC werden auf diesem mittels Telegraf gesammelt und mit MQTT an den iobroker gesandt, der auf einem Raspberry Pi läuft.
      Von dort aus erfolgt u.a. die Visualisierung mit HABpanel:

      dashboard_PC.jpg

      Die Daten der Netzwerkplatte, ein Synology-NAS, kommen über den Adapter "Synology NAS" in den iobroker.

      Die Temperaturen im PC würde ich auch gern darstellen, da bin ich aber auch mit Telegraf noch nicht rangekommen.

      liv-in-sky 3 Replies Last reply Reply Quote 1
      • liv-in-sky
        liv-in-sky @jahnbes last edited by

        @jahnbes die temp sache check ich auch nicht

        mache das so (etwas umständlich):

        https://forum.iobroker.net/topic/27520/cpu-temperatur-win-pc-in-iobroker-darstellen

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

          @jahnbes

          bin etwas weiter mit temp in telegraf

          Image 4.png

          Image 5.png

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

            @jahnbes

            das hier downloaden und laufen lassen - als service oder beim startup - zum testen einfach aufrufen

            https://openhardwaremonitor.org/

            das in conf:

            
             
            [[inputs.exec]]
               interval = "30s"
               commands = ['powershell -executionpolicy bypass -File "C:/Program Files/telegraf/ohm.ps1"']
               #data_format = "influx"
            

            das hier in den ordner, wo telegraf läuft - muss als file dort liegen:

            ohm.ps1

            im mqtt setting auf influx umstellen !

            data_format = "influx"
            
            
            

            das hier enablen - darunter steht nix - nur diese zeile - ist die temp des motherboards

            [[inputs.temp]]
            
            1 Reply Last reply Reply Quote 0
            • liv-in-sky
              liv-in-sky @jahnbes last edited by

              @jahnbes

              falls du mit meinem script arbeitest: - alle dp löschen und dieses script starten

              update

              let myScheduleTelegraf='*/30 * * * * * '
              
              schedule(myScheduleTelegraf,  function () {
              //iter(helper)
              $('mqtt.0.telegraf.*.*').each(function(id, i) { 
              //log(helper.fields.MB_frei)
              let helper=JSON.parse(getState(id).val)
              //log(helper.name+"ID: "+id)
              let derName=helper.name
              let derHostname=helper.tags.host
              var keys = Object.keys(helper.fields);
               
               //  log(keys.toString())
              
              
              for(let u=0;u<keys.length;u++){
                let theVal=helper.fields[keys[u]]
                let einheit=""
                if(keys[u].includes("ercent")  ) {theVal=Math.round(theVal);einheit="%"}
                if(theVal>100 && derName=="mem" ) {theVal=Math.round(theVal/1024/1024/1024);einheit="GB"}
                if(theVal>100 && derName.includes("disk") ) {theVal=Math.round(theVal/1024);einheit="GB"}
                 if(theVal<=100 && derName.includes("temp") ) {einheit="°C"}
                //log(helper.fields[keys[u]])
                 if(existsState('0_userdata.0.TELEGRAF.'+derHostname+'.'+derName+'.'+keys[u])) setState('0_userdata.0.TELEGRAF.'+derHostname+'.'+derName+'.'+keys[u],theVal);
                      else createState('0_userdata.0.TELEGRAF.'+derHostname+'.'+derName+'.'+keys[u], theVal, { name: derHostname+'-'+keys[u],unit: einheit}); // type: "mixed"
              }
              
              
              });
              
              });
              

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

                @liv-in-sky

                Ich habe es mir angesehen und eine Frage. Du setzt an einer Stelle

                data_format = "influx"
                

                Für meine Anwendung muss ich aber

                data_format = "json"
                

                setzen. Beißt sich das nicht, oder habe ich etwas falsch verstanden?

                Gruß Bert.

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

                  @jahnbes ist verwirrend

                  aber anders geht es nicht - sonst funkt. der hardware manager nicht - bzw die daten

                  bei mir kommt trotzdem alles richtig an -
                  Image 2.png

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

                    @jahnbes nee - warte nochmal - überprüfe gerade

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

                      @jahnbes

                      bei mqtt setting - ist json
                      bei dem

                      [[inputs.exec]]
                      
                         interval = "30s"
                      
                         commands = ['powershell -executionpolicy bypass -File "C:/Program Files/telegraf/ohm.ps1"']
                      
                         #data_format = "influx"
                      

                      ist das dataformat auskommentiert

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

                        @liv-in-sky

                        Ok, ich hatte gepennt. Danke!

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate
                        FAQ Cloud / IOT
                        HowTo: Node.js-Update
                        HowTo: Backup/Restore
                        Downloads
                        BLOG

                        425
                        Online

                        31.9k
                        Users

                        80.1k
                        Topics

                        1.3m
                        Posts

                        2
                        24
                        2489
                        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