<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>froztbyte.getBlog() &#187; automation</title>
	<atom:link href="http://blog.froztbyte.net/tag/automation/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.froztbyte.net</link>
	<description>returns the contents of froztbyte.blog</description>
	<lastBuildDate>Fri, 03 Apr 2020 21:58:55 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>Screw you, Mikrotik</title>
		<link>http://blog.froztbyte.net/2012/02/screw-you-mikrotik/</link>
		<comments>http://blog.froztbyte.net/2012/02/screw-you-mikrotik/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 16:46:38 +0000</pubDate>
		<dc:creator><![CDATA[froztbyte]]></dc:creator>
				<category><![CDATA[roflcakes]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[noise]]></category>
		<category><![CDATA[rage]]></category>

		<guid isPermaLink="false">http://blog.froztbyte.net/?p=165</guid>
		<description><![CDATA[Particularly, your shitty scripting interface. Using a lot of Mikrotik routers in various places, I&#8217;ve grown accustomed to the platform, and it really is quite flexible. However, it has its idiosyncracies. Among them are bugs and regressions between versions (c&#8217;mon &#8230;<p class="read-more"><a href="http://blog.froztbyte.net/2012/02/screw-you-mikrotik/">Read more &#187;</a></p>]]></description>
				<content:encoded><![CDATA[<p>Particularly, your shitty scripting interface.</p>
<p>Using a lot of Mikrotik routers in various places, I&#8217;ve grown accustomed to the platform, and it really is quite flexible. However, it has its idiosyncracies. Among them are bugs and regressions between versions (c&#8217;mon guys, can you at least get some functional testing in place?), inconsistencies/inabilities in how some things are done at protocol level (unable to forward a default route in BGP), those sort of things. Now before I continue, let me say that I understand how such things can happen, but I do feel annoyed that they can take that long to get resolved. The lack of automated functional testing is also a major bugbear.</p>
<p>So, you have a router, and you probably care about its config. Most people who do this are familiar with the tool <a href="http://www.shrubbery.net/rancid/">rancid</a> (for better or worse &#8211; maybe at some point <a href="https://github.com/ranrod">ranrod</a> will be usable), and there are a set of patches to support mikrotik devices over <a href="http://www.gossamer-threads.com/lists/rancid/users/3826">here</a>. As a side effect of this toolchain, I have a set of method that I can use to log in on many devices with a relatively low-effort command method. Consider the following scenario: someone leaves a company, and you wish to update passwords (in the case where you don&#8217;t have don&#8217;t have tacacs or radius backing auth). On a unix-like system, you have a few options, but in router-/switch-land you&#8217;re limited to some other things. Not to worry, we have shell loops, clogin/mtlogin, and a bit of ingenuity! Leading us to make this:</p>
<pre>for location in list some locations here; do
  grep 'mikrotik.*up$' "$location/router.db"; done | cut -d':' -f 1 | while read line; do
  mtlogin -c ':global users;
              :foreach i in=[/user find where name="userinquestion"] do={:set users ($users . "," $i);};
              /user set numbers=$users password=shinymoonbicycles; quit' $line;
done</pre>
<p>Seems sane enough. Start a for loop, parse our router.db files for a list of routers we care about, loop through those and run the following automated command sequence. Low-effort, quick, gets it all done. Except it runs into this issue:</p>
<pre>[automation@Brain] &gt; can't read "users": no such variable</pre>
<p>Argh. Apparently we can&#8217;t declare or use variables in this fashion. Even though I can do that perfectly okay when I&#8217;m logged into an interactive session (&#8230;how is this determined?). &#8220;But hold on,&#8221; I think, &#8220;rancid uses <a href="http://forum.mikrotik.com/viewtopic.php?f=7&amp;t=22763">+ct in the username</a> to skip colour and terminal detection; maybe I can disable that to get it done&#8221;. And no, you can&#8217;t. QQ</p>
<p>In my mind, this sort of thing, on top of the earlier listed problems, the utter silliness of the scripting language (really, go look at the way I have to construct a list of users, or, well, anything), and other things such as no clear equivalent of the cisco-alike &#8220;no&#8221; command that can be used to negate/remove any statement in the config, are among the things that stand in the way of Mikrotik being taken more seriously.</p>
<p>Mikrotik, you have a product with pretty good potential. It wouldn&#8217;t hurt to improve these things a bit. You can sell craploads of non-wifi CPE equipment if you could win over the Cisco-hearts. Please, fix this crap.</p>
<p>*publishes post and mails the link to Mikrotik support*</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.froztbyte.net/2012/02/screw-you-mikrotik/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
