<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.staging.zoneminder.com/index.php?action=history&amp;feed=atom&amp;title=API_Tricks%2FCreate_Monitors</id>
	<title>API Tricks/Create Monitors - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.staging.zoneminder.com/index.php?action=history&amp;feed=atom&amp;title=API_Tricks%2FCreate_Monitors"/>
	<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=API_Tricks/Create_Monitors&amp;action=history"/>
	<updated>2026-05-03T15:23:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=API_Tricks/Create_Monitors&amp;diff=7202&amp;oldid=prev</id>
		<title>Biloxigeek at 20:23, 23 November 2015</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=API_Tricks/Create_Monitors&amp;diff=7202&amp;oldid=prev"/>
		<updated>2015-11-23T20:23:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:23, 23 November 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l91&quot;&gt;Line 91:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Some notes ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Some notes ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*I tested it by stopping zoneminder, running &amp;quot;mysql -u root -p&amp;quot; and logging in.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*I tested it by stopping zoneminder, running &amp;quot;mysql -u root -p&amp;quot; and logging in.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use &lt;/del&gt;zm;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;drop database &lt;/ins&gt;zm; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;exit;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** drop table monitors;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** mysql -u root -p &amp;lt; /usr/share/zoneminder/db/zm_create.sql&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** exit;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** mysql -u root -p reload&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Any future use of this I&amp;#039;ll just do a &amp;quot;&lt;/ins&gt;drop table monitors;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot; in mysql and pull just the monitor table creation section out of the zm_create.sql script. That way all the global config won&amp;#039;t get touched.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Then restarted zoneminder and ran my script.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Then restarted zoneminder and ran my script.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Some wins:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Some wins:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Biloxigeek</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=API_Tricks/Create_Monitors&amp;diff=7201&amp;oldid=prev</id>
		<title>Biloxigeek at 20:06, 23 November 2015</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=API_Tricks/Create_Monitors&amp;diff=7201&amp;oldid=prev"/>
		<updated>2015-11-23T20:06:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:06, 23 November 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[API_Tricks|Back to list of Tricks.]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Creating Multiple Monitors ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Creating Multiple Monitors ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Biloxigeek</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=API_Tricks/Create_Monitors&amp;diff=7200&amp;oldid=prev</id>
		<title>Biloxigeek: Created page with &quot;__TOC__  == Creating Multiple Monitors == I have 10 cameras, all Grandstream, each one serves up a low def stream and a high def stream.  I do motion detection on the low def,...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=API_Tricks/Create_Monitors&amp;diff=7200&amp;oldid=prev"/>
		<updated>2015-11-23T20:05:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__TOC__  == Creating Multiple Monitors == I have 10 cameras, all Grandstream, each one serves up a low def stream and a high def stream.  I do motion detection on the low def,...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Creating Multiple Monitors ==&lt;br /&gt;
I have 10 cameras, all Grandstream, each one serves up a low def stream and a high def stream.  I do motion detection on the low def, link the hi def monitor to it. So any motion on the low def stream gets recorded on both.&lt;br /&gt;
&lt;br /&gt;
I mistakenly blew away my config when I updated to 1.28.109 so I was looking for an easy way to create a new setup quickly.  I decided to use the API.&lt;br /&gt;
&lt;br /&gt;
Decided to use perl script to create the curl commands using attributes read from a CSV file. I&amp;#039;m no expert in any of this (perl, zoneminder or API).  I just hammer away with what I do know until I get the results I want.&lt;br /&gt;
&lt;br /&gt;
=== CSV file ===&lt;br /&gt;
I started with a CSV file to define specfics about each camera.&lt;br /&gt;
Name,MonitorID,Function,Last Octet ofIP,Path,Width,Height,Linked Monitor,Label Format Size&lt;br /&gt;
&lt;br /&gt;
Those items aren&amp;#039;t the same across the board, the rest of the config is identical on each monitor. (in my case anyway)&lt;br /&gt;
 Front,101,Nodect,231,0,1920,1080,201,2&lt;br /&gt;
 Front-low,201,Modect,231,4,320,176,,1&lt;br /&gt;
 Side,102,Nodect,232,0,1920,1080,202,2&lt;br /&gt;
 Side-low,202,Modect,232,4,320,176,,1&lt;br /&gt;
 Garage,103,Nodect,233,0,1920,1080,203,2&lt;br /&gt;
 Garage-low,203,Modect,233,4,320,176,,1&lt;br /&gt;
&lt;br /&gt;
=== The perl script ===&lt;br /&gt;
I probably should have done the research so I could have used some of the perl modules that make use of curl, but I just decided to use perl to create all the curl commands I would need to run. (I added &amp;quot; \&amp;quot; to break up the lines here, where you see them it should be all one long line.)&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/perl&lt;br /&gt;
# Build all monitors at once&lt;br /&gt;
#&lt;br /&gt;
use Text::CSV;&lt;br /&gt;
# use Data::Dumper;&lt;br /&gt;
&lt;br /&gt;
$infile=&amp;quot;/export/scratch/api_scripts/monitors.csv&amp;quot;;&lt;br /&gt;
$monitors = Text::CSV::-&amp;gt;new();&lt;br /&gt;
open (CSV, &amp;quot;&amp;lt;&amp;quot;, $infile) or die $!;&lt;br /&gt;
while (&amp;lt;CSV&amp;gt;) {&lt;br /&gt;
	if ($monitors-&amp;gt;parse($_)) {&lt;br /&gt;
		my @columns = $monitors-&amp;gt;fields();&lt;br /&gt;
		push @monitors, {&lt;br /&gt;
			Name =&amp;gt; @columns[0],&lt;br /&gt;
			Id =&amp;gt; @columns[1],&lt;br /&gt;
			Function =&amp;gt; @columns[2],&lt;br /&gt;
			Ip =&amp;gt; @columns[3],&lt;br /&gt;
			Path =&amp;gt; @columns[4],&lt;br /&gt;
			Width =&amp;gt; @columns[5],&lt;br /&gt;
			Height =&amp;gt; @columns[6],&lt;br /&gt;
			Linked =&amp;gt; @columns[7],&lt;br /&gt;
			LabelSize =&amp;gt; @columns[8],&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
close CSV;&lt;br /&gt;
&lt;br /&gt;
@sorted = sort { $a-&amp;gt;{Id} cmp $b-&amp;gt;{Id} } @monitors;&lt;br /&gt;
&lt;br /&gt;
foreach $cam (@sorted) {&lt;br /&gt;
	print &amp;quot;curl -k -XPOST https://localhost/zm/api/monitors.json -d \&amp;quot;Monitor\[Name\]=$cam-&amp;gt;{Name}&amp;amp; \&lt;br /&gt;
Monitor\[Id\]=$cam-&amp;gt;{Id}&amp;amp;Monitor[Function]=$cam-&amp;gt;{Function}&amp;amp;Monitor[Path]=rtsp://192.168.1.$cam-&amp;gt;{Ip}/$cam-&amp;gt;{Path}?tcp&amp;amp; \&lt;br /&gt;
Monitor[Width]=$cam-&amp;gt;{Width}&amp;amp;Monitor[Height]=$cam-&amp;gt;{Height}&amp;amp;Monitor[LinkedMonitors]=$cam-&amp;gt;{Linked}&amp;amp; \&lt;br /&gt;
Monitor[EventPrefix]=$cam-&amp;gt;{Name}-&amp;amp;Monitor[Type]=Ffmpeg&amp;amp;Monitor[Method]=Rtprtsp&amp;amp;Monitor[LabelSize]=$cam-&amp;gt;{LabelSize}\&amp;quot;\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$common=&amp;quot;Monitor[LabelFormat]=%N-%d/%m/%y %H:%M:%S.%f&amp;amp;Monitor[Colours]=3&amp;amp;Monitor[LabelX]=0&amp;amp;Monitor[LabelY]=0&amp;amp; \&lt;br /&gt;
Monitor[WarmupCount]=25&amp;amp;Monitor[PreEventCount]=25&amp;amp;Monitor[PostEventCount]=300&amp;amp;Monitor[StreamReplayBuffer]=1000&amp;amp; \&lt;br /&gt;
Monitor[AlarmFrameCount]=3&amp;amp;Monitor[SectionLength]=600&amp;amp;Monitor[MaximumFPS]=0.00&amp;amp;Monitor[AlarmMaxFPS]=0.00&amp;amp; \&lt;br /&gt;
Monitor[RefBlendPerc]=6&amp;amp;Monitor[AlarmRefBlendPerc]=6&amp;amp;Monitor[TrackMotion]=0&amp;amp;Monitor[Method]=rtpRtsp&amp;amp; \&lt;br /&gt;
Monitor[RefBlendPerc]=12&amp;amp;Monitor[AlarmRefBlendPerc]=12&amp;amp;Monitor[ImageBufferCount]=100&amp;amp;Monitor[WarmupCount]=25&amp;amp; \&lt;br /&gt;
Monitor[PreEventCount]=25&amp;amp;Monitor[PostEventCount]=150&amp;amp;Monitor[AlarmFrameCount]=3&amp;amp;Monitor[Exif]=true&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
foreach $cam (@sorted) {&lt;br /&gt;
	print &amp;quot;curl -k -XPUT https://localhost/zm/api/monitors/$cam-&amp;gt;{Id}.json -d \&amp;quot;${common}\&amp;quot;\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
== Using it ==&lt;br /&gt;
When the perl script is run it just prints out the commands needed to create the monitors.  I redirected that to a temporary script and executed it.  Takes a bit of time to run through each command but it did work quite nicely.&lt;br /&gt;
&lt;br /&gt;
I ended up with a large script containing two commands for each monitor.&lt;br /&gt;
&lt;br /&gt;
Initially create the monitor with it&amp;#039;s specific info:&lt;br /&gt;
 curl -k -XPOST https://localhost/zm/api/monitors.json -d &amp;quot;Monitor[Name]=Front&amp;amp;Monitor[Id]=101&amp;amp;Monitor[Function]=Nodect&amp;amp; \&lt;br /&gt;
 Monitor[Path]=rtsp://192.168.1.231/0?tcp&amp;amp;Monitor[Width]=1920&amp;amp;Monitor[Height]=1080&amp;amp;Monitor[LinkedMonitors]=201&amp;amp; \&lt;br /&gt;
 Monitor[EventPrefix]=Front-&amp;amp;Monitor[Type]=Ffmpeg&amp;amp;Monitor[Method]=Rtprtsp&amp;amp;Monitor[LabelSize]=2&amp;quot;&lt;br /&gt;
Then set all the settings that are the same across the board.&lt;br /&gt;
 curl -k -XPUT https://localhost/zm/api/monitors/101.json -d &amp;quot;Monitor[LabelFormat]=%N-%d/%m/%y %H:%M:%S.%f&amp;amp;Monitor[Colours]=3&amp;amp; \&lt;br /&gt;
 Monitor[LabelX]=0&amp;amp;Monitor[LabelY]=0&amp;amp;Monitor[WarmupCount]=25&amp;amp;Monitor[PreEventCount]=25&amp;amp;Monitor[PostEventCount]=300&amp;amp; \&lt;br /&gt;
 Monitor[StreamReplayBuffer]=1000&amp;amp;Monitor[AlarmFrameCount]=3&amp;amp;Monitor[SectionLength]=600&amp;amp;Monitor[MaximumFPS]=0.00&amp;amp; \&lt;br /&gt;
 Monitor[AlarmMaxFPS]=0.00&amp;amp;Monitor[RefBlendPerc]=6&amp;amp;Monitor[AlarmRefBlendPerc]=6&amp;amp;Monitor[TrackMotion]=0&amp;amp; \&lt;br /&gt;
 Monitor[Method]=rtpRtsp&amp;amp;Monitor[RefBlendPerc]=12&amp;amp;Monitor[AlarmRefBlendPerc]=12&amp;amp;Monitor[ImageBufferCount]=100&amp;amp; \&lt;br /&gt;
 Monitor[WarmupCount]=25&amp;amp;Monitor[PreEventCount]=25&amp;amp;Monitor[PostEventCount]=150&amp;amp;Monitor[AlarmFrameCount]=3&amp;amp;Monitor[Exif]=true&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
*I tested it by stopping zoneminder, running &amp;quot;mysql -u root -p&amp;quot; and logging in.&lt;br /&gt;
** use zm;&lt;br /&gt;
** drop table monitors;&lt;br /&gt;
** exit;&lt;br /&gt;
*Then restarted zoneminder and ran my script.&lt;br /&gt;
*Some wins:&lt;br /&gt;
**You can delete all your monitors and recreate them in a different order pretty quick and easy.&lt;br /&gt;
**You can define the monitorID instead of letting zoneminder pick the next ID sequentially. This let me use 3 digit ID&amp;#039;s, all the hi def monitors are 1?? and the low def are 2??. Might be silly but later on if I add a new camera both streams will be grouped the way I want them instead of just added on to the end. Pretty sure when I get around to using this method to create zones I can do something similar, i.e. hi def monitorID is 201, low def ID is 101, active zone is 1101, exclusive zone is 2101. So the ID&amp;#039;s will be relatable. Maybe overkill, but who knows could turn out to be a big win later on for very little setup now.&lt;br /&gt;
*Some drawbacks&lt;br /&gt;
** No default zone is created.  But I plan to work out what&amp;#039;s needed to rebuild the zones also.  Shouldn&amp;#039;t be too hard.  I&amp;#039;ve created them manually right now and can pull that config via the API to use as a starting point.&lt;br /&gt;
**I did all this before enabling OPT_USE_AUTH. If I tried it now I&amp;#039;d have to mess around with cookies or temporarily turn the auth off.&lt;br /&gt;
**If you have a variety of camera manufactures/models you might not be able to do this as easily.  Widely varying setups would get to be a bit more difficult.&lt;/div&gt;</summary>
		<author><name>Biloxigeek</name></author>
	</entry>
</feed>