Schlagwort: raspberrypi

Leave a reply

TimeLapse with DSLR and RaspberryPi

You can use your RaspberryPi to create a perfect TimeLapse-System using Gphoto2. You can easy install it by typing following

sudo apt-get install gphoto2  


gphoto2 --auto-detect

you can see if and what camera is connected. Then (if you want to record on the SD Card) you have to check the „location“ of your memory card

gphoto2 --get-config capturetarget

the output should look like:

pi@raspberrypi:~ $ gphoto2 --get-config capturetarget
Label: Capture Target                                                          
Readonly: 0
Current: Internal RAM
Choice: 0 Internal RAM
Choice: 1 Memory card

Now we can set the capture target to the Memory Card with this command:

photo2 --set-config capturetarget=1

Now you can use following command to take pictures and save them direct to your SD Card

gphoto2 -–capture-image  

For timelapes I would recommend that you use the screen command to build a virtual terminal session and easy detach and attach this again
Link to Screen Help

Now you can start your photograph session with this command.
-I defines how long you want to wait between the pictures
-F defines how many pictures you want to take

gphoto2 -I 20 -F 10000 --capture-image 

If you want to download the pictures to your Raspberry Pi’s SD card you have to use following:

gphoto2 --capture-image-and-download

All other commands can be found here LINK

Leave a reply

Network Monitoring with Zabbix

My home network is not the network normal people have.
I have 2 different locations which are booth equipped with Zyxel USG Firewalls and a Site-to-Site VPN. I do my Synology Backups into the other location or use the Smart Home over booth places. Often my mother in law (she is living in one of the locations too) is telling me that the network is not good. With this error message it is not very easy to discover the problem. Sometimes it is the internet itself but often it is the wifi or even her internet radio device (Bose Soundtouch) . After installing a RaspberryPi with the speedtest-cli its starting to get easier for me to discover if the internet is slow. But i want more 🙂 So I started to use Zabbix.
Zabbix is an Open-Source-Network-Monitoring-System. It is similar to Nagios but gives you the opportunity to manage everything over the web-interface. So my basic plans are:

  1. Install Zabbix on my Synology with Docker
  2. Install Zabbix Proxy on a RaspberryPi for the second location
  3. Create Backup from Zabbix Database

