Way to create monitors from the command line/ansible?
Posted: Tue Sep 22, 2020 5:06 pm
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.
Given that I already know bash and sql, is there any easier options for me that I'm missing?
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.
Given that I already know bash and sql, is there any easier options for me that I'm missing?