Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Logging, Syslog or HTTP

    Scheduled Pinned Locked Moved
    Firmware wishlist
    logging splunk syslog http-event-collector
    3
    6
    363
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • justus2342undefined
      justus2342
      last edited by

      I would like to connect my Printer (Duet2E) to my splunk instance.
      At the moment I have to pull the logs via ftp every minute. That is neither elegant nor real-time.

      I know, there is rr_status, but that is also pull and not push.

      I would like the reprap-firmware to push the events via Syslog or http(s) to my splunk instance.

      Especially push via http(s) is modern and easy, it is nothing more than a JSON-blob in a http-request:

      curl -k -u "x:CF179AE4-3C99-45F5-A7CC-3284AA91CF67" "https://mysplunkserver.example.com:8088/services/collector/event" \
          -d '{"sourcetype": "mysourcetype", "event": "Hello, world!"}'
      

      where CF179AE4-3C99-45F5-A7CC-3284AA91CF67is some authentication-token.

      Furthermore http(s) and syslog are not only relevant for splunk but also for other logging platforms. For Example collectd also uses http(s) to send logevents.

      Tevo Little Monster (Duet2, Smart Effector, lin Rails, Magb. Arms)
      Anycubic Delta Linear Plus (Duet2, Smart Effector, Magb. Arms)
      Two Trees Sapphire Pro (MKS Robin, Marlin 2.x, D. Extruder)

      1 Reply Last reply Reply Quote 0
      • resamundefined
        resam
        last edited by

        AFAIK there is currently no functionality in RepRapFirmware to open outgoing HTTP or TCP connections, let alone "running a simple curl command" directly from the microcontroller. I would be surprised if there is enough computational power to handle TLS, and a full TCP stack - while also doing an actual print at the same time. You might be able to offload the TCP heavy-lifting to the ESP or Ethernet module...

        If you are running a Duet3 with a SBC - then of course you can run something on the SBC.

        1 Reply Last reply Reply Quote 0
        • A Former User?
          A Former User
          last edited by

          closest you'll get is M118, which a connected telnet client can listen for.

          or with rrf 3.2 you can also use a raspberry pi with duet 2, just like duet 3, and use the pi to run a shell script from g-code f.ex.

          justus2342undefined 1 Reply Last reply Reply Quote 1
          • justus2342undefined
            justus2342 @A Former User
            last edited by

            @bearer said in Logging, Syslog or HTTP:

            or with rrf 3.2 you can also use a raspberry pi with duet 2, just like duet 3, and use the pi to run a shell script from g-code f.ex.

            That really sounds very (very!) good. Can't wait for it.

            But how is this going to work in detail? I read (well, okay: skim-read) the readme from dsf. According to this we have

            • DuetControlServer
            • DuetWebServer
            • Tools (?)

            As far as I can tell the DuetControl Server looks most promising, but where does it write its logs? Just to default system log? If not where?
            Does this log differ anyhow from the log one can create with M929?

            Tevo Little Monster (Duet2, Smart Effector, lin Rails, Magb. Arms)
            Anycubic Delta Linear Plus (Duet2, Smart Effector, Magb. Arms)
            Two Trees Sapphire Pro (MKS Robin, Marlin 2.x, D. Extruder)

            1 Reply Last reply Reply Quote 0
            • A Former User?
              A Former User
              last edited by

              this is probably by far the simplest approach https://forum.duet3d.com/topic/13194/dsf-extension-exec-on-mcode-was-shutdown-sbc

              justus2342undefined 1 Reply Last reply Reply Quote 0
              • justus2342undefined
                justus2342 @A Former User
                last edited by

                @bearer said in Logging, Syslog or HTTP:

                this is probably by far the simplest approach https://forum.duet3d.com/topic/13194/dsf-extension-exec-on-mcode-was-shutdown-sbc

                So your idea is that I do something like this?

                M2342 F"my log message"
                

                Yes this is a nice option to have for custom log messages, but actually I was after system logs. Something like:

                • system started, RRF Version 3.2.xx
                • heater 0 configured
                • network initiated: got ip 12.34.56.78 via DHCP-server at 12.34.56.1
                • User $username logged in via webinterface from 12.34.56.23
                • leveling started from PanelDue
                • leveling done
                • homing successfull
                • ran macro "load-filament.g"
                • started job: "myprintjob.g"
                • error: heater fault on heater N
                • canceled(/stopped/resumed) job "myprintjob.g" for reason X after HH:MM:SS
                • [...]

                That should go to some default log-file automatically, doesn't it?

                Tevo Little Monster (Duet2, Smart Effector, lin Rails, Magb. Arms)
                Anycubic Delta Linear Plus (Duet2, Smart Effector, Magb. Arms)
                Two Trees Sapphire Pro (MKS Robin, Marlin 2.x, D. Extruder)

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA