• 0 Posts
  • 5 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2025

help-circle
  • It depends on what it is. I do not have a singular documentation-platform or wiki for those things. I’m more of the keep the docs where the code is guy. I also try to keep complexity to a minimum.

    All my linux server setups are done with ansible. ansible itself is pretty self-documenting, as you more or less declare the desired outcome in YAML form and ansible does the rest. This way, I do not need to remember it, but it’s easier to understand when looking it up again.

    Most of my projects have a git repository, so most of what I need to know or do is documented

    • in a README.md
    • as pipeline-instructions inside .gitlab-ci.yml

    This way, I was able to reduce complexity and unify my homelab projects.

    My current homelab-state is:

    • most projects are now docker-based
    • most projects have a GitLab CI for automated updating to newer versions
    • the CI itself is a project and all my CI-docker-based deploys use this unified pipeline-project
    • most projects can be tested locally before rolling out new versions to my VMs
    • some projects have a production and a staging server to test
    • those which cannot be dockerized or turned into a CI are tools and don’t need that (e.g. ansible playbooks or my GitLab CI)

    On what to include, I always try to think: Will I still be able to understand this without documentation if I forget about the project for 6 months and need to make a change then? If you can’t be sure, put it in writing.

    If it’s just a small thing regarding not the project itself or the functionality or setup itself but rather something like I had to use this strange code-block here because of XXX, I’ll just put a comment next to the code-line or code-block in question. These comments mostly also include a link to a bug-report if I found one, so i can later check and see if it’s been fixed already.





  • I’m using CheckMK to monitor my hypervisor, physical hardware like disks, CPU etc. and SNMP-capable hardware like my pfSense firewall via a CheckMK instance in docker. It either works in docker or on a few different linux based OS like ubuntu and debian (see CheckMK download page).

    There’s a free and open source version (called raw edition, GitHub Link) which I am using. It comes with a lot of checks / plugins for monitoring stuff out of the box and if there’s something it doesn’t ship, you can easily create your own check in whatever language your server is capable of executing a binary of. Or you could look up if there’s a user-contributed plugin on the official CheckMK Exchange Platform.

    The whole configuration of this is based on rules with a lot of predefined rules and sane defaults already set.

    To have an example for your use-case: You can monitor docker-logfiles and let CheckMK warn you, if specific keywords are or are not in a logfile. You will then be able to view the offending lines in the monitoring UI.

    Why do I use this?

    • We use it at work
    • FOSS
    • docker makes updating this easy
    • can send mails, teams notifications, …
    • very customizable and expandable

    my docker compose file

    # docker-compose.yml
    
    services:
      monitoring:
        image: checkmk/check-mk-raw:2.4.0-latest
        container_name: monitoring
        restart: unless-stopped
        environment:
          - CMK_PASSWORD=changeme
        ports:
          # WEB UI port
          - "5000:5000"
          # agent communication port
          - "8000:8000"
          # used for SNMP
          - "162:162/udp"
          - "514:514/tcp"
          - "514:514/udp"
        volumes:
          - "./monitoring:/omd/sites"
          - /etc/localtime:/etc/localtime:ro
        env_file:
          - .env