<?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>BlueGecko Denmark</title>
	<atom:link href="https://bluegecko.dk/tag/automation/feed/" rel="self" type="application/rss+xml" />
	<link>https://bluegecko.dk</link>
	<description>Your remote dba</description>
	<lastBuildDate>Sat, 05 Feb 2011 14:45:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.2</generator>
	<item>
		<title>WHY AUTOMATION IS ESSENTIAL FOR EVERY SHOP</title>
		<link>https://bluegecko.dk/why-automation-is-essential-for-every-shop/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=why-automation-is-essential-for-every-shop</link>
		
		<dc:creator><![CDATA[Theis Riiber]]></dc:creator>
		<pubDate>Sat, 05 Feb 2011 14:45:21 +0000</pubDate>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Configuration Management]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">http://www.bluegecko.net/?p=2677</guid>

					<description><![CDATA[As physical infrastructure has changed over the years, management and configuration mechanisms have evolved as well.  In the old days, large machines were managed by hand in many cases, by expert administrators who understood their configuration intimately.  Then, as smaller machines were integrated into the enterprise, management-by-hand became difficult.  Build automation became paramount.  Technologies like [...]


Related posts:<ol><li><a href="http://www.bluegecko.net/oracle-patching-and-upgrades/" rel="bookmark" title="Permanent Link: Oracle Patching and Upgrades">Oracle Patching and Upgrades</a></li>
<li><a href="http://www.bluegecko.net/mysql/mysql-gotchas-on-debian-and-ubuntu/" rel="bookmark" title="Permanent Link: MySQL Gotchas on Debian (and Ubuntu)">MySQL Gotchas on Debian (and Ubuntu)</a></li>
<li><a href="http://www.bluegecko.net/news-events/blue-gecko-named-amazon-web-services-partner/" rel="bookmark" title="Permanent Link: Blue Gecko named Amazon Web Services partner">Blue Gecko named Amazon Web Services partner</a></li>
</ol>]]></description>
										<content:encoded><![CDATA[<p>As physical infrastructure has changed over the years, management and configuration mechanisms have evolved as well.  In the old days, large machines were managed by hand in many cases, by expert administrators who understood their configuration intimately.  Then, as smaller machines were integrated into the enterprise, management-by-hand became difficult.  Build automation became paramount.  Technologies like RIS and Jumpstart became our best friends.  Rdist allowed us to manage and update host configurations to a limited extent.</p>
<p>Then when commodity hardware became stable enough, and more importantly cheap enough to buy redundant systems, we added amazing community based projects like <a title="CFEngine" href="http://www.cfengine.org/" >CFEngine</a>, <a title="Puppet" href="http://www.puppetlabs.com/" >Puppet</a>, and <a title="Chef" href="http://www.opscode.com/chef/" >Chef </a>to our toolboxes.  Imaging models became popular as well, and every host in the enterprise gained the possibility of being consistent, and if not, becoming so within 15 minutes with a rebuild.<span id="more-2677"></span></p>
<p>Throughout this evolution, we went from a 1:[1-10] to 1:[20-30] to 1:1000+ sysadmin:host ratio.  We now measure workload in host classes, or number of customers we support, rather than physical machines.  A group of identical machines is almost the same OS configuration overhead as a single host.  Configuration management through <a title="Kickstart" href="http://fedoraproject.org/wiki/Anaconda/Kickstart" >Kickstart</a> + CFEngine/Puppet/Chef/etc or an image model became an <em>absolute </em>necessity.  I witnessed headcount being cut by 30% at one company when the move to CFEngine was made.  With less management by hand, fewer hands are needed.</p>
<p>So, what if you work at a small business where you have a small number of hosts?  Do you need automation which would allow you to manage 1000 hosts with the same ease of one or two?  Absolutely!  Isn&#8217;t that a lot of work to setup and way too big of a hammer?  No way!  Even for a small shop, configuration management is a necessity and here is why: Configuration management creates a predictable, recoverable, and flexible environment.  That is something every business needs.</p>
<p>We&#8217;ve all had a developer, DBA, or user come to us and say something like: &#8220;I&#8217;m getting different results from machine X than from machine Y.  Are you sure they are identical?&#8221;  <a title="Oracle Grid Control" href="http://www.oracle.com/technetwork/oem/grid-control/overview/index.html" >Oracle grid control</a> has a feature that allows DBA&#8217;s to compare systems configurations, allowing them to quickly provide evidence to their sysadmins that something is wrong.</p>
<p>I once had a colleague run a script which executed &#8220;chmod -R 777 /&#8221; on several critical Digital UNIX hosts.  Pandemonium ensued as pagers blared, evening plans were cancelled, and all hands were called to the deck.  (The guilty party was quickly nicknamed &#8220;Captain C-H-mod&#8221; for the remainder of his career.)  The problem was quickly diagnosed, but recovering hosts built by hand was a big issue.  How were these hosts setup?  What had been modified over years?  Should we try to <em>fix</em> the permissions or rebuild?  In the meantime, the business had ground to a halt and approximately 600 employees were standing around in warehouses around the US.  Some 10 hours later, all systems had been rebuilt and many problems had been worked through.  Some 15 bleary-eyed engineers went home after 3AM to disappointed sleeping families.</p>
<p>Then there are the even more common requests, such as: “Replace machine X with hardware Y for scaling.”, “The lease is up on managed-by-hand-1.you-are-making-your-life-harder-than-you-should.com.”, or “Please build out a new host that looks almost like the existing host X.”.</p>
<p>These problems affect small sets of systems as well as large installations.  Proper configuration management makes cuts the time, complexity, and error-rate of resolving these tasks down by an order of magnitude.  By funneling every OS modification on a host through configuration management, you ensure that the host always has a high likelihood of a maintaining a predictable state and when it’s rebuilt, it will be identical to its former state.  Rebuilds are kicked off and finished before you can go to Starbucks and back.  Developers are happy that their machines are all exactly the same, and if they question the system state, you can tell them you&#8217;ll happily rebuild the host for them in the next 15 minutes if they would like.  MTTR (Mean Time To Recovery) is minimized, and which is <em>very</em> good for the business, and the business is the reason we have a job in the first place.</p>
<p>There is a hump to get over to implement automation and configuration, but it’s not a big one.  Regardless of whether you are in a <a title="AWS" href="http://www.bluegecko.dk/category/amazon-web-services/">AWS</a> or in a colo, there are many creative ways to couple imaging / OS build with configuration management.  Once it&#8217;s complete, that gives us more time to focus on work that makes money for the company, such as implementation consulting for development teams to increase service availability and sleep for everyone, or creating an offering to turn Infrastructure into a revenue generator.  It helps you to have time to work on things that change the perception of infrastructure-as-overhead into an integral part of the business that glues everything together. Oh yeah, and if you do end up needing to scale from 2 hosts to 2000, I suppose you could use it for that as well.</p>
<p>Related posts:</p>
<ol>
<li><a href='http://www.bluegecko.dk/oracle-patching-and-upgrades/' rel='bookmark' title='Permanent Link: Oracle Patching and Upgrades'>Oracle Patching and Upgrades</a></li>
<li><a href='http://www.bluegecko.dk/mysql/mysql-gotchas-on-debian-and-ubuntu/' rel='bookmark' title='Permanent Link: MySQL Gotchas on Debian (and Ubuntu)'>MySQL Gotchas on Debian (and Ubuntu)</a></li>
<li><a href='http://www.bluegecko.dk/news-events/blue-gecko-named-amazon-web-services-partner/' rel='bookmark' title='Permanent Link: Blue Gecko named Amazon Web Services partner'>Blue Gecko named Amazon Web Services partner</a></li>
</ol>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Use Autoconfig for common system administrator tasks</title>
		<link>https://bluegecko.dk/use-autoconfig-for-common-system-administrator-tasks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-autoconfig-for-common-system-administrator-tasks</link>
					<comments>https://bluegecko.dk/use-autoconfig-for-common-system-administrator-tasks/#respond</comments>
		
		<dc:creator><![CDATA[cedwards]]></dc:creator>
		<pubDate>Fri, 11 Dec 2009 14:43:43 +0000</pubDate>
				<category><![CDATA[Oracle Applications]]></category>
		<category><![CDATA[autoconfig]]></category>
		<category><![CDATA[automation]]></category>
		<guid isPermaLink="false">http://matthias.bluegecko.net/?p=294</guid>

					<description><![CDATA[Use Autoconfig for common system administrator tasks Autoconfig is a wonderful tool that may be extended and customized to meet a variety of needs.  One mundane task I don’t deal with anymore is scripting certain basic operating system scripts.  For example: Rotating logs Cleaning out old trace files Init scripts … are all examples of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Use Autoconfig for common system administrator tasks</p>
<p>Autoconfig is a wonderful tool that may be extended and customized to meet a variety of needs.  One mundane task I don’t deal with anymore is scripting certain basic operating system scripts.  For example:</p>
<ul>
<li>Rotating logs</li>
<li>Cleaning out old trace files</li>
<li>Init scripts</li>
</ul>
<p>… are all examples of cron jobs and scripts that must be created post-install.  Many DBAs have a set of scripts they use and modify, but why not use an autoconfig template to generate what you need every time?<span id="more-294"></span></p>
<p>I’ll use an init script as an example.  Oracle provides adstrtal.sh and adstpall.sh for starting and stopping an apps environment; however neither of those scripts are ready to run out of /etc/init.d for system startup and shutdown.</p>
<p>Below is an Autoconfig template that will generate an init.d script that will call both adstrtal.sh and adstpall.sh on system startup and shutdown, respectively.  The script is designed for a RedHat Linux variant like RHEL, OEL, or CentOS.  The application version was 12.1.1.</p>
<p>[code language=&#8221;bash&#8221;]#!/bin/bash</p>
<p># %s_dbSid% 	Start script for the vis applications<br />
#<br />
# chkconfig:  &#8211;	85 15<br />
# description:  %s_dbSid% is an oracle applications instance</p>
<p># Must be root<br />
[ $USER != &quot;root&quot; ] &amp;&amp; echo &quot;User must be root&quot; &amp;&amp; exit 1</p>
<p># source functions<br />
. /etc/rc.d/init.d/functions</p>
<p>prog=app%s_dbSid%<br />
appstop=%s_config_home%/admin/scripts/adstpall.sh<br />
appstart=%s_config_home%/admin/scripts/adstrtal.sh<br />
mgrctl=%s_config_home%/admin/scripts/adcmctl.sh<br />
appuser=%s_appsuser%<br />
appgroup=%s_appsgroup%<br />
appssys=%s_apps_user%<br />
logdir=/var/log/oa<br />
logfile=app%s_dbSid%</p>
<p>LOG=$logdir/$logfile<br />
USAGE=&quot;$prog: [start|stop|abort]&quot;<br />
RETVAL=0</p>
<p>if [ $# -lt 1 ]; then<br />
   echo $USAGE<br />
   exit 1<br />
fi</p>
<p>if [ ! -d $logdir ]; then<br />
   mkdir -p $logdir<br />
   touch $LOG<br />
   chgrp -R $appgroup $logdir<br />
   chmod g+r $logdir<br />
fi</p>
<p># Define some functions</p>
<p>exit_error() {<br />
   RETVAL=$1<br />
   message=&quot;$2&quot;<br />
   echo &quot;$message&quot;<br />
   echo_failure<br />
   echo<br />
   exit $RETVAL<br />
}</p>
<p>get_appspass() {<br />
# Substitute a better password retrieval function<br />
   SECRET=/home/$appuser/.secret<br />
   appspass=`grep ^%s_apps_user%= $SECRET | awk -F&quot;=&quot; &#8216;{print $2}&#8217;` 2&gt;&gt;$LOG<br />
   [ $? -ne 0 ] &amp;&amp; echo &quot;Could not find %s_apps_user% password &#8211; exiting&quot; &gt;&gt;$LOG 2&gt;&amp;1 &amp;&amp; exit 1<br />
   CONNECT=&quot;%s_apps_user%/$appspass&quot;<br />
}</p>
<p># Start the applications<br />
start() {<br />
   echo -n $&quot;Starting $prog: &quot;<br />
   get_appspass<br />
   su &#8211; $appuser -c &quot;$appstart $CONNECT&quot; &gt;&gt;$LOG 2&gt;&amp;1<br />
   RETVAL=$?<br />
   return $RETVAL<br />
}</p>
<p># Stop the applications<br />
stop() {<br />
   echo -n $&quot;Stopping $prog: &quot;<br />
   get_appspass<br />
   su &#8211; $appuser -c &quot;$appstop $CONNECT&quot; &gt;&gt;$LOG 2&gt;&amp;1<br />
   RETVAL=$?<br />
   return $RETVAL<br />
}</p>
<p># Stop the applications and abort the concurrent managers (faster)<br />
abort() {<br />
   echo -n $&quot;Aborting $prog: &quot;<br />
   get_appspass<br />
   su &#8211; $appuser -c &quot;$mgrctl abort $CONNECT&quot; #| tee &gt;&gt;$LOG 2&gt;&amp;1<br />
   su &#8211; $appuser -c &quot;$appstop $CONNECT&quot; #| tee &gt;&gt;$LOG 2&gt;&amp;1<br />
   RETVAL=$?<br />
   return $RETVAL<br />
}</p>
<p># Main program</p>
<p>mode=$1</p>
<p>case $mode in<br />
   start)<br />
      start<br />
      ;;<br />
   stop)<br />
      stop<br />
      ;;<br />
   abort)<br />
      abort<br />
      ;;<br />
   *)<br />
      echo $USAGE<br />
      exit 1<br />
esac</p>
<p>if [ $RETVAL -eq 0 ]; then<br />
   echo_success<br />
else<br />
   echo_failure<br />
fi<br />
echo</p>
<p>exit $RETVAL[/code]</p>
<p>To install this script, all I need to do is the following:</p>
<p>Place the script in a template file in my custom application top.</p>
<p>Create a driver that will create the script; I usually create a /tools directory for this sort of thing.</p>
<p>Run autoconfig to create the script.</p>
<p>As root, copy the script to /etc/init.d</p>
<p>Use chkconfig to enable auto start/stop on system boot:</p>
<p>[code language=&#8221;plain&#8221;]$ chkconfig –-add<br />
$ chkconfig on[/code]</p>
<p>That’s it!  Now every time I create a clone, I have a new init script for that node.  If a path or other dependent context value changes, I simply copy the updated script into /etc/init.d and follow the steps above.</p>
<p>I should note that with this script specifically, because it requires the apps password, you should probably find a better way to store and retrieve the apps password.  In this example, I put it in a file called /home/appl/.secret, which had permission bits set to 660.  That’s an “OK” solution, but not great.  The script grabs the password using a function specifically to allow minimal fuss and muss when updating the password storage and retrieval method.</p>
<p>Anyway, it’s pretty easy to see how one could leverage Autoconfig to create simple time-saving scripts because Autoconfig already “knows” where everything is.</p>
<p>Here’s an example of a script to clean up concurrent manager log and output:</p>
<p>[code language=&#8221;bash&#8221;]#!/bin/sh</p>
<p>env_file=&quot;%s_applfenv%&quot;</p>
<p>if [ ! -f $env_file ];<br />
then<br />
   printf &quot;Cannot find environment file $env_filen&quot;<br />
   printf &quot;ERRORCODE = 1 ERRORCODE_ENDn&quot;<br />
   exit 1<br />
else<br />
   . $env_file<br />
fi</p>
<p># Clean up concurrent manager log and output directories<br />
/usr/bin/find $APPLCSF/$APPLOUT -name &quot;*.out&quot; -ctime<br />
   +%c_conc_out_ret% | xargs rm -rf<br />
/usr/bin/find $APPLCSF/$APPLLOG -name &quot;*.req&quot; -ctime<br />
   +%c_conc_log_ret% | xargs rm -rf</p>
<p># Clean up the instance logs<br />
/usr/bin/find $INST_TOP/admin/log -type d -ctime<br />
   +%c_inst_log_ret% | xargs rm –rf;</p>
<p>exit $?[/code]</p>
<p>In this example, I created 3 custom context variables:</p>
<p>c_conc_out_ret<br />
c_conc_log_ret<br />
c_inst_log_ret</p>
<p>Each are set to the retention period in days for their respective logs.</p>
<p>Installation for a script like this is even more hands-off than an init script.  Typically log cleanup scripts are called from cron and are often registered as individual crontab commands.  For this script, a single crontab entry could point to the absolute location of the script.  If the value of an environment or context variable changed at any time, running Autoconfig would automatically update the scheduled job.</p>
<p>Operating system maintenance plays a critical role in a well-organized, automated Apps environment; the less manual scripting there is, the less likely it is to be skipped.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://bluegecko.dk/use-autoconfig-for-common-system-administrator-tasks/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 26/104 objects using disk
Page Caching using disk: enhanced 

Served from: bluegecko.dk @ 2026-10-17 02:46:04 by W3 Total Cache
-->