Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

XYMon Server Docker Container - I have always seemed to have issues setting up the server, clients not so much. I was happy to use this image as it enabled port/proxying easily as I wanted to serve XYMon over a different port and have NGinX proxy it. Change port below to 80 for regular http port.

https://hub.docker.com/r/deweysasser/xymon/
https://deweysasser.com/content/introducing-docker-xymon

Docker-Compose:

WD=/opt/xymon
mkdir -p $WD/{mnt,setup}
cd $WD/setup
cat << 'EOF' >docker-compose.yaml
version: '3.7'

services:
 xymon-server:
    container_name: xymon-server
    hostname: xymon-server
    image: deweysasser/xymon
    ports:
      - 1984:1984
      - 8984:80
    volumes:
      - type: bind
        source: /opt/xymon/conf/
        target: /etc/xymon
      - type: bind
        source: /opt/xymon/data/
        target: /var/lib/xymon

    environment:
      - 'TZ=America/Whitehorse'
EOF
chmod +x docker-compose.yaml


Note: I had issues w/ my "local" non-docker xymon-client looking for server files, the following fixed it though. I believe the issue was I had to purge the server/client locally installed as it thought I had a local xymon server installed (the client). Doing a purge fixed it for me.

Also, be patient, it takes a minute to populate. I was able to use "127.0.0.1" as the server in the client config and in "hosts.cfg" for the server to monitor the docker-host, but it took a few minutes to show up.

cd /usr/lib/xymon/
ln -s client/ server/
WD=/opt/xymon-server/setup
cat << EOF >$WD/xymon-server.service.setup.sh
cat << EOL >/lib/systemd/system/xymon-server.service
[Unit]
Description=xymon-server_Docker
Requires=docker.service network-online.target

[Service]

Restart=on-abnormal
ExecStart=/usr/bin/docker-compose --project-name xymon-server --project-directory $WD -f $WD/docker-compose.yaml up
ExecStop=/usr/bin/docker-compose --project-name xymon-server --project-directory $WD -f $WD/docker-compose.yaml stop

[Install]
WantedBy=multi-user.target
EOL
systemctl enable xymon-server
systemctl start xymon-server
EOF
chmod +x $WD/xymon-server.service.setup.sh
$WD/xymon-server.service.setup.sh
echo "alias xymoncli='docker exec -it xymon-server /bin/bash'" >> ~/.bashrc
source ~/.bashrc
xymoncli
  • No labels