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?

  • I run Webmin on all my servers. It has a good log viewing module.


    You can configure OMV's syslog to accept log messages from compatible remote devices.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

    • Offizieller Beitrag

    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

    Code
    $ModLoad imudp
    $UDPServerRun 514
    
    
    $ModLoad imtcp
    $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 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • And would that appear in Syslog in OMV? Because right now, it shows the "Loading" grey box in the middle of the screen, but ends up with an alert dialog "Communication failure". Not sure what is going wrong…

    • Offizieller Beitrag

    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 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    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?

    This:

    And it always ends up like this:


    Technically, maybe the logs are received by OMV, but it can't display the content of Syslog.

    • Offizieller Beitrag

    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 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    /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 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • This Pi runs off the USB hard disk, does the SD card has any influence past boot time?


    With an ls -al in /var/log, I get:


    Code
    -rw-r-----  1 root adm    1505754 Apr 11 08:04 messages


    1.5 megabyte. Is it considered large?
    BTW, the reported RAM usage is rather low.

    • Offizieller Beitrag

    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 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    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?


    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:

    Code
    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%]
    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))
    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))
    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))
    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))
    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))
    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))
    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))
    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))
    • Offizieller Beitrag

    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 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    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

  • Your time is not set correctly on the pi.
    syslog will not allow for the time running backwards.
    Correct the time
    Clear syslog
    reboot

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • I just checked with http://www.unixtime.de/ your time is right (12.04.2016 - 04:45:42) , but the last log entry is from 07.07.2016 - 07:12:57
    You have to get rid of the old rrd logs / caches, try to just delete them.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • This is the man page for rrdcached:
    http://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:


    Code
    rrdcached flushcached /var/lib/rrdcached/db/localhost/cpu-0/cpu-idle.rrd 
    rrdcached: can't create pid file '/usr/var/run/rrdcached.pid' (File exists)
    FATAL: Another rrdcached daemon is running?? (pid 4180)
    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.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!