<?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>Simón Alonso Sánchez</title>
	<atom:link href="http://www.simonalsa.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simonalsa.com</link>
	<description>My Blog</description>
	<lastBuildDate>Mon, 13 Feb 2012 23:04:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Setting user object attributes msDS-SupportedEncryptionTypes and userAccountControl using the cmdlets Get-QADUser and Set-QADUser to enable encryption methods work with Kerberos</title>
		<link>http://www.simonalsa.com/blog/2012/02/14/setting-user-object-attributes-msds-supportedencryptiontypes-and-useraccountcontrol-using-the-cmdlets-get-qaduser-and-set-qaduser-to-enable-encryption-methods-work-with-kerberos/</link>
		<comments>http://www.simonalsa.com/blog/2012/02/14/setting-user-object-attributes-msds-supportedencryptiontypes-and-useraccountcontrol-using-the-cmdlets-get-qaduser-and-set-qaduser-to-enable-encryption-methods-work-with-kerberos/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 23:02:07 +0000</pubDate>
		<dc:creator>salonso</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[cmdlets]]></category>
		<category><![CDATA[Enable]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[Get-QADUser]]></category>
		<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[methods]]></category>
		<category><![CDATA[Set-QADUser]]></category>
		<category><![CDATA[Setting. user. object. attributes. msDS-SupportedEncryptionTypes. userAccountControl. using]]></category>

		<guid isPermaLink="false">http://www.simonalsa.com/?p=1133</guid>
		<description><![CDATA[set-Location c:\ Add-PSSnapin Quest.ActiveRoles.ADManagement Get-PSsnapin Set-QADPSSnapinSettings -DefaultSizeLimit 0 Get-Command Get-QAD* Get-QADUser -sl 0 -IncludeAllProperties -SerializeValues PS C:\&#62; Get-QADUser spider001 -sl 0 -IncludeAllProperties -SerializeValues &#62; C:\User.txt PS C:\&#62; Get-QADUser spider001 -sl 0 -IncludedProperties userAccountControl,&#8217;msDS-SupportedEncryptionTypes&#8217; &#124; Format-Tabl e name,userAccountControl,&#8217;msDS-SupportedEncryptionTypes&#8217; Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; userAccountControl &#160; msDS-SupportedEncryptionTypes spider001&#160;&#160; 2163200&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 31 PS C:\&#62; Set-QADUser spider002 -objectAttributes @{&#8216;msDS-SupportedEncryptionTypes&#8217;=31} PS C:\&#62; Set-QADUser spider002 -objectAttributes [...]]]></description>
			<content:encoded><![CDATA[<p>
	<!--<br />
		@page { margin: 0.79in }<br />
		P { margin-bottom: 0.08in }<br />
	-->
	</p>
<p style="margin-bottom: 0in">set-Location c:\<br />
Add-PSSnapin Quest.ActiveRoles.ADManagement<br />
Get-PSsnapin<br />
Set-QADPSSnapinSettings -DefaultSizeLimit 0<br />
Get-Command Get-QAD*</p>
<p style="margin-bottom: 0in">Get-QADUser -sl 0 -IncludeAllProperties -SerializeValues</p>
<p style="margin-bottom: 0in">PS C:\&gt; Get-QADUser spider001 -sl 0 -IncludeAllProperties -SerializeValues &gt; C:\User.txt</p>
<p style="margin-bottom: 0in">PS C:\&gt; Get-QADUser spider001 -sl 0 -IncludedProperties userAccountControl,&#8217;msDS-SupportedEncryptionTypes&#8217; | Format-Tabl</p>
<p style="margin-bottom: 0in">e name,userAccountControl,&#8217;msDS-SupportedEncryptionTypes&#8217;</p>
<p style="margin-bottom: 0in">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;		userAccountControl &nbsp; msDS-SupportedEncryptionTypes</p>
<p style="margin-bottom: 0in">spider001&nbsp;&nbsp;	2163200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;			31</p>
<p style="margin-bottom: 0in">PS C:\&gt; Set-QADUser spider002 -objectAttributes @{&#8216;msDS-SupportedEncryptionTypes&#8217;=31}</p>
<p style="margin-bottom: 0in">PS C:\&gt; Set-QADUser spider002 -objectAttributes @{&#8216;userAccountControl&#8217;=2163200}</p>
<p style="margin-bottom: 0in">PS C:\&gt; Set-QADUser spider003 -objectAttributes @{&#8216;msDS-SupportedEncryptionTypes&#8217;=31}</p>
<p style="margin-bottom: 0in">PS C:\&gt; Set-QADUser spider003 -objectAttributes @{&#8216;userAccountControl&#8217;=2163200}</p>
<p style="margin-bottom: 0in">PS C:\&gt; Get-QADUser spider002 -sl 0 -IncludedProperties userAccountControl,&#8217;msDS-SupportedEncryptionTypes&#8217; | Format-Tabl</p>
<p style="margin-bottom: 0in">e name,userAccountControl,&#8217;msDS-SupportedEncryptionTypes&#8217;</p>
<p style="margin-bottom: 0in">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; userAccountControl&nbsp;&nbsp;&nbsp;		msDS-SupportedEncryptionTypes</p>
<p style="margin-bottom: 0in">spider002&nbsp;&nbsp;	2163200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;			31</p>
<p style="margin-bottom: 0in">&nbsp;</p>
<p style="margin-bottom: 0in"><a href="http://www.simonalsa.com/wp-content/uploads/2012/02/msDS-SupportedEncryptionTypes_userAccountControl-.png"><img width="300" height="210" class="aligncenter size-medium wp-image-1134" alt="" src="http://www.simonalsa.com/wp-content/uploads/2012/02/msDS-SupportedEncryptionTypes_userAccountControl--300x210.png" /></a></p>
<p style="margin-bottom: 0in">&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonalsa.com/blog/2012/02/14/setting-user-object-attributes-msds-supportedencryptiontypes-and-useraccountcontrol-using-the-cmdlets-get-qaduser-and-set-qaduser-to-enable-encryption-methods-work-with-kerberos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable computer encryption types for using Kerberos</title>
		<link>http://www.simonalsa.com/blog/2012/02/13/enable-computer-encryption-types-for-using-kerberos/</link>
		<comments>http://www.simonalsa.com/blog/2012/02/13/enable-computer-encryption-types-for-using-kerberos/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 20:29:36 +0000</pubDate>
		<dc:creator>salonso</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[Enable]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[types]]></category>

		<guid isPermaLink="false">http://www.simonalsa.com/?p=1124</guid>
		<description><![CDATA[mmc adsiedit.msc &#124;&#124; ADSI group policy editor &#160; Encryption types allowed (default value 31): DES_CBC_CRC DES_CBC_MD5 RC4_HMAC_MD5 AES128_HMAC_SHA1 AES256_HMAC_SHA1 &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p><strong>mmc adsiedit.msc || ADSI group policy editor</strong></p>
<p><a href="http://www.simonalsa.com/wp-content/uploads/2012/02/Enable_computer_encryption_types-.png"><img width="300" height="231" class="aligncenter size-medium wp-image-1129" alt="" src="http://www.simonalsa.com/wp-content/uploads/2012/02/Enable_computer_encryption_types--300x231.png" /></a></p>
<p>&nbsp;</p>
<p>Encryption types allowed (default value <strong>31</strong>):</p>
<ul>
<li>DES_CBC_CRC</li>
<li>DES_CBC_MD5</li>
<li>RC4_HMAC_MD5</li>
<li>AES128_HMAC_SHA1</li>
<li>AES256_HMAC_SHA1</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonalsa.com/blog/2012/02/13/enable-computer-encryption-types-for-using-kerberos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure encryption types allowed for using Kerberos</title>
		<link>http://www.simonalsa.com/blog/2012/02/13/configure-encryption-types-allowed-for-usingkerberos/</link>
		<comments>http://www.simonalsa.com/blog/2012/02/13/configure-encryption-types-allowed-for-usingkerberos/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 20:22:33 +0000</pubDate>
		<dc:creator>salonso</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[allowed]]></category>
		<category><![CDATA[Configure]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[types]]></category>

		<guid isPermaLink="false">http://www.simonalsa.com/?p=1121</guid>
		<description><![CDATA[mmc gpedit.msc &#124;&#124; Local group policy &#160; Encryption types: DES_CBC_CRC DES_CBC_MD5 RC4_HMAC_MD5 AES128_HMAC_SHA1 AES256_HMAC_SHA1]]></description>
			<content:encoded><![CDATA[<p><strong>mmc gpedit.msc || Local group policy</strong></p>
<p><a href="http://www.simonalsa.com/wp-content/uploads/2012/02/Configure_encryption_types_allowed_kerberos-.png"><img width="300" height="239" src="http://www.simonalsa.com/wp-content/uploads/2012/02/Configure_encryption_types_allowed_kerberos--300x239.png" alt="" class="aligncenter size-medium wp-image-1122" /></a></p>
<p>&nbsp;</p>
<p>Encryption types:</p>
<ul>
<li>DES_CBC_CRC</li>
<li>DES_CBC_MD5</li>
<li>RC4_HMAC_MD5</li>
<li>AES128_HMAC_SHA1</li>
<li>AES256_HMAC_SHA1</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.simonalsa.com/blog/2012/02/13/configure-encryption-types-allowed-for-usingkerberos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trust this computer for delegation to any service usign Kerberos</title>
		<link>http://www.simonalsa.com/blog/2012/02/13/trust-this-computer-for-delegation-to-any-service-usign-kerberos/</link>
		<comments>http://www.simonalsa.com/blog/2012/02/13/trust-this-computer-for-delegation-to-any-service-usign-kerberos/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 20:12:11 +0000</pubDate>
		<dc:creator>salonso</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[delegation]]></category>
		<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[Service]]></category>
		<category><![CDATA[Trust]]></category>

		<guid isPermaLink="false">http://www.simonalsa.com/?p=1118</guid>
		<description><![CDATA[mmc dsa.msc &#124;&#124; Active Directory Users and Computers]]></description>
			<content:encoded><![CDATA[<p><strong>mmc dsa.msc || Active Directory Users and Computers </strong></p>
<p><a href="http://www.simonalsa.com/wp-content/uploads/2012/02/Trust_this_computer_for_delegation_to_any_service_kerberos-.png"><img width="300" height="196" class="aligncenter size-medium wp-image-1119" alt="" src="http://www.simonalsa.com/wp-content/uploads/2012/02/Trust_this_computer_for_delegation_to_any_service_kerberos--300x196.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonalsa.com/blog/2012/02/13/trust-this-computer-for-delegation-to-any-service-usign-kerberos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>setup grub boot loader password restriction</title>
		<link>http://www.simonalsa.com/blog/2012/02/06/setup-grub-boot-loader-password-restriction/</link>
		<comments>http://www.simonalsa.com/blog/2012/02/06/setup-grub-boot-loader-password-restriction/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 00:36:01 +0000</pubDate>
		<dc:creator>salonso</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.simonalsa.com/?p=1095</guid>
		<description><![CDATA[Generate a hash for password root@Desktop-01:/etc/grub.d# grub-mkpasswd-pbkdf2 Enter password: Reenter password: Your PBKDF2 is grub.pbkdf2.sha512.10000&#8230;.. &#160; Create and define restriction rules for grub root@Desktop-01:/etc/grub.d# cat 40_custom #!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries.&#160; Simply type the # menu entries you want to add after [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Generate a hash for password</strong></p>
<p>root@Desktop-01:/etc/grub.d# grub-mkpasswd-pbkdf2</p>
<p>Enter password: <br />
Reenter password:</p>
<p>Your PBKDF2 is grub.pbkdf2.sha512.10000&#8230;..</p>
<p>&nbsp;</p>
<p><strong>Create and define restriction rules for grub</strong></p>
<p>root@Desktop-01:/etc/grub.d# cat 40_custom <br />
#!/bin/sh<br />
exec tail -n +3 $0<br />
# This file provides an easy way to add custom menu entries.&nbsp; Simply type the<br />
# menu entries you want to add after this comment.&nbsp; Be careful not to change<br />
# the &#8216;exec tail&#8217; line above.<br />
set superusers=&quot;root&quot;<br />
password_pbkdf2 root grub.pbkdf2.sha512.10000&#8230;&#8230;<br />
&nbsp;</p>
<p><strong>Update the grub rules</strong></p>
<p>root@Desktop-01:/etc/grub.d# grub-mkconfig</p>
<p>### BEGIN /etc/grub.d/40_custom ###<br />
# This file provides an easy way to add custom menu entries.&nbsp; Simply type the<br />
# menu entries you want to add after this comment.&nbsp; Be careful not to change<br />
# the &#8216;exec tail&#8217; line above.<br />
set superusers=&quot;root&quot;<br />
password_pbkdf2 root grub.pbkdf2.sha512.10000&#8230;&#8230;<br />
### END /etc/grub.d/40_custom ###</p>
<p>root@Desktop-01:/etc/grub.d# update-grub<br />
Generating grub.cfg &#8230;<br />
Found background image: /usr/share/images/desktop-base/desktop-grub.png<br />
Found linux image: /boot/vmlinuz-2.6.32-5-amd64<br />
Found initrd image: /boot/initrd.img-2.6.32-5-amd64<br />
done<br />
&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonalsa.com/blog/2012/02/06/setup-grub-boot-loader-password-restriction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenXenManager graphical interface to manage Xen Cloud Platform (XCP)</title>
		<link>http://www.simonalsa.com/blog/2012/02/06/openxenmanager-graphical-interface-to-manage-xen-cloud-platform-xcp/</link>
		<comments>http://www.simonalsa.com/blog/2012/02/06/openxenmanager-graphical-interface-to-manage-xen-cloud-platform-xcp/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 23:33:53 +0000</pubDate>
		<dc:creator>salonso</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[XEN]]></category>
		<category><![CDATA[graphical]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[manage]]></category>
		<category><![CDATA[OpenXenManager]]></category>
		<category><![CDATA[XenServer]]></category>

		<guid isPermaLink="false">http://www.simonalsa.com/?p=1083</guid>
		<description><![CDATA[OpenXenManager is a graphical interface to manage XenServer / Xen Cloud Platform (XCP) hosts through the network. OpenXenManager is an open-source multiplatform clone of XenCenter (Citrix). Project homepage http://sourceforge.net/projects/openxenmanager/ It is Open Source tool and developed in Phyton. I dunno how it is developped but the most important dependencies for running it are packaged in [...]]]></description>
			<content:encoded><![CDATA[<p>OpenXenManager is a graphical interface to manage XenServer / Xen Cloud  Platform (XCP) hosts through the network. OpenXenManager is an  open-source multiplatform clone of XenCenter (Citrix).</p>
<p>Project homepage</p>
<p><a href="http://sourceforge.net/projects/openxenmanager/">http://sourceforge.net/projects/openxenmanager/</a></p>
<p>It is Open Source tool and developed in Phyton.</p>
<p>I dunno how it is developped but the most important dependencies for running it are packaged in Phyton. I am using it in Debian linux distribution since a year and works stable.</p>
<p>The purpose about this powerfull tool it is manage the Xen XCP&#8217;s domains and the virtual machines which are running into the domains using the Xen XCP&#8217;s hypervisor.</p>
<p>You can do the most important&nbsp; virtualization tasks with a couple of clicks using the graphical user interface.</p>
<p>Have more features than his brother Citrix XenCenter that only works under Windows platform.</p>
<p>It is easy install in every linux distribution, you only must deploy his dependencies before running it.</p>
<p>This is a nice tool.</p>
<p>&nbsp;</p>
<p>Screenshots</p>
<p><a href="http://www.simonalsa.com/blog/2012/02/06/openxenmanager-graphical-interface-to-manage-xen-cloud-platform-xcp/openxenmanager-01/" rel="attachment wp-att-1084"><img width="150" height="150" src="http://www.simonalsa.com/wp-content/uploads/2012/02/OpenXenManager-01--150x150.png" alt="OpenXenManager-01" class="alignnone size-thumbnail wp-image-1084" /></a>  <a href="http://www.simonalsa.com/blog/2012/02/06/openxenmanager-graphical-interface-to-manage-xen-cloud-platform-xcp/openxenmanager-02/" rel="attachment wp-att-1085"><img width="150" height="150" src="http://www.simonalsa.com/wp-content/uploads/2012/02/OpenXenManager-02--150x150.png" alt="OpenXenManager-02" class="alignnone size-thumbnail alignnone size-thumbnail wp-image-1085" /></a>  <a href="http://www.simonalsa.com/blog/2012/02/06/openxenmanager-graphical-interface-to-manage-xen-cloud-platform-xcp/openxenmanager-03/" rel="attachment wp-att-1086"><img width="150" height="150" src="http://www.simonalsa.com/wp-content/uploads/2012/02/OpenXenManager-03--150x150.png" alt="OpenXenManager-03" class="alignnone size-thumbnail alignnone size-thumbnail alignnone size-thumbnail wp-image-1086" /></a>  <a href="http://www.simonalsa.com/blog/2012/02/06/openxenmanager-graphical-interface-to-manage-xen-cloud-platform-xcp/openxenmanager-04/" rel="attachment wp-att-1087"><img width="150" height="150" src="http://www.simonalsa.com/wp-content/uploads/2012/02/OpenXenManager-04--150x150.png" alt="OpenXenManager-04" class="alignnone size-thumbnail alignnone size-thumbnail alignnone size-thumbnail alignnone size-thumbnail wp-image-1087" /></a>  &nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonalsa.com/blog/2012/02/06/openxenmanager-graphical-interface-to-manage-xen-cloud-platform-xcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checks the Linux supported release</title>
		<link>http://www.simonalsa.com/blog/2012/01/26/checks-the-linux-supported-release/</link>
		<comments>http://www.simonalsa.com/blog/2012/01/26/checks-the-linux-supported-release/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 20:24:59 +0000</pubDate>
		<dc:creator>salonso</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[SRR]]></category>
		<category><![CDATA[STIG]]></category>
		<category><![CDATA[Checks]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[supported]]></category>

		<guid isPermaLink="false">http://www.simonalsa.com/?p=1075</guid>
		<description><![CDATA[3.1.1.005-GEN000100.bash &#160; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>3.1.1.005-GEN000100.bash</strong></p>
<p>&nbsp;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># Copyright (C) 2011 simonalsa</span>
<span style="color: #666666; font-style: italic;"># http://www.simonalsa.com</span>
<span style="color: #666666; font-style: italic;"># Author Simon Alonso Sanchez &lt;simonalsa@simonalsa.com&gt;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This program is free software; you can redistribute it and/or</span>
<span style="color: #666666; font-style: italic;"># modify it under the terms of the GNU General Public License</span>
<span style="color: #666666; font-style: italic;"># as published by the Free Software Foundation; version 2</span>
<span style="color: #666666; font-style: italic;"># of the License.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This program is distributed in the hope that it will be useful,</span>
<span style="color: #666666; font-style: italic;"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span style="color: #666666; font-style: italic;"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span style="color: #666666; font-style: italic;"># GNU General Public License for more details.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># You should have received a copy of the GNU General Public License</span>
<span style="color: #666666; font-style: italic;"># along with this program; if not, write to the Free Software</span>
<span style="color: #666666; font-style: italic;"># Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># Security Technical Implementation Guide (STIG)</span>
<span style="color: #666666; font-style: italic;"># Security Readiness Review (SRR)</span>
<span style="color: #666666; font-style: italic;"># Tested in GNU/Linux Debian distribution</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># STIG|SRR definition</span>
<span style="color: #007800;">NUMBER</span>=<span style="color: #ff0000;">&quot;3.1.1.005&quot;</span>
<span style="color: #007800;">LABEL</span>=<span style="color: #ff0000;">&quot;GEN000100&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Section:</span>
<span style="color: #007800;">SECTION</span>=<span style="color: #ff0000;">&quot;Linux overview and site information&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Process:</span>
<span style="color: #007800;">PROCESS</span>=<span style="color: #ff0000;">&quot;Operating system&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Description:</span>
<span style="color: #007800;">DESCRIPTION</span>=<span style="color: #ff0000;">&quot;Checks the Linux supported release&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Include global preferences</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$PWD</span><span style="color: #000000; font-weight: bold;">/</span>preferences.cfg <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #007800;">$PWD</span><span style="color: #000000; font-weight: bold;">/</span>preferences.cfg
<span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Can not include the global preferences at <span style="color: #007800;">$PWD</span>/preferences.cfg <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Include local preferences</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$PWD</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NUMBER</span>-<span style="color: #007800;">$LABEL</span>.prefs <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #007800;">$PWD</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NUMBER</span>-<span style="color: #007800;">$LABEL</span>.prefs
<span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Can not include the local preferences at <span style="color: #007800;">$PWD</span>/<span style="color: #007800;">$NUMBER</span>-<span style="color: #007800;">$LABEL</span>.prefs <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Section.Description</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;STIG|SRR definition <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Number: <span style="color: #007800;">$NUMBER</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Label: <span style="color: #007800;">$LABEL</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Section: <span style="color: #007800;">$SECTION</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Process: <span style="color: #007800;">$PROCESS</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Description: <span style="color: #007800;">$DESCRIPTION</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Perform</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #007800;">$CMD_LSB_RELEASE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
        <span style="color: #007800;">CMD</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_LSB_RELEASE</span> <span style="color: #660033;">-d</span> -s<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Linux LSB release: <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> <span style="color: #007800;">$CMD</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">else</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Can not locate the Linux LSB release <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Can not locate the <span style="color: #007800;">$CMD_LSB_RELEASE</span> in the filesystem <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #007800;">$CMD_UNAME</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">CMD</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_UNAME</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #007800;">KERNEL_NAME</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_UNAME</span> --kernel-name<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #007800;">KERNEL_RELEASE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_UNAME</span> --kernel-release<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #007800;">KERNEL_VERSION</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_UNAME</span> --kernel-version<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #007800;">KERNEL_MACHINE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_UNAME</span> --machine<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #007800;">KERNEL_PROCESSOR</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_UNAME</span> --processor<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #007800;">KERNEL_HARDWARE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_UNAME</span> --hardware-platform<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #007800;">KERNEL_OS</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_UNAME</span> --operating-system<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Kernel release: <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Name: <span style="color: #007800;">$KERNEL_NAME</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Release: <span style="color: #007800;">$KERNEL_RELEASE</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Version: <span style="color: #007800;">$KERNEL_VERSION</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Machine: <span style="color: #007800;">$KERNEL_MACHINE</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Processor: <span style="color: #007800;">$KERNEL_PROCESSOR</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Hardware: <span style="color: #007800;">$KERNEL_HARDWARE</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span> Operating system: <span style="color: #007800;">$KERNEL_OS</span> <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">else</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Can not locate the Linux Kernel release <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Can not locate the <span style="color: #007800;">$CMD_UNAME</span> in the filesystem <span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span></pre></td></tr></table></div>

<p><strong>3.1.1.005-GEN000100.bash</strong></p>
<p>&nbsp;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Nothing</span></pre></td></tr></table></div>

<p>&nbsp;</p>
<p><strong>Sample output</strong></p>
<p>simonalsa@Desktop-01:~/$ bash 3.1.1.005-GEN000100.bash<br />
STIG|SRR definition<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number: 3.1.1.005<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label: GEN000100<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Section: Linux overview and site information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Process: Operating system<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Description: Checks the Linux supported release</p>
<p>Linux LSB release:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Debian GNU/Linux 6.0.3 (squeeze)<br />
Kernel release:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name: Linux<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Release: 2.6.32-5-amd64<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Version: #1 SMP Thu Nov 3 03:41:26 UTC 2011<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Machine: x86_64<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Processor: unknown<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hardware: unknown<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Operating system: GNU/Linux<br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonalsa.com/blog/2012/01/26/checks-the-linux-supported-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash shell script for test the availability about commands in the filesystem</title>
		<link>http://www.simonalsa.com/blog/2012/01/26/bash-shell-script-for-test-the-availability-about-commands-in-the-filesystem/</link>
		<comments>http://www.simonalsa.com/blog/2012/01/26/bash-shell-script-for-test-the-availability-about-commands-in-the-filesystem/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 19:21:40 +0000</pubDate>
		<dc:creator>salonso</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[SRR]]></category>
		<category><![CDATA[STIG]]></category>
		<category><![CDATA[available]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.simonalsa.com/?p=1070</guid>
		<description><![CDATA[The objective is the reuse about variables and why not all GNU/Linux distributions installs the commands by default in the same place I am going to allocate&#160; a variable per each different command. This file will be included in other shell scripts. preferences.cfg 1 2 3 4 5 6 7 8 9 10 11 12 [...]]]></description>
			<content:encoded><![CDATA[<p>The objective is the reuse about variables and why not all GNU/Linux  distributions installs the commands by default in the same place</p>
<p>I am going to allocate&nbsp; a variable per each different command. This file will be included in other shell scripts. </p>
<p><strong>preferences.cfg</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">CMD_AWK</span>=<span style="color: #ff0000;">&quot;/usr/bin/awk&quot;</span>
<span style="color: #007800;">CMD_CAT</span>=<span style="color: #ff0000;">&quot;/bin/cat&quot;</span>
<span style="color: #007800;">CMD_CHGRP</span>=<span style="color: #ff0000;">&quot;/bin/chgrp&quot;</span>
<span style="color: #007800;">CMD_CHMOD</span>=<span style="color: #ff0000;">&quot;/bin/chmod&quot;</span>
<span style="color: #007800;">CMD_DD</span>=<span style="color: #ff0000;">&quot;/bin/dd&quot;</span>
<span style="color: #007800;">CMD_DIFF</span>=<span style="color: #ff0000;">&quot;/usr/bin/diff&quot;</span>
<span style="color: #007800;">CMD_ECHO</span>=<span style="color: #ff0000;">&quot;/bin/echo&quot;</span>
<span style="color: #007800;">CMD_FIND</span>=<span style="color: #ff0000;">&quot;/usr/bin/find&quot;</span>
<span style="color: #007800;">CMD_GREP</span>=<span style="color: #ff0000;">&quot;/bin/grep&quot;</span>
<span style="color: #007800;">CMD_LAST</span>=<span style="color: #ff0000;">&quot;/usr/bin/last&quot;</span>
<span style="color: #007800;">CMD_LASTB</span>=<span style="color: #ff0000;">&quot;/usr/bin/lastb&quot;</span>
<span style="color: #007800;">CMD_LS</span>=<span style="color: #ff0000;">&quot;/bin/ls&quot;</span>
<span style="color: #007800;">CMD_LSB_RELEASE</span>=<span style="color: #ff0000;">&quot;/usr/bin/lsb_release&quot;</span>
<span style="color: #007800;">CMD_MKDIR</span>=<span style="color: #ff0000;">&quot;/bin/mkdir&quot;</span>
<span style="color: #007800;">CMD_MKFS</span>=<span style="color: #ff0000;">&quot;/sbin/mkfs.ext2&quot;</span>
<span style="color: #007800;">CMD_MKNOD</span>=<span style="color: #ff0000;">&quot;/bin/mknod&quot;</span>
<span style="color: #007800;">CMD_MOUNT</span>=<span style="color: #ff0000;">&quot;/bin/mount&quot;</span>
<span style="color: #007800;">CMD_MYSQL</span>=<span style="color: #ff0000;">&quot;/usr/bin/mysql&quot;</span>
<span style="color: #007800;">CMD_PHP</span>=<span style="color: #ff0000;">&quot;/usr/bin/php5&quot;</span>
<span style="color: #007800;">CMD_SED</span>=<span style="color: #ff0000;">&quot;/bin/sed&quot;</span>
<span style="color: #007800;">CMD_SEQ</span>=<span style="color: #ff0000;">&quot;/usr/bin/seq&quot;</span>
<span style="color: #007800;">CMD_SORT</span>=<span style="color: #ff0000;">&quot;/usr/bin/sort&quot;</span>
<span style="color: #007800;">CMD_STAT</span>=<span style="color: #ff0000;">&quot;/usr/bin/stat&quot;</span>
<span style="color: #007800;">CMD_TAIL</span>=<span style="color: #ff0000;">&quot;/usr/bin/tail&quot;</span>
<span style="color: #007800;">CMD_TOUCH</span>=<span style="color: #ff0000;">&quot;/bin/touch&quot;</span>
<span style="color: #007800;">CMD_TUNE2FS</span>=<span style="color: #ff0000;">&quot;/sbin/tune2fs&quot;</span>
<span style="color: #007800;">CMD_UNAME</span>=<span style="color: #ff0000;">&quot;/bin/uname&quot;</span>
<span style="color: #007800;">CMD_YES</span>=<span style="color: #ff0000;">&quot;/usr/bin/yes&quot;</span>
<span style="color: #007800;">CMD_WC</span>=<span style="color: #ff0000;">&quot;/usr/bin/wc&quot;</span></pre></td></tr></table></div>

<p>&nbsp;</p>
<p>This shell script &quot;preferences.bash&quot; checks the availability about each command defined in the variables saved in the data file &quot;preferences.cfg&quot;.</p>
<p><strong>preferences.bash</strong></p>
<p>&nbsp;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># Check the availability about the commands that will be used</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Include global preferences</span>
<span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #007800;">$PWD</span><span style="color: #000000; font-weight: bold;">/</span>preferences.cfg
&nbsp;
<span style="color: #007800;">CMD</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_CAT</span> <span style="color: #007800;">$PWD</span><span style="color: #000000; font-weight: bold;">/</span>preferences.cfg<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">&amp;</span>quot;Check the availability about the commands that will be used \r<span style="color: #000000; font-weight: bold;">&amp;</span>quot;
&nbsp;
<span style="color: #666666; font-style: italic;"># Checks if path is ok</span>
<span style="color: #000000; font-weight: bold;">for</span> line <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$CMD</span>;
<span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #007800;">TEST</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$CMD_ECHO</span> <span style="color: #000000; font-weight: bold;">&amp;</span>quot;<span style="color: #007800;">$line</span><span style="color: #000000; font-weight: bold;">&amp;</span>quot; <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #007800;">$CMD_AWK</span> <span style="color: #660033;">-F</span>= <span style="color: #ff0000;">'{ print $2 }'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #007800;">$CMD_SED</span> <span style="color: #ff0000;">'s/&amp;quot;//g'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">&amp;</span>quot;<span style="color: #000000; font-weight: bold;">&amp;</span>quot;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$TEST</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">&amp;</span>quot;<span style="color: #7a0874; font-weight: bold;">&#91;</span>Passed<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">&amp;</span>quot;
        <span style="color: #000000; font-weight: bold;">else</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">&amp;</span>quot;<span style="color: #7a0874; font-weight: bold;">&#91;</span>Failed<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">&amp;</span>quot;
        <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">&amp;</span>quot; ... <span style="color: #007800;">$TEST</span><span style="color: #000000; font-weight: bold;">&amp;</span>quot;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">&amp;</span>quot;\r<span style="color: #000000; font-weight: bold;">&amp;</span>quot;
<span style="color: #000000; font-weight: bold;">done</span>;</pre></td></tr></table></div>

<p>&nbsp;</p>
<p><strong>Sample output</strong></p>
<p>Check the availability about the commands that will be used<br />
[Passed] &#8230; /usr/bin/awk<br />
[Passed] &#8230; /bin/cat<br />
[Passed] &#8230; /bin/chgrp<br />
[Passed] &#8230; /bin/chmod<br />
[Passed] &#8230; /bin/dd<br />
[Passed] &#8230; /usr/bin/diff<br />
[Passed] &#8230; /bin/echo<br />
[Passed] &#8230; /usr/bin/find<br />
[Passed] &#8230; /bin/grep<br />
[Passed] &#8230; /usr/bin/last<br />
[Passed] &#8230; /usr/bin/lastb<br />
[Passed] &#8230; /bin/ls<br />
[Passed] &#8230; /usr/bin/lsb_release<br />
[Passed] &#8230; /bin/mkdir<br />
[Passed] &#8230; /sbin/mkfs.ext2<br />
[Passed] &#8230; /bin/mknod<br />
[Passed] &#8230; /bin/mount<br />
[Failed] &#8230; /usr/bin/mysql<br />
[Failed] &#8230; /usr/bin/php5<br />
[Passed] &#8230; /bin/sed<br />
[Passed] &#8230; /usr/bin/seq<br />
[Passed] &#8230; /usr/bin/sort<br />
[Passed] &#8230; /usr/bin/stat<br />
[Passed] &#8230; /usr/bin/tail<br />
[Passed] &#8230; /bin/touch<br />
[Passed] &#8230; /sbin/tune2fs<br />
[Passed] &#8230; /bin/uname<br />
[Passed] &#8230; /usr/bin/yes<br />
[Passed] &#8230; /usr/bin/wc<br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonalsa.com/blog/2012/01/26/bash-shell-script-for-test-the-availability-about-commands-in-the-filesystem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bash shell script for set the memory RAM values of all the virtual machines availables (DMC dynamic range limits) in a Xen XCP domain</title>
		<link>http://www.simonalsa.com/blog/2012/01/22/bash-shell-script-for-set-the-memory-ram-values-of-all-the-virtual-machines-availables-dmc-dynamic-range-limits-in-a-xen-xcp-domain/</link>
		<comments>http://www.simonalsa.com/blog/2012/01/22/bash-shell-script-for-set-the-memory-ram-values-of-all-the-virtual-machines-availables-dmc-dynamic-range-limits-in-a-xen-xcp-domain/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 23:37:54 +0000</pubDate>
		<dc:creator>salonso</dc:creator>
				<category><![CDATA[Configuración]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[XEN]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[DMC]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[limits]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[set]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[values]]></category>
		<category><![CDATA[Virtual Machines]]></category>
		<category><![CDATA[VM]]></category>
		<category><![CDATA[XCP]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.simonalsa.com/?p=1064</guid>
		<description><![CDATA[This bash shell script reads from file the configuration (Memory.pref) about the predefined virtual machines memory ram values and sets the values for each one virtual machines available (DMC dynamic and static range limits) in a Xen XCP domain. Memory.bash &#160;&#160;&#160;&#160;&#160; 1 #!/bin/bash &#160;&#160;&#160;&#160;&#160; 2 VM_NAMES=$(for i in `xe vm-list params=name-label &#124; grep &#34;name-label&#34; &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>This bash shell script reads from file the configuration (Memory.pref) about the predefined virtual machines memory ram values and sets the values for each one virtual machines available (DMC dynamic and static range limits) in a Xen XCP domain.</p>
<p><strong>Memory.bash</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 #!/bin/bash<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 VM_NAMES=$(for i in `xe vm-list params=name-label | grep &quot;name-label&quot; | grep -v &quot;Control&quot; | sort | awk -F&quot;: &quot; &#8216;{ print $2 }&#8217;`; do echo $i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; done)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 for VM_NAME in $VM_NAMES;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4 do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp; UUID=$(xe vm-list name-label=$VM_NAME params=uuid | grep uuid | awk -F&quot;: &quot; &#8216;{ print $2 }&#8217;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp; if [ $? -eq 0 ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LIMITS=$(cat Memory.prefs | grep $VM_NAME)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ $? -eq 0 ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MINIMUM_DYN=$(echo $LIMITS | awk -F&quot;:&quot; &#8216;{ print $2 }&#8217;)<br />
&nbsp;&nbsp;&nbsp;&nbsp; 10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MINI_DYN=$[$MINIMUM_DYN * 1024 * 1024]<br />
&nbsp;&nbsp;&nbsp;&nbsp; 11&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAXIMUM_DYN=$(echo $LIMITS | awk -F&quot;:&quot; &#8216;{ print $3 }&#8217;)<br />
&nbsp;&nbsp;&nbsp;&nbsp; 12&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAXI_DYN=$[$MAXIMUM_DYN * 1024 * 1024]<br />
&nbsp;&nbsp;&nbsp;&nbsp; 13<br />
&nbsp;&nbsp;&nbsp;&nbsp; 14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MINIMUM_ST=$(echo $LIMITS | awk -F&quot;:&quot; &#8216;{ print $4 }&#8217;)<br />
&nbsp;&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MINI_ST=$[$MINIMUM_ST * 1024 * 1024]<br />
&nbsp;&nbsp;&nbsp;&nbsp; 16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAXIMUM_ST=$(echo $LIMITS | awk -F&quot;:&quot; &#8216;{ print $5 }&#8217;)<br />
&nbsp;&nbsp;&nbsp;&nbsp; 17&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAXI_ST=$[$MAXIMUM_ST * 1024 * 1024]<br />
&nbsp;&nbsp;&nbsp;&nbsp; 18<br />
&nbsp;&nbsp;&nbsp;&nbsp; 19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #echo &quot;DYN: $MINIMUM_DYN as $MINI_DYN &#8230;.VS&#8230; $MAXIMUM_DYN as $MAXI_DYN&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp; 20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #echo &quot;ST:&nbsp; $MINIMUM_ST as $MINI_ST &#8230;.VS&#8230; $MAXIMUM_ST as $MAXI_ST&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp; 21<br />
&nbsp;&nbsp;&nbsp;&nbsp; 22&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CHECK1=false<br />
&nbsp;&nbsp;&nbsp;&nbsp; 23&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SETPARAM=$(xe vm-param-set uuid=$UUID memory-static-min=$MINI_ST)<br />
&nbsp;&nbsp;&nbsp;&nbsp; 24&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ $? -eq 0 ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp; 25&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CHECK1=true;<br />
&nbsp;&nbsp;&nbsp;&nbsp; 26&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<br />
&nbsp;&nbsp;&nbsp;&nbsp; 27&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SETPARAM=$(xe vm-param-set uuid=$UUID memory-static-max=$MAXI_ST)<br />
&nbsp;&nbsp;&nbsp;&nbsp; 28&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ $? -eq 0 ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp; 29&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CHECK2=true;<br />
&nbsp;&nbsp;&nbsp;&nbsp; 30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<br />
&nbsp;&nbsp;&nbsp;&nbsp; 31<br />
&nbsp;&nbsp;&nbsp;&nbsp; 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ $CHECK1 = true ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp; 33&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ $CHECK2 = true ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp; 34&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;The DMC static range ( $MINIMUM_ST &#8230; $MAXIMUM_ST ) about $VM_NAME virtual machine has been updated successfully&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp; 35&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />
&nbsp;&nbsp;&nbsp;&nbsp; 36&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;Can not update the maximun DMC static range about $VM_NAME virtual machine&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp; 37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<br />
&nbsp;&nbsp;&nbsp;&nbsp; 38&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />
&nbsp;&nbsp;&nbsp;&nbsp; 39&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;Can not update the minimum DMC static range about $VM_NAME virtual machine&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp; 40&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<br />
&nbsp;&nbsp;&nbsp;&nbsp; 41<br />
&nbsp;&nbsp;&nbsp;&nbsp; 42&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SETPARAM=$(xe vm-memory-dynamic-range-set uuid=$UUID min=$MINI_DYN max=$MAXI_DYN)<br />
&nbsp;&nbsp;&nbsp;&nbsp; 43&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ $? -eq 0 ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp; 44&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;The DMC dynamic range ( $MINIMUM_DYN &#8230; $MAXIMUM_DYN ) about $VM_NAME virtual machine has been updated successfully&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp; 45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />
&nbsp;&nbsp;&nbsp;&nbsp; 46&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;Can not update the DMC dynamic range about $VM_NAME virtual machine&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp; 47&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<br />
&nbsp;&nbsp;&nbsp;&nbsp; 48&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<br />
&nbsp;&nbsp;&nbsp;&nbsp; 49&nbsp;&nbsp;&nbsp; fi<br />
&nbsp;&nbsp;&nbsp;&nbsp; 50 done<br />
&nbsp;</p>
<p>Set the default memory ram values for each virtual machine in &quot;Memory.prefs&quot;</p>
<p>Fields:</p>
<p>1- Virtual machine name as &quot;name-label&quot;</p>
<p>2.- DMC&#8217;s dynamic lower limit value about&nbsp; as &quot;memory-dynamic-min&quot;</p>
<p>3.- DMC&#8217;s dynamic higger limit value about&nbsp; as &quot;memory-dynamic-max&quot;</p>
<p>4.- DMC&#8217;s static lower limit as &quot;memory-static-min&quot;</p>
<p>5.- DMC&#8217;s static higger as &quot;memory-static-max&quot;</p>
<p><strong>Memory.prefs</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 Application-Server-01:256:512:192:576<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 Application-Server-02:256:512:192:576<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 Application-Server-03:256:512:192:576<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4 Debian-Desktop-1.0:256:384:224:416<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5 DNS-Server-1.0:64:88:48:104<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6 DNS-Server-2.0:64:88:48:104<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7 File-Server-1.0:128:192:96:224<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8 File-Server-2.0:128:192:96:224<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9 LDAP-Server-1.0:64:88:48:104<br />
&nbsp;&nbsp;&nbsp;&nbsp; 10 LDAP-Server-2.0:64:88:48:104<br />
&nbsp;&nbsp;&nbsp;&nbsp; 11 Log-Server-1.0:64:88:48:104<br />
&nbsp;&nbsp;&nbsp;&nbsp; 12 Sql-Server-1.0:128:256:96:224<br />
&nbsp;&nbsp;&nbsp;&nbsp; 13 Web-Server-1.0:88:152:72:168<br />
&nbsp;&nbsp;&nbsp;&nbsp; 14 Web-Server-2.0:88:152:72:168<br />
&nbsp;&nbsp;&nbsp;&nbsp; 15 Web-Server-3.0:88:152:72:168<br />
&nbsp;</p>
<p><strong>Output</strong></p>
<p>[root@thor ~]# bash Memory.bash</p>
<p>The DMC static range ( 192 &#8230; 576 ) about Application-Server-01 virtual machine has been updated successfully<br />
The DMC dynamic range ( 256 &#8230; 512 ) about Application-Server-01 virtual machine has been updated successfully<br />
The DMC static range ( 192 &#8230; 576 ) about Application-Server-02 virtual machine has been updated successfully<br />
The DMC dynamic range ( 256 &#8230; 512 ) about Application-Server-02 virtual machine has been updated successfully<br />
The DMC static range ( 192 &#8230; 576 ) about Application-Server-03 virtual machine has been updated successfully<br />
The DMC dynamic range ( 256 &#8230; 512 ) about Application-Server-03 virtual machine has been updated successfully<br />
The DMC static range ( 224 &#8230; 416 ) about Debian-Desktop-1.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 256 &#8230; 384 ) about Debian-Desktop-1.0 virtual machine has been updated successfully<br />
The DMC static range ( 48 &#8230; 104 ) about DNS-Server-1.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 64 &#8230; 88 ) about DNS-Server-1.0 virtual machine has been updated successfully<br />
The DMC static range ( 48 &#8230; 104 ) about DNS-Server-2.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 64 &#8230; 88 ) about DNS-Server-2.0 virtual machine has been updated successfully<br />
The DMC static range ( 96 &#8230; 224 ) about File-Server-1.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 128 &#8230; 192 ) about File-Server-1.0 virtual machine has been updated successfully<br />
The DMC static range ( 96 &#8230; 224 ) about File-Server-2.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 128 &#8230; 192 ) about File-Server-2.0 virtual machine has been updated successfully<br />
The DMC static range ( 48 &#8230; 104 ) about LDAP-Server-1.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 64 &#8230; 88 ) about LDAP-Server-1.0 virtual machine has been updated successfully<br />
The DMC static range ( 48 &#8230; 104 ) about LDAP-Server-2.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 64 &#8230; 88 ) about LDAP-Server-2.0 virtual machine has been updated successfully<br />
The DMC static range ( 48 &#8230; 104 ) about Log-Server-1.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 64 &#8230; 88 ) about Log-Server-1.0 virtual machine has been updated successfully<br />
The DMC static range ( 96 &#8230; 224 ) about Sql-Server-1.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 128 &#8230; 256 ) about Sql-Server-1.0 virtual machine has been updated successfully<br />
The DMC static range ( 72 &#8230; 168 ) about Web-Server-1.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 88 &#8230; 152 ) about Web-Server-1.0 virtual machine has been updated successfully<br />
The DMC static range ( 72 &#8230; 168 ) about Web-Server-2.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 88 &#8230; 152 ) about Web-Server-2.0 virtual machine has been updated successfully<br />
The DMC static range ( 72 &#8230; 168 ) about Web-Server-3.0 virtual machine has been updated successfully<br />
The DMC dynamic range ( 88 &#8230; 152 ) about Web-Server-3.0 virtual machine has been updated successfully<br />
&nbsp;</p>
<p><strong>Runtime RAM values</strong></p>
<p><a href="http://www.simonalsa.com/wp-content/uploads/2012/01/DMC-.jpg"><img height="91" width="300" src="http://www.simonalsa.com/wp-content/uploads/2012/01/DMC--300x91.jpg" alt="" class="aligncenter size-medium wp-image-1065" /></a></p>
<p style="text-align: center"><em>&quot;xentop&quot;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonalsa.com/blog/2012/01/22/bash-shell-script-for-set-the-memory-ram-values-of-all-the-virtual-machines-availables-dmc-dynamic-range-limits-in-a-xen-xcp-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DMC (Dynamic Memory Control) feature at Xen XCP</title>
		<link>http://www.simonalsa.com/blog/2012/01/21/dmc-dynamic-memory-control-feature-at-xen-xcp/</link>
		<comments>http://www.simonalsa.com/blog/2012/01/21/dmc-dynamic-memory-control-feature-at-xen-xcp/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 16:45:27 +0000</pubDate>
		<dc:creator>salonso</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[XEN]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[DMC]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[XCP]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.simonalsa.com/?p=1058</guid>
		<description><![CDATA[Dynamic Memory Control (DMC) is a technology provided by Xen Cloud Platform (XCP). DMC allows you to change the amount of host memory assigned to any running virtual server, without rebooting it. Using DMC, it&#8217;s possible to operate a guest virtual machine in one of two modes: 1) Target Mode &#160;&#160;&#160; The administrator specifies a [...]]]></description>
			<content:encoded><![CDATA[<p>Dynamic Memory Control (DMC) is a technology provided by Xen Cloud Platform (XCP).</p>
<p>DMC allows you to change the amount of host memory assigned to any running virtual server, without rebooting it.</p>
<p>Using DMC, it&#8217;s possible to operate a guest virtual machine in one of two modes:</p>
<p>1) Target Mode<br />
&nbsp;&nbsp;&nbsp; The administrator specifies a memory target for the guest. XCP adjusts the guest&#8217;s memory allocation to meet the target.</p>
<p>2) Dynamic Range Mode<br />
&nbsp;&nbsp;&nbsp; The administrator specifies a dynamic memory range for the guest. XCP chooses a target from within the range and adjusts the guest&#8217;s memory allocation to meet the target. Dynamic memory range represents the lower and upper limit of a dynamic memory range.&nbsp; It&#8217;s the minimum and maximun amount of memory that the administrator is happy for a guest to use.</p>
<p>You can alter the VM&#8217;s DMC mode &quot;as you want&quot; online without reboot it.</p>
<p>Check <a href="http://wiki.xensource.com/xenwiki/Dynamic_Memory_Control">http://wiki.xensource.com/xenwiki/Dynamic_Memory_Control</a> for more information</p>
<p>For example:</p>
<p>1) Mode As Target Mode ( 160 MB )<br />
[root@thor ~]# xe vm-memory-target-set uuid=9e07177c-5bee-61a3-f743-6675f6a6a81e target=167772160<br />
[root@thor ~]# xe vm-param-list uuid=9e07177c-5bee-61a3-f743-6675f6a6a81e | grep &quot;memory-&quot; | grep -v &quot;last&quot; | grep -v &quot;recomendation&quot;<br />
&#8230;<br />
&#8230;<br />
memory-static-max ( RW): 167772160<br />
memory-static-min ( RW): 67108864<br />
&#8230;<br />
&#8230;</p>
<p>[root@thor ~]# xe vm-param-get uuid=9e07177c-5bee-61a3-f743-6675f6a6a81e param-name=memory-target<br />
167772160</p>
<p>&nbsp;</p>
<p><a href="http://www.simonalsa.com/wp-content/uploads/2012/01/DMC-Target-1-.jpg"><img height="92" width="300" src="http://www.simonalsa.com/wp-content/uploads/2012/01/DMC-Target-1--300x92.jpg" alt="" class="aligncenter size-medium wp-image-1059" /></a></p>
<p style="text-align: center"><em>&quot;DNS-Server-XX&quot;</em></p>
<p>2) Mode As Dynamic Range Mode ( [64...128] MB )</p>
<p>Set VM&#8217;s DMC limits<br />
[root@thor ~]# xe vm-memory-dynamic-range-set uuid=9e07177c-5bee-61a3-f743-6675f6a6a81e min=67108864 max=134217728</p>
<p>Check VM&#8217;s DMS limits</p>
<p>[root@thor ~]# xe vm-param-list uuid=9e07177c-5bee-61a3-f743-6675f6a6a81e | grep &quot;memory-&quot; | grep -v &quot;last&quot; | grep -v &quot;recommendations&quot;<br />
&#8230;<br />
&#8230;<br />
memory-dynamic-max ( RW): 134217728<br />
memory-dynamic-min ( RW): 67108864<br />
&#8230;<br />
&#8230;</p>
<p>[root@thor ~]# xe vm-param-get uuid=9e07177c-5bee-61a3-f743-6675f6a6a81e param-name=memory-target<br />
134217728<br />
&nbsp;</p>
<p><a href="http://www.simonalsa.com/wp-content/uploads/2012/01/DMC-Dynamic-1-.jpg"><img height="123" width="300" src="http://www.simonalsa.com/wp-content/uploads/2012/01/DMC-Dynamic-1--300x123.jpg" alt="" class="aligncenter size-medium wp-image-1060" /></a></p>
<p style="text-align: center"><em>&quot;DNS-Server-XX&quot;</em></p>
<p>Really nice powerfull feature<br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonalsa.com/blog/2012/01/21/dmc-dynamic-memory-control-feature-at-xen-xcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

