Way to create monitors from the command line/ansible??

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
AlbertoHunter
Posts: 1
Joined: Mon Oct 26, 2020 12:54 pm

Way to create monitors from the command line/ansible??

Post by AlbertoHunter »

I have a ansible script that set up zoneminder in a new virtual machine, and then I manually added some monitors and changed some settings. I'm about to start screwing with mysql settings, meaning that afterwards I'll likely need to scrap the virtual machine and rebuild it. (It's be better to create the monitors from ansible anyway). Is there easy way to create the monitors from ansible (or from bash)? i see zmu, but I dont see a way to create the monitors from "zmu ---help".

The easiest option I see is that since the configs are in the mysql database, i should be able to do:
echo "insert into Monitors (Name, ServerId, Path, ...) values ('camera 1', 0, 'rtsp://{camera address}', ...);" | mysql
to create the monitors. and
echo "update Configs set Value = -2 where Name = 'ZM_LOG_LEVEL_DATABASE';" | mysql
to change settings.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Way to create monitors from the command line/ansible??

Post by Magic919 »

There's some previous work where someone set them up using the API. Sounds a lot nicer to me. viewtopic.php?t=23685
-
Post Reply