1 Install Zabbix on my Synology with Docker (via Terminal, if you want to do it with the GUI please follow this LINK. First you have to create the folders in the Folder „/volume1/docker/Zabbix/“. If you are using more than one Volume please make sure that you have the correct path. Create then Zabbix folder in the docker folder. Then download this folder-preset DOWNLOAD and load them into the Zabbix folder. Now you can access your Synology via SSH an copy following command.

sudo docker run -d --restart always --name Zabbix-Server -e PHP_TZ:Europe/Vienna -e ZBX_CACHESIZE=1000M -e ZBX_SERVER_NAME:VSZabbixServer -v /volume1/docker/Zabbix/alertscripts:/usr/lib/zabbix/alertscripts  -v /volume1/docker/Zabbix/externalscripts:/var/lib/zabbix/externalscripts  -v /volume1/docker/Zabbix/modules:/var/lib/zabbix/modules  -v /volume1/docker/Zabbix/enc:/var/lib/zabbix/enc  -v /volume1/docker/Zabbix/ssh_keys:/var/lib/zabbix/ssh_keys  -v /volume1/docker/Zabbix/ssl/certs:/var/lib/zabbix/ssl/certs  -v /volume1/docker/Zabbix/ssl/keys:/var/lib/zabbix/ssl/keys -v /volume1/docker/Zabbix/ssl/ssl_ca:/var/lib/zabbix/ssl/ssl_ca -v /volume1/docker/Zabbix/snmptraps:/var/lib/zabbix/snmptraps -v /volume1/docker/Zabbix/mibs:/var/lib/zabbix/mibs -v /volume1/docker/Zabbix/nginx:/etc/ssl/nginx -p 10052:443 -p 10050:80 -p 10051:10051 -d zabbix/zabbix-appliance:ubuntu-4.4-latest

Now you can login to the Zabbix Webinterface using the Synology IP and the port 10050

Username: Admin
Passwort: zabbix

Connecting to the Zabbix Docker via bash is able with following command:

docker exec -ti Zabbix-Server /bin/bash

Getting the logs with following

 docker logs Zabbix-Server

Backup the Database:
The most important settings are all stored in the Database. The easiest and most secure way to save them is to export all the Data at a specific time and store them on the Synology Raid. Please do not forget to follow this help LINK

Zabbix PROXY

With a Zabbix Proxy you can monitore a network remote without having access to the lokal network from your Zabbix Server. If you are using hardware which can use Docker I would recommend to install it with this script DOWNLOAD. Then you can use following command. Do not forget to change
ZBX_HOSTNAME=“you have to set this name in the Zabbix Server too „
ZBX_SERVER_HOST=“IP Adress of the Zabbix Server“

docker run -d --restart always --name some-zabbix-proxy-sqlite3 -e ZBX_HOSTNAME=2100-BigMama-Proxy -e ZBX_SERVER_HOST= -d zabbix/zabbix-proxy-sqlite3:ubuntu-4.4-latest

If you want to use a RaspberryPi you have to install it without Docker. Here is my solution for a fast install including the setup for the agent Download
Do not forget to change

# automated install csript for zabbix 4.4 Install
# helped by
# check the client zabbix version with this link:
#Don't forget to change following:

hostname=$(hostname -s)

sudo apt install -y snmp-mibs-downloader
sudo wget
sudo dpkg -i zabbix-release_4.4-1+buster_all.deb
apt update
apt install -y zabbix-proxy-sqlite3 zabbix-agent zabbix-sender zabbix-get

#create RAM Disk
sudo echo "tmpfs /var/ramdisk tmpfs nodev,nosuid,relatime,size=100M 0 0" >> /etc/fstab
sudo mkdir -p /var/ramdisk
sudo chmod 0777 /var/ramdisk
sudo mount -a

#configure ProxyServer
sudo echo -e "Server=$ZabbixDestinationServer \nHostname=$ZabbixProxyHostName \nTimeout=30 \nEnableRemoteCommands=1 \nLogRemoteCommands=1 \nLogFile=/var/ramdisk/zabbix_proxy.log \nLogFileSize=4 \nDBName=/var/ramdisk/zabbixproxy.db" >> /etc/zabbix/zabbix_proxy.conf
sudo systemctl enable zabbix-proxy.service
sudo systemctl start zabbix-proxy
#LOG ls -l /var/ramdisk/

#confige Agent
#sudo sed -i 's/Server='$ZabbixDestinationServer'/g' /etc/zabbix/zabbix_agentd.conf
sudo echo -e "Hostname=$hostname \nLogFile=/var/ramdisk/zabbix_agentd.log \nLogFileSize=1 \nTimeout=30 \nUnsafeUserParameters=1 \nEnableRemoteCommands=1 \nLogRemoteCommands=1" >> /etc/zabbix/zabbix_agentd.conf
sudo systemctl enable zabbix-agent.service
sudo systemctl start zabbix-agent.service
#LOG cat /var/ramdisk/zabbix_agentd.log

Zabbix Agent

You can easy install the Zabbix Agent on Linux (Ubuntu/Debian) machines by using following script
Do not forget to change

# automated install script for zabbix agent
# helped by
# check the client zabbix version with this link:
# Don't forget to change following:

hostname=$(hostname -s)

sudo apt install -y zabbix-agent

sudo echo "tmpfs /var/ramdisk tmpfs nodev,nosuid,relatime,size=100M 0 0" >> /etc/fstab
sudo mkdir -p /var/ramdisk
sudo chmod 0777 /var/ramdisk
sudo mount -a

sudo sed -i 's/Server='$zabbix_server'/g' /etc/zabbix/zabbix_agentd.conf
sudo echo -e "Hostname=$hostname \nLogFile=/var/ramdisk/zabbix_agentd.log \nLogFileSize=1 \nTimeout=30 \nUnsafeUserParameters=1 \nEnableRemoteCommands=1 \nLogRemoteCommands=1" >> /etc/zabbix/zabbix_agentd.conf
sudo systemctl enable zabbix-agent.service
sudo systemctl start zabbix-agent.service
#LOG cat /var/ramdisk/zabbix_agentd.log

If you want to create the folder from part 1 with a script you can use following:

# /bin/bash
# create folders for zabbix_server

mkdir -p \
/volume1/docker/Zabbix/alertscripts \
/volume1/docker/Zabbix/externalscripts \
/volume1/docker/Zabbix/modules \
/volume1/docker/Zabbix/enc \
/volume1/docker/Zabbix/ssh_keys \
/volume1/docker/Zabbix/ssl/certs \
/volume1/docker/Zabbix/ssl/keys \
/volume1/docker/Zabbix/ssl/ssl_ca \
/volume1/docker/Zabbix/snmptraps \
/volume1/docker/Zabbix/mibs \

Change 2020 07 16
After getting a lots of „[file:dbconfig.c,line:94] zbx_mem_malloc(): out of me mory “ Errors while starting the stopped Zabbix Server I recognised that it will be an issue with the Cache so i added „-e ZBX_CACHESIZE=1000M“ to the Zabbix Server command

Thanks to Rainhardt Gabriel for the idea

1 Reply

Synology – Backup to RaspberryPi

Using „HyperBackup“ to create Backups is the best and easiest way to save all your data and settings on your Synology. Finding a target to backup is not that easy. You can buy an other Synology Produkt or set up an Linux Server. My Solution is a Raspberry Pi with Raspbian / Raspberry Pi OS and an external USB Drive attached. Installing and mounting the USB drive has to be done before you can use this help to install the RSYNC-Server.

Mount your external device and make sure that it will be always mounted automatically after restarts.
In our example we use the path /mnt/USBDevice

First you have to install the rsync service, use following command:

sudo apt-get install rsync

After the successful installation you can change following config file.
you can do this by typing

sudo nano /etc/default/rsync

and change following lines




now exit the nano editor with „Control +x“ and accept the changes with „Y“ (if you are using a mac)

Now you can create the rsyncd.conf file by following command:

sudo nano /etc/rsyncd.conf

copy this content into the file and change the parameters to your settings

max connections = 2
log file = /var/log/rsync.log
timeout = 300
comment = This folder will be shared for rsync backups
path = /mnt/USBDevice
read only = no
list = yes
uid = root
gid = root # fĂĽr PI
# gid = wheel # fĂĽr macOS
auth users = syno
secrets file = /etc/rsyncd.secrets.syno

now we have to set the password for the user syno by typing

sudo nano /etc/rsyncd.secrets.syno

and add following: (please do not forget to change the password)


exit the nano editor and change the user rights for the password file with following command:

sudo chmod 600 /etc/rsyncd.secrets.syno

and add the user to the system

sudo adduser syno --system --group --no-create-home --shell /bin/false

Restart the rsync service to load the new config

sudo systemctl restart rsync.service 

Now you can login to your Synology and Download the HyperBackup in the Package Center and add a new Data Backup task

Data Backup Task

Choose „rsync“ as option an clock on Next

Now you can choose „rsync-compatible server“ add the IP address, user and password. When you click on the Backup Module you should get the same name you have set in the /etc/rsyncd.conf file. Follow the the next steps like you want to have it.

Typical Error Messages:

  1. „Authentication failed. Please check your authentication credentials“

    Make sure that you have the right password and that you have created the same local user.
Authentication failed. Please check you authentication credentials
  1. Failed to establish the SSH connection. Please make sure that your credentials are correct, the SSH service of the destination server is normal, and the 2-step verfication is not enabled before trying again.

    May you have the wrong Port. Make sure that you use 873.
Failed to establish the SSH connection. Please make sure that your credentials are correct, the SSH service of the destination server is normal, and the 2-step verfication is not enabled before trying again.

Restoring files you can use follwing information
Restore Data from Synology Hyper Backup local

Thanks to following homepages helping me to create this manual:
Framp’s Linux Tips and Tricks

and thanks to following helpers:
Thomas Böhm ( for the Mac Version

If you want to backup to an Apple Device with you have to create an LaunchDaemon


with following content

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

the default path for you rsync should be


If not change it in the plist file to the correct one

now you can start the Deamon with

launchctl load /Library/LaunchDaemons/org.samba.rsync.plist

Durch die weitere Nutzung der Seite stimmst du der Verwendung von Cookies zu. Weitere Informationen

Die Cookie-Einstellungen auf dieser Website sind auf "Cookies zulassen" eingestellt, um das beste Surferlebnis zu ermöglichen. Wenn du diese Website ohne Änderung der Cookie-Einstellungen verwendest oder auf "Akzeptieren" klickst, erklärst du sich damit einverstanden.