How to make a log server on OMV?

    • OMV 2.x
    • How to make a log server on OMV?

      Hello there,

      I guess it's a rather simple question, but I never found straightforward instructions or a plugin in OMV that would allow creating a log server in OMV with an elegant, web-based view of logs issued by different devices.

      Rationale: OMV runs off a single USB hard drive. It is quite silent, and for this reason, OMV tends to be the one network device that never goes to sleep.
      Comparison: I know Synology OS offers such a facility one two clicks away in their log viewer.

      How would I get a similar view in OMV?
    • It is real easy. I will file a feature request on bugtracker. Until then, create the the following file on the server receiving the syslog messages:

      (As root)

      nano /etc/rsyslog.d/incoming.conf

      Source Code

      1. $ModLoad imudp
      2. $UDPServerRun 514
      3. $ModLoad imtcp
      4. $InputTCPServerRun 514

      ctrl-o to save, ctrl-x to exit
      service rsyslog restart

      Then enable remote logging in the OMV web interface on the box sending the messges:
      Go to Diagnostics -> System Logs -> Settings
      Click Enable and fill in remote server's IP or name
      omv 4.1.13 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • If you follow the instructions I gave you, OMV will accept syslog messages from other servers. You can view those in syslog on OMV.

      What is showing a loading grey box?
      omv 4.1.13 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • I have no idea why that would happen. Maybe the log is too big now and you system is slow and times out. Did you look at syslog from the command line to see if entries are being logged? How big is the syslog log file.
      omv 4.1.13 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • /var/log/messages

      An RPi is definitely not fast especially if you have a slow SD card. While the flashmemory tries to store logs in memory, you might run out of memory and then it moves some of that data to the SD card.
      omv 4.1.13 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • The OS is on the hard drive?

      my messages is:

      -rw-r----- 1 root adm 13K Apr 11 17:00 messages

      Ram may be low but the RPi's cpu is slow. If your setup is on a usb hard drive, it is hard to say what is going on.
      omv 4.1.13 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • As per recommendations I received here about SD card unreliability, I installed OMV on the USB drive, indeed. The CPU is also overclocked to 900MHz, and has a heatsink.

      I downloaded "messages" through SFTP: maybe there's something interesting in it?

      Source Code

      1. Apr 9 18:39:06 pi-printer rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="11386" x-info="http://www.rsyslog.com"] start
      2. Apr 10 05:02:37 pi-printer cron-apt: CRON-APT RUN [/etc/cron-apt/config]: Sun Apr 10 04:00:01 EDT 2016
      3. Apr 10 05:02:37 pi-printer cron-apt: CRON-APT SLEEP: 2292, Sun Apr 10 04:38:13 EDT 2016
      4. Apr 10 05:02:37 pi-printer cron-apt: CRON-APT ACTION: 0-update
      5. Apr 10 05:02:37 pi-printer cron-apt: CRON-APT LINE: /usr/bin/apt-get -o Acquire::http::Dl-Limit=25 update -o quiet=2
      6. Apr 10 05:02:37 pi-printer cron-apt: W: Failed to fetch https://dl.bintray.com/openmediavault-plugin-developers/stoneburner-sync/dists/wheezy/main/binary-armhf/Packages Operation too slow. Less than 10 bytes/sec transferred the last 120 seconds
      7. Apr 10 05:02:37 pi-printer cron-apt:
      8. Apr 10 05:02:37 pi-printer cron-apt: E: Some index files failed to download. They have been ignored, or old ones used instead.
      9. Apr 10 08:19:38 pi-printer cron-apt: CRON-APT RUN [/etc/cron-apt/config]: Sun Apr 10 07:35:40 EDT 2016
      10. Apr 10 08:19:38 pi-printer cron-apt: CRON-APT SLEEP: 1174, Sun Apr 10 07:55:14 EDT 2016
      11. Apr 10 08:19:38 pi-printer cron-apt: CRON-APT ACTION: 0-update
      12. Apr 10 08:19:38 pi-printer cron-apt: CRON-APT LINE: /usr/bin/apt-get -o Acquire::http::Dl-Limit=25 update -o quiet=2
      13. Apr 10 08:19:38 pi-printer cron-apt: W: Failed to fetch https://dl.bintray.com/openmediavault-plugin-developers/stoneburner-sync/dists/wheezy/main/binary-armhf/Packages Operation too slow. Less than 10 bytes/sec transferred the last 120 seconds
      14. Apr 10 08:19:38 pi-printer cron-apt:
      15. Apr 10 08:19:38 pi-printer cron-apt: E: Some index files failed to download. They have been ignored, or old ones used instead.
      16. Apr 11 05:23:26 pi-printer cron-apt: CRON-APT RUN [/etc/cron-apt/config]: Mon Apr 11 04:00:01 EDT 2016
      17. Apr 11 05:23:26 pi-printer cron-apt: CRON-APT SLEEP: 3541, Mon Apr 11 04:59:02 EDT 2016
      18. Apr 11 05:23:26 pi-printer cron-apt: CRON-APT ACTION: 0-update
      19. Apr 11 05:23:26 pi-printer cron-apt: CRON-APT LINE: /usr/bin/apt-get -o Acquire::http::Dl-Limit=25 update -o quiet=2
      20. Apr 11 05:23:26 pi-printer cron-apt: W: Failed to fetch https://dl.bintray.com/openmediavault-plugin-developers/stoneburner-sync/dists/wheezy/main/binary-armhf/Packages Operation too slow. Less than 10 bytes/sec transferred the last 120 seconds
      21. Apr 11 05:23:26 pi-printer cron-apt:
      22. Apr 11 05:23:26 pi-printer cron-apt: E: Some index files failed to download. They have been ignored, or old ones used instead.
      23. Apr 11 08:04:14 pi-printer cron-apt: CRON-APT RUN [/etc/cron-apt/config]: Mon Apr 11 07:35:39 EDT 2016
      24. Apr 11 08:04:14 pi-printer cron-apt: CRON-APT SLEEP: 250, Mon Apr 11 07:39:49 EDT 2016
      25. Apr 11 08:04:14 pi-printer cron-apt: CRON-APT ACTION: 0-update
      26. Apr 11 08:04:14 pi-printer cron-apt: CRON-APT LINE: /usr/bin/apt-get -o Acquire::http::Dl-Limit=25 update -o quiet=2
      27. Apr 11 08:04:14 pi-printer cron-apt: W: Failed to fetch https://dl.bintray.com/openmediavault-plugin-developers/stoneburner-sync/dists/wheezy/main/binary-armhf/Packages Operation too slow. Less than 10 bytes/sec transferred the last 120 seconds
      28. Apr 11 08:04:14 pi-printer cron-apt:
      29. Apr 11 08:04:14 pi-printer cron-apt: E: Some index files failed to download. They have been ignored, or old ones used instead.
      Display All

      But nothing recent: it's now past 22h30, and no explanation as to why I get the "Communication failure" message.

      On the other hand, there's /var/log/syslog that's 190MB (!), and /var/log/daemon.log at 298MB. I am not sure yet what these would log, but they seem enormous for raw text files, and less surprised now that the webGUI can't open them.

      syslog's extract:

      Source Code

      1. Apr 11 22:45:17 pi-printer monit[2670]: 'fs_media_55160f00-ef96-4d29-a237-54630f792bf9' space usage 82.5% matches resource limit [space usage>80.0%]
      2. Apr 11 22:45:38 pi-printer rrdcached[2301]: queue_thread_main: rrd_update_r (/var/lib/rrdcached/db/localhost/memory/memory-buffered.rrd) failed with status -1. (/var/lib/rrdcached/db/localhost/memory/memory-buffered.rrd: illegal attempt to update using time 1460429102 when last update time is 1467868377 (minimum one second step))
      3. Apr 11 22:45:38 pi-printer rrdcached[2301]: queue_thread_main: rrd_update_r (/var/lib/rrdcached/db/localhost/memory/memory-cached.rrd) failed with status -1. (/var/lib/rrdcached/db/localhost/memory/memory-cached.rrd: illegal attempt to update using time 1460429102 when last update time is 1467868377 (minimum one second step))
      4. Apr 11 22:45:38 pi-printer rrdcached[2301]: queue_thread_main: rrd_update_r (/var/lib/rrdcached/db/localhost/memory/memory-free.rrd) failed with status -1. (/var/lib/rrdcached/db/localhost/memory/memory-free.rrd: illegal attempt to update using time 1460429102 when last update time is 1467868377 (minimum one second step))
      5. Apr 11 22:45:38 pi-printer rrdcached[2301]: queue_thread_main: rrd_update_r (/var/lib/rrdcached/db/localhost/memory/memory-used.rrd) failed with status -1. (/var/lib/rrdcached/db/localhost/memory/memory-used.rrd: illegal attempt to update using time 1460429102 when last update time is 1467868377 (minimum one second step))
      6. Apr 11 22:45:42 pi-printer rrdcached[2301]: queue_thread_main: rrd_update_r (/var/lib/rrdcached/db/localhost/memory/memory-buffered.rrd) failed with status -1. (/var/lib/rrdcached/db/localhost/memory/memory-buffered.rrd: illegal attempt to update using time 1460429142 when last update time is 1467868377 (minimum one second step))
      7. Apr 11 22:45:42 pi-printer rrdcached[2301]: queue_thread_main: rrd_update_r (/var/lib/rrdcached/db/localhost/memory/memory-cached.rrd) failed with status -1. (/var/lib/rrdcached/db/localhost/memory/memory-cached.rrd: illegal attempt to update using time 1460429142 when last update time is 1467868377 (minimum one second step))
      8. Apr 11 22:45:42 pi-printer rrdcached[2301]: queue_thread_main: rrd_update_r (/var/lib/rrdcached/db/localhost/memory/memory-free.rrd) failed with status -1. (/var/lib/rrdcached/db/localhost/memory/memory-free.rrd: illegal attempt to update using time 1460429142 when last update time is 1467868377 (minimum one second step))
      9. Apr 11 22:45:42 pi-printer rrdcached[2301]: queue_thread_main: rrd_update_r (/var/lib/rrdcached/db/localhost/memory/memory-used.rrd) failed with status -1. (/var/lib/rrdcached/db/localhost/memory/memory-used.rrd: illegal attempt to update using time 1460429142 when last update time is 1467868377 (minimum one second step))
    • Unless you need them (copy them off somewhere), I would
      echo "" > /var/log/syslog
      echo "" > /var/log/daemon.log
      And then see if the viewer works. An RPi will struggle to display both of those files.

      The syslog errors are happening because your RPi doesn't have the write time and/or files have a bad timestamp (probably from moving to usb drive and getting a current correct timestamp).
      omv 4.1.13 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • I don't think I need them right now, but I would have liked to understand why CUPS fails most of the time. Anyway I got a copy of them both.

      After issuing the first command, I got

      a few seconds after switching to Syslog view in the web UI

      After issuing the second command, I got:


      Does this mean the log would be first written to SD card or RAM, then transferred to USB drive? And that the fraction of a second it takes to do so would be sufficient to get a mismatched timestamp?

      Considering these log files are too big for the RPi's power / RAM / USB 2.0 transfer speed, would there be an option to 1- cut logs in multiple parts once they reach a given size (useful on lower-power platforms) or 2- limit the number of events written each second? I think such options exist in other Linux-based distributions
    • This is the man page for rrdcached:
      oss.oetiker.ch/rrdtool/doc/rrdflushcached.en.html

      I tried to run it from what was present in the screen capture here posted, but it fails:

      Source Code

      1. rrdcached flushcached /var/lib/rrdcached/db/localhost/cpu-0/cpu-idle.rrd
      2. rrdcached: can't create pid file '/usr/var/run/rrdcached.pid' (File exists)
      3. FATAL: Another rrdcached daemon is running?? (pid 4180)
      4. rrdcached: daemonize failed, exiting.


      Worked after I killed PID 4180.

      But after a minute or so, I still get the same kind of error:


      From my understanding that still shouldn't happen, as rrdcached logged a "clean shutdown"


      What is not working there?

      All other search engine results are specific to given OS / application versions.