- Observe plc state of a simatic plc using snap7.
- Send push notifications via pushover-api in case of plc left RUN state.
- Run as a linux-daemon process
- sudo add-apt-repository ppa:gijzelaar/snap7
- sudo apt-get update
- sudo apt-get install libsnap7-dev libsnap7-1
- sudo apt-get install libcurl4-gnutls-dev
- sudo apt-get install rapidjson-dev
- cd Release
- make clean all
- cd ..
- sudo cp Release/plcwatchd /usr/local/bin/
- cp plcwatchd.service.draft ../plcwatchd.service
- vi plcwatchd.service
- sudo cp plcwatchd.service /etc/systemd/system
- sudo systemctl enable plcwatchd
- sudo systemctl start plcwatchd
- sudo systemctl stop plcwatchd
- sudo systemctl status plcwatchd or
- ps aux | grep plcwatchd
There is also a docker image:
docker pull feilner/plcwatchd
PUSHOVER_KEY
pushover.net user key (mandatory)PUSHOVER_TOKEN
pushover.net appliacation token (mandatory)PLC_IP
address of the plc (mandatory)CLI_ARGS
optional command line interface args to plcwatchd (optional)
Optional arguments to plcwatchd can added by the optional CLI_ARGS
-v verbose
-p polling rate of the PLC state in seconds, default 10
-c retry - pushover.net retry parameter in seconds, default 60
-e expire - pushover.net expire parameter in seconds, default 600
-u user - pushover.net comma seprated device list e.g. "deviceOne,deviceTwo", default all devices
-r rack - rack of the plc, default 0
-s slot - slot of the plc, default 2
docker run -it --rm -e PUSHOVER_KEY=pushoverKey -e PUSHOVER_TOKEN=pushoverToken -e PLC_IP=plcIP -e CLI_ARGS "-u pushoverDeivce" feilner/plcwatchd
plcwatchd:
image: feilner/plcwatchd
container_name: plcwatchd
restart: always
environment:
- PUSHOVER_KEY=pushoverKey
- PUSHOVER_TOKEN=pushoverToken
- PLC_IP=plcIP
- CLI_ARGS="-u pushoverDeivce"