Zoneminder Stopped alert/email/notification

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
swanzm
Posts: 6
Joined: Wed Dec 09, 2020 3:25 pm

Zoneminder Stopped alert/email/notification

Post by swanzm »

Hey,

I noticed a few weeks ago that ZM was running but stopped in the console so none of the cameras were being recorded. I assume this was due to the power cut I had a few weeks earlier as the last recording stored was from that time period. I did some testing and was unable to duplicate the issue. I dont want it to be weeks again before I find out it has stopped so was hoping to set up a alert/email/notification to be alerted when it stops.

I am wondering is there some way to create an alert/email/notification so we are alerted when the recording stops. I found this viewtopic.php?t=23675 but its for an old version and just want to see if there is a inbuilt option.

I can send the logs from ZM to our SIEM and have it send the alert/email/notification but I need an example log to do that.

Here is the details of my ZM deployment.
ZM Version 1.32.3_4 running in a Freenas version 11.3-U5 Jail

Any help would be appreciated.
User avatar
iconnor
Posts: 2879
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Zoneminder Stopped alert/email/notification

Post by iconnor »

Use something like monit to monitor it.

Also, update to 1.34 series.
swanzm
Posts: 6
Joined: Wed Dec 09, 2020 3:25 pm

Re: Zoneminder Stopped alert/email/notification

Post by swanzm »

iconnor wrote: Wed Dec 09, 2020 11:18 pm Use something like monit to monitor it.

Also, update to 1.34 series.

this happened again.

Last week someone was robbed outside of my home it was not till i checked the cameras that i realised they were not recording.

I found an easy way to monitor zoneminder.

I created a script to check if it was running and if its not then start it.

here is the script incase anyone else in interested and crontab entry. Note this script also calls a python script that sends me a slack message when ZM is detected not to be running.

Bash Script

# Note shebangs and paths below will be different depending on the OS

Code: Select all

#!/usr/local/bin/bash

s=$(/usr/local/bin/zmpkg.pl status 2>/dev/null)
if [[ "$s" != "running" ]];
	then
		/usr/local/bin/zmpkg.pl start
		# send slack message optional
		/usr/local/bin/python3.7 /root/send_slack.py "<@UN123456> ZM Stopped Restarting" "https://hooks.slack.com/services/AAAAAAAA/BBBBBBBB/CCCCCCCCCCC"
fi
crontab entry
This checks if ZM is running every 10 minutes

Code: Select all

*/10 * * * * /usr/local/bin/bash /root/check_zm_status.sh
Post Reply