<?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>PepperCrew</title>
	<atom:link href="http://www.peppercrew.nl/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peppercrew.nl</link>
	<description></description>
	<lastBuildDate>Fri, 27 Apr 2012 13:04:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Tabstops in a .Net CheckedListbox</title>
		<link>http://www.peppercrew.nl/index.php/2012/04/tabstops-in-a-net-checkedlistbox/</link>
		<comments>http://www.peppercrew.nl/index.php/2012/04/tabstops-in-a-net-checkedlistbox/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 13:04:01 +0000</pubDate>
		<dc:creator>Marco Hokke</dc:creator>
				<category><![CDATA[Marco Hokke]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[CheckedListbox]]></category>
		<category><![CDATA[customization]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://www.peppercrew.nl/index.php/2012/04/tabstops-in-a-net-checkedlistbox/</guid>
		<description><![CDATA[For one of my projects I needed to create a simple CheckedListbox containing various entries of a specific entity, of which the user may select one (and only one). I wanted the entries of this listbox to be more than just the instance name of an entity; they should also include a description and optionally [...]]]></description>
			<content:encoded><![CDATA[<p><a  class="thickbox no_icon" href="http://www.peppercrew.nl/wp-content/uploads/2012/04/image.png" rel="gallery-4207" title="image"><img style="border-right-width: 0px;margin: 2px 10px 0px 0px;padding-left: 0px;padding-right: 0px;float: left;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px" border="0" alt="image" align="left" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/image_thumb.png" width="249" height="73" /></a>For one of my projects I needed to create a simple CheckedListbox containing various entries of a specific entity, of which the user may select one (and only one). I wanted the entries of this listbox to be more than just the instance name of an entity; they should also include a description and optionally other data depending on the type of entity. And I wanted these items to be lined up.</p>
<p>One way to do this is to use a gridview, but it was too much hassle and gridviews generally don’t look very good. Should you consider this choice: note that the checked listbox I use does not have columnheaders.</p>
<p>There is an out-of-the-box way to line up the various items in each line of the checked listbox. This post will tell you how to achieve this.</p>
<p><span id="more-4207"></span>
<p>The code below sets some properties of the CheckedListbox that prepare it to use custom tabstops:</p>
<p><strong>CheckedListBox1.UseCompatibleTextRendering = True      <br />CheckedListBox1.UseTabStops = False       <br />CheckedListBox1.UseCustomTabOffsets = True</strong></p>
<p>The next step is to define the custom tabstops. This is a bit tricky. Let’s take a look at how to define the tabstops. Calculating the widths we want will be easier after that. </p>
<p>To add tabstops to the control, use the Add or AddRange methods of the CustomTabOffsets property of the CheckedListbox:</p>
<p align="left"><strong>CheckedListBox1.CustomTabOffsets.AddRange(New Integer() {70, 100, 150})      <br /></strong>-or-     <br /><strong>CheckedListBox1.CustomTabOffsets.Add(70)      <br /></strong><strong>CheckedListBox1.CustomTabOffsets.Add(100)      <br /></strong><strong>CheckedListBox1.CustomTabOffsets.Add(150)</strong></p>
<p>The control will automatically sort the values and remove any duplicates. </p>
<p>The question now is: what do these values mean? As it turns out, the integer values represent one quarter of the average letter-width in the font that the listbox uses. The implication is that it’s virtually impossible to define the exact width of each tab, because we don’t know what that average value is.</p>
<p>The next step is to define how much space you need to put into each tab. You can iterate through all the items in your listbox, splitting them by vbTab, and keeping track of the longest item in each tab-separated column. Once you know how much characters make up the longest word in each column, multiply them by 4 and add a little margin; that’s the integer value you want in your CustomTabOffsets collection: (t<em>his code assumes there are always at least two items separated by a vbTab character</em>)</p>
<p><strong>For Each l_strItem As String In CheckedListBox1.Items      <br />&#160;&#160;&#160; Dim l_strItems As String() = l_strItem.Split(vbTab)       <br />&#160;&#160;&#160; l_intLongName = Math.Max(l_intLongName, l_strItems(0).Length)       <br />&#160;&#160;&#160; l_intLongDescr = Math.Max(l_intLongDescr, l_strItems(1).Length)       <br />Next</strong></p>
<p><strong>CheckedListBox1.CustomTabOffsets.Add(l_intLongName * 5 + 16)      <br />CheckedListBox1.CustomTabOffsets.Add(l_intLongDescr * 5 + 16)</strong></p>
<p>As a final remark: because lists like this typically consist of small items of 10 to 30 characters, it is likely that the tab-width calculated as above is not enough. I found that multiplying by 5 gives better results!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peppercrew.nl/index.php/2012/04/tabstops-in-a-net-checkedlistbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disk is offline because of a policy set by an administrator</title>
		<link>http://www.peppercrew.nl/index.php/2012/04/disk-is-offline-because-of-a-policy-set-by-an-administrator/</link>
		<comments>http://www.peppercrew.nl/index.php/2012/04/disk-is-offline-because-of-a-policy-set-by-an-administrator/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 06:46:57 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Martin Ligtvoet]]></category>

		<guid isPermaLink="false">http://www.peppercrew.nl/index.php/2012/04/disk-is-offline-because-of-a-policy-set-by-an-administrator/</guid>
		<description><![CDATA[After P2V: disk error “the disk is offline because of a policy set by an Administrator” After a P2V from a Windows 2008 Enterprise server to a VM with Virtual Hardware 7, I get the following error in disk Management : the disk is offline because of a policy set by an Administrator. I’d look [...]]]></description>
			<content:encoded><![CDATA[<p>After P2V: disk error “the disk is offline because of a policy set by an Administrator”</p>
<p>After a P2V from a Windows 2008 Enterprise server to a VM with Virtual Hardware 7, I get the following error in disk Management : the disk is offline because of a policy set by an Administrator.</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/clip_image001.png" class="thickbox no_icon" rel="gallery-4197" title="clip_image001"><img style="border: 0px" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/clip_image001_thumb.png" alt="clip_image001" width="244" height="52" border="0" /></a></p>
<p>I’d look in to the policies, the user and server had no policies set on them. So what now….</p>
<p>I found out that the default SAN Policy for Windows Server 2008 Enterprise is set to “Offline Shared”</p>
<p>How to check:</p>
<p><span id="more-4197"></span>From command line<br />
<strong>DISKPART.exe</strong><br />
DISKPART&gt; <strong>san</strong><br />
<em>SAN Policy : Offline Shared</em></p>
<p>Once you checked the applied policy you can set the disk online, as follow:</p>
<p>DISKPART&gt; <strong>san policy=onlineall</strong><br />
<em>Diskpart successfully changed the SAN policy for the current operating system</em></p>
<p>DISKPART&gt;<strong>list disk</strong></p>
<p><em>Disk ### Status Size Free Dyn Gpt<br />
Disk 0 Online 30 GB<br />
Disk 1 Offline 50 GB<br />
Disk 2 Offline 80 GB<br />
</em><em>Disk 3 Offline 250 GB<br />
</em><em>Disk 4 Offline 50 GB </em></p>
<p>In my case, disk 1 till 4 was offline so I had to repeat the following steps several times.</p>
<p>Select a offline disk</p>
<p>DISKPART&gt; <strong>select disk 1<br />
</strong><em>Disk 1 is now the selected disk</em></p>
<p>DISKPART&gt;<strong>attributes disk clear readonly</strong><br />
<em>Disk attributes cleared successfully.</em></p>
<p>And to check if all the settings are now correct, type “<strong>attributes disk</strong>”.<br />
This will give an output something like this:</p>
<p><em>Current Read-only State : No<br />
Read-only : No<br />
Boot Disk : No<br />
Pagefile Disk : No<br />
Hibernation File Disk : No<br />
Crashdump Disk : No<br />
Clustered Disk : No<br />
</em><br />
Now type “<strong>online disk</strong>” to bring the disk online.</p>
<p>If Clustered disk is set to YES. You have to stop the nodes. After that you are allowed to do the action above.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peppercrew.nl/index.php/2012/04/disk-is-offline-because-of-a-policy-set-by-an-administrator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install an FTP client on a Synology NAS</title>
		<link>http://www.peppercrew.nl/index.php/2012/04/how-to-install-an-ftp-client-on-a-synology-nas/</link>
		<comments>http://www.peppercrew.nl/index.php/2012/04/how-to-install-an-ftp-client-on-a-synology-nas/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 11:03:43 +0000</pubDate>
		<dc:creator>Ingmar Verheij</dc:creator>
				<category><![CDATA[Ingmar Verheij]]></category>
		<category><![CDATA[dsm]]></category>
		<category><![CDATA[ipkg]]></category>
		<category><![CDATA[lftp]]></category>
		<category><![CDATA[synology]]></category>

		<guid isPermaLink="false">http://www.peppercrew.nl/index.php/2012/04/how-to-install-an-ftp-client-on-a-synology-nas/</guid>
		<description><![CDATA[Author: Ingmar Verheij A Synology NAS can be used as a FTP server out-of-the-box (after enabling it), but there is no FTP client installed that can be used from a interactive shell. You can install a FTP client, lftp by Alexander Lukyanov, using ipkg. If you haven’t installed ipkg yet, please install it first (link). [...]]]></description>
			<content:encoded><![CDATA[<p>Author: <a  href="http://www.ingmarverheij.com/" target="_blank">Ingmar Verheij</a></p>
<p><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" align="left" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/embosip_FTP_Active.gif" width="119" height="76" /></p>
<p>A Synology NAS can be used as a FTP server out-of-the-box (after enabling it), but there is no FTP client installed that can be used from a interactive shell. You can install a FTP client, <a  href="http://en.wikipedia.org/wiki/Lftp" target="_blank"><em>lftp</em></a> by Alexander Lukyanov, using <em>ipkg</em>.</p>
<p>If you haven’t installed <em>ipkg </em>yet, please install it first (<a  href="http://www.ingmarverheij.com/?p=3681" target="_blank">link</a>).</p>
<p><span id="more-4187"></span><br />
<h4>Install package lftp</h4>
<p>You can install the package <em>lftp</em> in with the command: <font face="Courier New">ipkg install lftp</font></p>
<h4>&#160;<a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-1-ipkg.png" class="thickbox no_icon" rel="gallery-4187" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-1-ipkg_thumb.png" width="204" height="204" /></a></h4>
<h4>&#160;</h4>
<h4>Disable certificate verification </h4>
<p>By default <em>lftp </em>will check the ssl certificate of the destination. If no trusted certificate is found the command is not executed.</p>
<div class="dean_ch" style="white-space: wrap;">$ lftp user@provider.com:/directory<br />
Password: <br />
<span class="kw3">cd</span>: Fatal error: Certificate verification: Not trusted</div>
<p>You can disable the certificate verification in <u><em>lftp </em></u>by setting an option in the <em>~/.lftp/rc</em> file. This file does not exist by default, nor does the .lftp directory. </p>
<ol>
<li>Create the <em>.lftp </em>directory with the command : <font face="Courier New">mkdir /root/.lftp</font> </li>
<li>Create and edit the <em>rc</em> file with the command : <font face="Courier New">vi /root/.lftp/rc</font> </li>
<li>Press ‘i’ for edit mode </li>
<li>Add the line : <font face="Courier New">set ssl:verify-certificate no</font> </li>
<li>Exit edit mode by pressing Escape (twice) </li>
<li>Close and save the file by pressing Z (capital z) twice) </li>
</ol>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-2-vi.png" class="thickbox no_icon" rel="gallery-4187" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-2-vi_thumb.png" width="204" height="49" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-3-rc.png" class="thickbox no_icon" rel="gallery-4187" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-3-rc_thumb.png" width="204" height="49" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peppercrew.nl/index.php/2012/04/how-to-install-an-ftp-client-on-a-synology-nas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install ipkg on Synology NAS (DS212+)</title>
		<link>http://www.peppercrew.nl/index.php/2012/04/how-to-install-ipkg-on-synology-nas-ds212/</link>
		<comments>http://www.peppercrew.nl/index.php/2012/04/how-to-install-ipkg-on-synology-nas-ds212/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 10:53:56 +0000</pubDate>
		<dc:creator>Ingmar Verheij</dc:creator>
				<category><![CDATA[Ingmar Verheij]]></category>
		<category><![CDATA[ds212]]></category>
		<category><![CDATA[dsm]]></category>
		<category><![CDATA[ipkg]]></category>
		<category><![CDATA[synology]]></category>

		<guid isPermaLink="false">http://www.peppercrew.nl/index.php/2012/04/how-to-install-ipkg-on-synology-nas-ds212/</guid>
		<description><![CDATA[Author: Ingmar Verheij If you want to install additional packages on your Synology NAS you first need to install ipkg. In this post I’ll explain the steps you need to take to install this package on your Synology NAS. If you don’t have terminal access, please enable that first (link). First thing you need to [...]]]></description>
			<content:encoded><![CDATA[<p>Author: <a  href="http://www.ingmarverheij.com/" target="_blank">Ingmar Verheij</a></p>
<p><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Synology DS212+" border="0" alt="Synology DS212+" align="right" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/DS212.jpg" width="92" height="92" /></p>
<p>If you want to install additional packages on your Synology NAS you first need to install <em>ipkg</em>. In this post I’ll explain the steps you need to take to install this package on your Synology NAS.</p>
<p>If you don’t have terminal access, please enable that first (<a  href="http://www.ingmarverheij.com/2012/04/how-to-enable-terminal-access-to-synology-nas/" target="_blank">link</a>).</p>
<p><span id="more-4179"></span>
<p>First thing you need to do is determine what kind of CPU your Synology NAS has. The easiest way is looking it up in on the Synology Wiki page (<a  href="http://forum.synology.com/wiki/index.php/What_kind_of_CPU_does_my_NAS_have" target="_blank">What kind of CPU does my NAS have</a>). In case of my DS212+ it’s a <a  href="http://www.marvell.com/embedded-processors/kirkwood/assets/88f6282-3_pb.pdf" target="_blank">Marvell Kirkwood mv6282</a>.</p>
<p>Now you know what CPU your Synology NAS has you can find the appropriate bootstrap.</p>
<table border="1" cellspacing="0" cellpadding="1" width="514">
<tbody>
<tr>
<td valign="top" width="148"><strong>CPU</strong></td>
<td valign="top" width="283"><strong>Bootstrap</strong></td>
<td valign="top" width="81"><strong>Package feed</strong></td>
</tr>
<tr>
<td valign="top" width="148">Intel XScale FW IXP420 BB ARM </td>
<td valign="top" width="281"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/ds101/cross/unstable/ds101-bootstrap_1.0-4_armeb.xsh" target="_blank">ds101-bootstrap_1.0-4_armeb.xsh</a></td>
<td valign="top" width="84"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/ds101/cross/unstable/" target="_blank">link</a></td>
</tr>
<tr>
<td valign="top" width="147">Intel Atom CPU&#8217;s: D410, D425, D510, D525 and D2700 </td>
<td valign="top" width="280"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh" target="_blank">syno-i686-bootstrap_1.2-7_i686.xsh</a>           </td>
<td valign="top" width="87"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/" target="_blank">link</a></td>
</tr>
<tr>
<td valign="top" width="146">8241 PPC </td>
<td valign="top" width="278"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/ds101-bootstrap_1.0-4_powerpc.xsh" target="_blank">ds101-bootstrap_1.0-4_powerpc.xsh</a></td>
<td valign="top" width="89"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/unstable/" target="_blank">link</a></td>
</tr>
<tr>
<td valign="top" width="145">8533 PPC&#160; / 8543 PPC </td>
<td valign="top" width="277"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/syno-e500/cross/unstable/syno-e500-bootstrap_1.2-7_powerpc.xsh" target="_blank">syno-e500-bootstrap_1.2-7_powerpc.xsh</a></td>
<td valign="top" width="91"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/syno-e500/cross/unstable/" target="_blank">link</a></td>
</tr>
<tr>
<td valign="top" width="145">mv5281 ARM </td>
<td valign="top" width="276"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/syno-x07-bootstrap_1.2-7_arm.xsh" target="_blank">syno-x07-bootstrap_1.2-7_arm.xsh</a></td>
<td valign="top" width="93"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/" target="_blank">link</a></td>
</tr>
<tr>
<td valign="top" width="144">Marvel Kirkwood mv6281 ARM </td>
<td valign="top" width="274"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh" target="_blank">syno-mvkw-bootstrap_1.2-7_arm.xsh</a></td>
<td valign="top" width="94"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/" target="_blank">link</a></td>
</tr>
<tr>
<td valign="top" width="144">Marvel Kirkwood mv6282 ARM </td>
<td valign="top" width="274"><a  href="http://wizjos.endofinternet.net/synology/archief/syno-mvkw-bootstrap_1.2-7_arm-ds111.xsh" target="_blank">syno-mvkw-bootstrap_1.2-7_arm-ds111.xsh</a></td>
<td valign="top" width="95"><a  href="http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/" target="_blank">link</a></td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p>Now you can install <em>ipkg</em> in 8 (or 9 steps):</p>
<ol>
<li>Login to your NAS with username <em>root </em>(same password as admin) </li>
<li>Change the directory to /root : <font face="Courier New">cd /root</font> </li>
<li>Download the bootstrap you found in the above : <font face="Courier New">wget &lt;bootstrap url&gt;</font> </li>
<li>Mark the .xsh script executable : <font face="Courier New">chmod + &lt;name of the bootstap&gt;</font> </li>
<li>Run the .xsh script (this is where you will install the <em>ipkg</em> package): <font face="Courier New">sh &lt;name of the bootstrap&gt;</font> </li>
<li><font face="Courier New"><font face="Arial">Remove the .xsh script : </font>rm &lt;name of the bootstrap&gt;</font> </li>
<li><strong>ONLY FOR DSM 4.0 </strong>Comment the lines following lines in the file /root/.profile
<ul>
<li><font face="Courier New">PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin</font> </li>
<li><font face="Courier New">export PATH</font> </li>
</ul>
</li>
<li>Reboot the NAS : <font face="Courier New">reboot</font> </li>
<li>Update the ipkg list of available packages : <font face="Courier New">ipkg update</font> </li>
</ol>
<p>&#160;</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-1-wget.png" class="thickbox no_icon" rel="gallery-4179" title="Step 3) Download the bootstrap"><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Step 3) Download the bootstrap" border="0" alt="Step 3) Download the bootstrap" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-1-wget_thumb.png" width="204" height="74" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-2-chmod.png" class="thickbox no_icon" rel="gallery-4179" title="Step 4) Mark the .xsh script executable"><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Step 4) Mark the .xsh script executable" border="0" alt="Step 4) Mark the .xsh script executable" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-2-chmod_thumb.png" width="204" height="25" /></a></p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-3-sh.png" class="thickbox no_icon" rel="gallery-4179" title="Step 5) Run the .xsh script"><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Step 5) Run the .xsh script" border="0" alt="Step 5) Run the .xsh script" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-3-sh_thumb.png" width="204" height="143" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-4-rm.png" class="thickbox no_icon" rel="gallery-4179" title="Step 6) Remove the .xsh script"><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Step 6) Remove the .xsh script" border="0" alt="Step 6) Remove the .xsh script" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-4-rm_thumb.png" width="204" height="20" /></a></p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-5-profile.png" class="thickbox no_icon" rel="gallery-4179" title="Step 7) Comment lines in the .profile file"><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Step 7) Comment lines in the .profile file" border="0" alt="Step 7) Comment lines in the .profile file" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-5-profile_thumb.png" width="204" height="204" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-6-update.png" class="thickbox no_icon" rel="gallery-4179" title="Step 9) Update the list of available packages"><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Step 9) Update the list of available packages" border="0" alt="Step 9) Update the list of available packages" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/step-6-update_thumb.png" width="204" height="44" /></a></p>
<p>   <br clear="all" />More information about install ipkg can be found <a  href="http://forum.synology.com/wiki/index.php/Overview_on_modifying_the_Synology_Server,_bootstrap,_ipkg_etc#Installing_compiled.2Fbinary_programs_using_ipkg" target="_blank">here</a>.</p>
<p>&#160;</p>
<h4>How to use ipkg</h4>
<p>You can install a package using the command : <font face="Courier New">ipkg install &lt;packagename&gt;</font></p>
<p>Upgrading already installed packages can be done with the command : <font face="Courier New">ipkg upgrade</font></p>
<p><font face="Courier New"></font></p>
<p><font face="Courier New"><font face="Arial">You can list all available packages with : </font>ipkg list</font><font face="Arial">. This might produce a long list (and take a long while). If you want to narrow down the list you can search in the results: </font><font face="Courier New">ipkg list | grep &lt;your filter&gt;</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peppercrew.nl/index.php/2012/04/how-to-install-ipkg-on-synology-nas-ds212/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to enable terminal access to Synology NAS</title>
		<link>http://www.peppercrew.nl/index.php/2012/04/how-to-enable-terminal-access-to-synology-nas/</link>
		<comments>http://www.peppercrew.nl/index.php/2012/04/how-to-enable-terminal-access-to-synology-nas/#comments</comments>
		<pubDate>Sat, 21 Apr 2012 17:42:02 +0000</pubDate>
		<dc:creator>Ingmar Verheij</dc:creator>
				<category><![CDATA[Ingmar Verheij]]></category>
		<category><![CDATA[dsm]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[synology]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.peppercrew.nl/index.php/2012/04/how-to-enable-terminal-access-to-synology-nas/</guid>
		<description><![CDATA[Author: Ingmar Verheij For certain (more complex) tasks you might need terminal access to your Synology NAS. Enabling terminal access to your Synology NAS is done quite easily. You can enable both Telnet (non encrypted – insecure) or SSH (encrypted – more secure) access. Enabling the services Terminal access is enabled by enabling the Telnet [...]]]></description>
			<content:encoded><![CDATA[<p>Author: <a  href="http://www.ingmarverheij.com/" target="_blank">Ingmar Verheij</a></p>
<p><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" align="left" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Synology.jpg" width="119" height="80" /></p>
<p>For certain (more complex) tasks you might need terminal access to your Synology NAS. Enabling terminal access to your Synology NAS is done quite easily.</p>
<p>You can enable both Telnet (non encrypted – insecure) or SSH (encrypted – more secure) access. </p>
<p><span id="more-4165"></span><br />
<h4>Enabling the services</h4>
<p>Terminal access is enabled by enabling the Telnet or the SSH service via the Control panel. This is done in four easy steps:</p>
<ol>
<li>Open the Control Panel </li>
<li>Open the Terminal applet (under Network Services) </li>
<li>Enable the Telnet and/or SSH service </li>
<li>Apply the settings </li>
</ol>
<h4><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Home-screen.png" class="thickbox no_icon" rel="gallery-4165" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Home-screen_thumb.png" width="79" height="126" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel.png" class="thickbox no_icon" rel="gallery-4165" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel_thumb.png" width="230" height="126" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-Terminal.png" class="thickbox no_icon" rel="gallery-4165" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-Terminal_thumb.png" width="352" height="104" /></a></h4>
<p>You can access the Synology NAS via a Telnet/SSH client like PuTTY (<a  href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">link</a>).</p>
<h4>   <br clear="all" />Enable remote access</h4>
<p>If you want to access the Synology NAS from outside your network you need to setup port forwarding on your router. If your router is supported (see Synology <a  href="http://forum.synology.com/wiki" target="_blank">WIki</a>) you can configure the port forwarding and firewall configuration from the admin webpage.</p>
<ol>
<li>Open the Control Panel </li>
<li>Open the Router Configuration applet (under Network Services) </li>
<li>Click Create </li>
<li>Select “Built-in application” </li>
<li>Enable &#8216;&quot;Encrypted terminal service (Includes encrypted Network Backup) </li>
<li>Save the configuration </li>
</ol>
<p>&#160;</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Home-screen1.png" class="thickbox no_icon" rel="gallery-4165" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Home-screen_thumb1.png" width="79" height="126" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-RC.png" class="thickbox no_icon" rel="gallery-4165" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-RC_thumb.png" width="230" height="126" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-Router-Configuration-Before.png" class="thickbox no_icon" rel="gallery-4165" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-Router-Configuration-Before_thumb.png" width="244" height="104" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-Router-Configuration-Port-Forwarding-1.png" class="thickbox no_icon" rel="gallery-4165" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-Router-Configuration-Port-Forwarding-1_thumb.png" width="153" height="104" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-Router-Configuration-Port-Forwarding-2.png" class="thickbox no_icon" rel="gallery-4165" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-Router-Configuration-Port-Forwarding-2_thumb.png" width="153" height="104" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-Router-Configuration-Before1.png" class="thickbox no_icon" rel="gallery-4165" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Control-Panel-Router-Configuration-Before_thumb1.png" width="244" height="104" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peppercrew.nl/index.php/2012/04/how-to-enable-terminal-access-to-synology-nas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpsMgr: Remove management pack depending on &#8220;Default Management Pack&#8221;</title>
		<link>http://www.peppercrew.nl/index.php/2012/04/opsmgr-remove-management-pack-depending-on-default-management-pack/</link>
		<comments>http://www.peppercrew.nl/index.php/2012/04/opsmgr-remove-management-pack-depending-on-default-management-pack/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 14:15:01 +0000</pubDate>
		<dc:creator>Ingmar Verheij</dc:creator>
				<category><![CDATA[Ingmar Verheij]]></category>
		<category><![CDATA[management pack]]></category>
		<category><![CDATA[OpsMgr]]></category>
		<category><![CDATA[SCOM]]></category>

		<guid isPermaLink="false">http://www.peppercrew.nl/index.php/2012/04/opsmgr-remove-management-pack-depending-on-default-management-pack/</guid>
		<description><![CDATA[Author: Ingmar Verheij When you try to remove a (sealed) management pack from System Center Operations Manager (SCOM) you get the following error: This is caused by an override that is targeted on the management pack you want to delete (for instance Citrix Library) and is stored in the Default Management Pack, which is NOT [...]]]></description>
			<content:encoded><![CDATA[<p>Author: <a  href="http://www.ingmarverheij.com/" target="_blank">Ingmar Verheij</a></p>
<p>When you try to remove a (sealed) management pack from System Center Operations Manager (SCOM) you get the following error:</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Following-Management-Packs-depend-on-the-Managemend-Pack-you-are-trying-to-delete.png" class="thickbox no_icon" rel="gallery-4144" title="Following Management Packs depend on the Managemend Pack you are trying to delete"><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Following Management Packs depend on the Managemend Pack you are trying to delete" border="0" alt="Following Management Packs depend on the Managemend Pack you are trying to delete" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Following-Management-Packs-depend-on-the-Managemend-Pack-you-are-trying-to-delete_thumb.png" width="204" height="200" /></a></p>
<p>This is caused by an override that is targeted on the management pack you want to delete (for instance Citrix Library) and is stored in the Default Management Pack, which is NOT a best-practice. Even after deleting all overrides from the DMP the message does not disappear.</p>
<p><span id="more-4144"></span>
<p>When an override is created its stored in a management pack (Default Management Pack in this case). But not only the override is stored, also a reference to the management pack (for instance Citrix Library). When an override is removed only the override is deleted from the management pack (Default Management Pack in this case), not the reference to the target management pack (for instance Citrix Library)</p>
<p>This can be “solved” by removing the reference from the Default Management Pack in four easy steps</p>
<p><em>Before you begin, make sure you removed all overrides stored in the Default Management Pack that reference the management pack you want to delete (for instance Citrix Library)</em></p>
<p>&#160;</p>
<h4>1) Determine the ID of the management pack (for instance Citrix Library)</h4>
<ul>
<li>Open the SCOM Operations Console </li>
<li>Open the Administration view </li>
<li>Select Management Packs </li>
<li>Open the properties of the management pack (for instance Citrix Library) </li>
<li>Note the value in the ID field (in this case <em>Citrix.Library</em>) </li>
<li>(Check if the management pack indeed is depending on the Default Management Pack on the Dependencies tab) </li>
<li>Close the properties </li>
</ul>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Citrix-Library-General.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Citrix-Library-General_thumb.png" width="104" height="104" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Citrix-Library-Dependencies.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Citrix-Library-Dependencies_thumb.png" width="104" height="104" /></a> </p>
<h4>&#160;</h4>
<h4>2) Export the Default Management Pack </h4>
<ul>
<li>Open the context menu (right mouse-click) on the Default Management Pack </li>
<li>Export Management Pack… </li>
<li>Store the management pack on a writeable location (for instance the desktop) </li>
</ul>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Export-DMP-1.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Export-DMP-1_thumb.png" width="104" height="34" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Export-DMP-2.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Export-DMP-2_thumb.png" width="104" height="101" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Export-DMP-3.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Export-DMP-3_thumb.png" width="104" height="41" /></a> </p>
<p>&#160;</p>
<h4>3) Remove the reference from the Default Management Pack</h4>
<ul>
<li>Open the file Microsoft.SystemCenter.OperationsManager.DefaultUser.xml in Notepad (or <a  href="http://www.microsoft.com/downloads/details.aspx?FamilyID=72D6AA49-787D-4118-BA5F-4F30FE913628&#038;displaylang=en" target="_blank">XML Notepad</a>) </li>
<li>Search the file for the ID of the management pack (for instance Citrix.Library) </li>
<li>Remove all content between &lt;Reference … and&#160; &lt;/Reference&gt; </li>
<li>Save the file and close Notepad </li>
</ul>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Microsoft.SystemCenter.OperationsManager.DefaultUser.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Microsoft.SystemCenter.OperationsManager.DefaultUser_thumb.png" width="104" height="59" /></a></p>
<h4>&#160;</h4>
<h4>4) Import the Default Management Pack</h4>
<ul>
<li>Click on Import Management Pack… in the Actions Pane (on the right) </li>
<li>Click Add &gt; Add from disk… </li>
<li>Do not search online for updates </li>
<li>Select the file “Microsoft.SystemCenter.OperationsManager.DefaultUser.xml” </li>
<li>Click on Install </li>
</ul>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Import-DMP-1.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Import-DMP-1_thumb.png" width="104" height="94" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Import-DMP-2.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Import-DMP-2_thumb.png" width="104" height="54" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Import-DMP-3.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Import-DMP-3_thumb.png" width="104" height="79" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Import-DMP-4.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Import-DMP-4_thumb.png" width="104" height="94" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Import-DMP-5.png" class="thickbox no_icon" rel="gallery-4144" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Import-DMP-5_thumb.png" width="104" height="94" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peppercrew.nl/index.php/2012/04/opsmgr-remove-management-pack-depending-on-default-management-pack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpsMgr: Enable Agent Proxy via Management Pack</title>
		<link>http://www.peppercrew.nl/index.php/2012/04/opsmgr-enable-agent-proxy-via-management-pack/</link>
		<comments>http://www.peppercrew.nl/index.php/2012/04/opsmgr-enable-agent-proxy-via-management-pack/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 13:47:55 +0000</pubDate>
		<dc:creator>Ingmar Verheij</dc:creator>
				<category><![CDATA[Ingmar Verheij]]></category>
		<category><![CDATA[OpsMgr]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Proxy]]></category>
		<category><![CDATA[SCOM]]></category>

		<guid isPermaLink="false">http://www.peppercrew.nl/index.php/2012/04/opsmgr-enable-agent-proxy-via-management-pack/</guid>
		<description><![CDATA[Author : Ingmar Verheij System Center Operations Manager (SCOM) agents are by default allowed to only return data from the same source. If the agent needs to submit data from another source, for instance in a cluster, the security feature ‘Agent Proxy’ needs to be enabled. By default this feature is disabled. If you create [...]]]></description>
			<content:encoded><![CDATA[<p>Author : <a  href="http://www.ingmarverheij.com/" target="_blank">Ingmar Verheij</a></p>
<p>System Center Operations Manager (SCOM) agents are by default allowed to only return data from the same source. If the agent needs to submit data from another source, for instance in a cluster, the security feature ‘Agent Proxy’ needs to be enabled. By default this feature is disabled.</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Agent-properties-Security.png" class="thickbox no_icon" rel="gallery-4119" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Agent-properties-Security_thumb.png" width="304" height="111" /></a></p>
<p>If you create (or import) a management pack that relies on this feature, for example when the management pack submits data from another source, you might want automate this. </p>
<h6></h6>
<p><span id="more-4119"></span><br />
<h6>Automate setting “Allow this agent to act as a proxy and discover managed object on other computers”</h6>
<p>The process of enabling the “Agent Proxy” security feature can be done using a <a  href="http://blogs.technet.com/b/kevinholman/archive/2010/11/09/how-to-set-agent-proxy-enabled-for-all-agents.aspx?Redirected=true" target="_blank">PowerShell</a> script or an executable called <a  href="http://blogs.technet.com/b/markmanty/archive/2012/02/02/automate-setting-allow-agent-to-act-as-proxy-on-scom-agents.aspx" target="_blank">SetAgentProxyEnabled</a>. Although this automates the process of enabling the security feature it still requires an admin to execute the script or process manually.</p>
<h6>&#160;</h6>
<h6>Integrate in Management Pack</h6>
<p>What if you write a management pack that discovers objects from another source (and therefore require the “Agent Proxy” feature)? You might want to set the feature for the admin on the agents where your management pack is active. </p>
<p>To achieve this we’re going to create a rule that runs on the root management server (RMS),</p>
<ul>
<li>Open the System Center Operations Manager 2007 R2 Authoring Console </li>
<li>Open your management pack / create a new management pack </li>
<li>Go to Health Model </li>
<li>Select Rules </li>
</ul>
<h6>&#160;</h6>
<h6>In the Rules view</h6>
<ul>
<li>Create a new custom rule </li>
<li>Choose an ID (for instance Demo.ManagementPack.Rule) </li>
</ul>
<h6>&#160;</h6>
<h6>On the <strong>General</strong> tab</h6>
<ul>
<li>Give a descriptive name (for “instance Enable Agent Proxy on my agent”) </li>
<li>Select the target ‘Microsoft.SystemCenter.RootManagementServer’ </li>
</ul>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Management-Pack-Class-Chooser.png" class="thickbox no_icon" rel="gallery-4119" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Management-Pack-Class-Chooser_thumb.png" width="154" height="131" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Demo.ManagementPack.Rule-General.png" class="thickbox no_icon" rel="gallery-4119" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Demo.ManagementPack.Rule-General_thumb.png" width="154" height="152" /></a></p>
<p>&#160;</p>
<h6>On the <strong>Modules</strong> tab</h6>
<ul>
<li>Create a new Data Source with type ‘System.Scheduler’ and Module ID ‘Scheduler’ </li>
<li>Edit the new created data source ‘Scheduler’
<ul>
<li>Click on Configure </li>
<li>Set the period to 1 – Hours </li>
<li><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Choose-module-type-Data-Source.png" class="thickbox no_icon" rel="gallery-4119" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Choose-module-type-Data-Source_thumb.png" width="79" height="67" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/System.Scheduler-Configuration.png" class="thickbox no_icon" rel="gallery-4119" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/System.Scheduler-Configuration_thumb.png" width="79" height="79" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Configuration-Schedule.png" class="thickbox no_icon" rel="gallery-4119" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Configuration-Schedule_thumb.png" width="79" height="73" /></a> </li>
</ul>
</li>
<li>Create a new Action with type ‘Microsoft.Windows.PowerShellAction’ and Module ID ‘ExecuteScript’ </li>
<li>Edit the new created Action ‘ExecuteScript’
<ul>
<li>ScriptName : ClassProxyEnabler.ps1 </li>
<li>ScriptBody (see below) </li>
<li>TimeoutSeconds: 60 </li>
<li><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Choose-module-type-Action.png" class="thickbox no_icon" rel="gallery-4119" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Choose-module-type-Action_thumb.png" width="79" height="67" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/ExecuteScript-Configuration.png" class="thickbox no_icon" rel="gallery-4119" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/ExecuteScript-Configuration_thumb.png" width="79" height="79" /></a> </li>
</ul>
</li>
</ul>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Demo.ManagementPack.Rule-Modules.png" class="thickbox no_icon" rel="gallery-4119" title=""><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Demo.ManagementPack.Rule-Modules_thumb.png" width="154" height="152" /></a></p>
<p>&#160;</p>
<h6>Last step</h6>
<p>Now save the management pack and import the management pack into the Management Group.</p>
<p>The PowerShell script (based on the script from <a  href="http://blogs.technet.com/b/operationsmgr/archive/2009/09/29/enabling-agent-proxy-for-a-class-in-system-center-operations-manager-2007.aspx" target="_blank">Jonathan Almquist</a>, stripped down the logging and&#160; parameters ) to set the “Agent Proxy” security feature.</p>
<p>DO NOT FORGET to change the $ClassName to the class object that target’s your class.</p>
<div class="dean_ch" style="white-space: wrap;">##&#8211;Add SCOM snapin<br />
Add-PSSnapin Microsoft.EnterpriseManagement.OperationsManager.Client</p>
<p>##&#8211;Connect to SCOM<br />
New-ManagementGroupConnection -ConnectionString:localhost<br />
Set-Location ‘OperationsManagerMonitoring::’</p>
<p>##&#8211;Set constants<br />
$bTF = $true<br />
$className = &quot;Microsoft.Windows.Cluster.Node”</p>
<p>##&#8211;Get the class in which you want to set Agent Proxing <br />
$class = Get-MonitoringClass | Where {$_.Name -eq $className } </p>
<p>##&#8211;Get all objects in that class <br />
$objects = Get-MonitoringObject -monitoringClass:$class </p>
<p>##&#8211;Create an array of BME&#8217;s <br />
$arrBME = @() <br />
Foreach ($object in $objects) <br />
&nbsp; &nbsp; { <br />
&nbsp; &nbsp; If ($object.FullName -notcontains &quot;Microsoft.Windows.Computer:&quot;) <br />
&nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; Do <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $parent = $object.getParentPartialMonitoringObjects() <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Foreach ($oParent in $parent) {If ($oParent.FullName -match &quot;Microsoft.Windows.Computer&quot;) {$object = $oParent}} <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; &nbsp; &nbsp; Until ($object.FullName -match &quot;Microsoft.Windows.Computer&quot;) <br />
&nbsp; &nbsp; &nbsp; &nbsp; $arrBME += $object.Id.ToString() <br />
&nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; } </p>
<p>##&#8211;Create an array of agents to help script performance. <br />
$agentArray = @() <br />
Foreach ($agent in Get-Agent) <br />
&nbsp; &nbsp; { <br />
&nbsp; &nbsp; $agentArray += $agent <br />
&nbsp; &nbsp; } </p>
<p>##&#8211;Walk through the array and set Agent Proxying for each agent <br />
Foreach ($BME in $arrBME) <br />
&nbsp; &nbsp; { <br />
&nbsp; &nbsp; $i=0 <br />
&nbsp; &nbsp; While ($i -ne $agentArray.count) <br />
&nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; If ($BME -eq $agentArray[$i].Id.ToString()) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##&#8211;If already set to preference, skip with message. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If ($agentArray[$i].ProxyingEnabled.Value -ne $bTF) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $agentArray[$i].set_proxyingEnabled($bTF) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $agentArray[$i].applyChanges() <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $i = $agentArray.count <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Else <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $i = $agentArray.count <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; &nbsp; &nbsp; Else <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $i+=1 <br />
&nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; } <br />
}</div>
]]></content:encoded>
			<wfw:commentRss>http://www.peppercrew.nl/index.php/2012/04/opsmgr-enable-agent-proxy-via-management-pack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpsMgr: Choose source table based on date range</title>
		<link>http://www.peppercrew.nl/index.php/2012/04/opsmgr-choose-source-table-based-on-date-range/</link>
		<comments>http://www.peppercrew.nl/index.php/2012/04/opsmgr-choose-source-table-based-on-date-range/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 20:38:33 +0000</pubDate>
		<dc:creator>Ingmar Verheij</dc:creator>
				<category><![CDATA[Ingmar Verheij]]></category>
		<category><![CDATA[OpsMgr]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[report]]></category>
		<category><![CDATA[SCOM]]></category>
		<category><![CDATA[vPerf]]></category>

		<guid isPermaLink="false">http://www.peppercrew.nl/index.php/2012/04/opsmgr-choose-source-table-based-on-date-range/</guid>
		<description><![CDATA[Author: Ingmar Verheij When creating a report in System Center Operations Manager (SCOM) showing performance data you’ll need to make a decision about the data you’re going to show. Will you use raw data (Perf.vPerfRaw), hourly aggregated data (Perf.vPerfHourly) or daily aggregated data (Perf.vPerfDaily). Do you want to show detailed information or for a longer [...]]]></description>
			<content:encoded><![CDATA[<p>Author: <a  href="http://www.ingmarverheij.com/" target="_blank">Ingmar Verheij</a></p>
<p>When creating a report in System Center Operations Manager (SCOM) showing performance data you’ll need to make a decision about the data you’re going to show. Will you use raw data (Perf.vPerfRaw), hourly aggregated data (Perf.vPerfHourly) or daily aggregated data (Perf.vPerfDaily).</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Query_thumb2.png" class="thickbox no_icon" rel="gallery-4077" title="Query_thumb2"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Query_thumb2" border="0" alt="Query_thumb2" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Query_thumb2_thumb.png" width="254" height="137" /></a>Do you want to show detailed information or for a longer period? The most detail can be achieved with the data stored in Perf.vPerfRaw but this comes at a cost, the time to query the database and render the report increases massive. So if you want to show data for a longer period (like over a week) you’ll probably better use the data stored in Perf.vPerfDaily.</p>
<p>But what if you want the user the ability to change the date range? If the user specifies a small range (for instance a day) you want high detail, but when the range is increased (for instance a month) less detail is required.</p>
<p>Unfortunately the reports created in the Business Intelligence Development Studio (BIDS) does not allow you to create a conditional SQL statement. So in order to achieve this, a stored procedure needs to be created.</p>
<p><span id="more-4077"></span><br />
<h4>Stored procedure</h4>
<p>Let’s create a stored procedure in the OperationsManagerDW database. The stored procedure queries performance data for the rule with object name ‘Processor’, instance name ‘_Total’ and counter name ‘% Processor Time’. </p>
<p>There are only two parameters, the start and end time.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">IF</span> <span class="kw1">NOT</span> <span class="kw1">EXISTS</span> <span class="br0">&#40;</span><span class="kw1">SELECT</span> * <span class="kw1">FROM</span> sysobjects <span class="kw1">WHERE</span> type = <span class="st0">&#8216;P&#8217;</span> <span class="kw1">AND</span> name = <span class="st0">&#8216;spPerfDemo&#8217;</span><span class="br0">&#41;</span> <br />
BEGIN <br />
EXECUTE <span class="br0">&#40;</span><span class="st0">&#8216;CREATE PROCEDURE dbo.[spPerfDemo] AS RETURN 1&#8242;</span><span class="br0">&#41;</span> <br />
END <br />
GO</p>
<p><span class="kw1">ALTER</span> PROCEDURE <span class="br0">&#91;</span>dbo<span class="br0">&#93;</span>.<span class="br0">&#91;</span>spPerfDemo<span class="br0">&#93;</span> <br />
&nbsp; &nbsp; @StartDateTime VARCHAR<span class="br0">&#40;</span><span class="nu0">255</span><span class="br0">&#41;</span>, <br />
&nbsp; &nbsp; @EndDateTime VARCHAR<span class="br0">&#40;</span><span class="nu0">255</span><span class="br0">&#41;</span><br />
<span class="kw1">AS</span> <br />
BEGIN</p>
<p>&nbsp; <span class="co1">&#8211; SET NOCOUNT ON added to prevent extra result sets from</span><br />
&nbsp; <span class="co1">&#8211; interfering with SELECT statements.</span><br />
&nbsp; <span class="kw1">SET</span> NOCOUNT <span class="kw1">ON</span>;</p>
<p>
&nbsp; &nbsp; <span class="co1">&#8211; Declare variables</span><br />
&nbsp; &nbsp; DECLARE @tableSource VARCHAR<span class="br0">&#40;</span><span class="nu0">25</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; DECLARE @fieldsSource VARCHAR<span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; DECLARE @SQLCommand &nbsp;VARCHAR<span class="br0">&#40;</span>MAX<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <br />
&nbsp; <span class="co1">&#8212; Determine source table based on time range</span><br />
&nbsp; &nbsp;<span class="kw1">IF</span> DATEDIFF<span class="br0">&#40;</span>day, @StartDateTime, @EndDateTime<span class="br0">&#41;</span> &lt;= <span class="nu0">1</span> <br />
&nbsp; &nbsp; &nbsp; BEGIN <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @tableSource = <span class="st0">&#8216;Perf.vPerfRaw&#8217;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @fieldsSource = <span class="st0">&#8216;vPerf.SampleValue As AverageValue, vPerf.SampleValue As MinValue, vPerf.SampleValue As MaxValue, 0 as StandardDeviation&#8217;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;END<br />
&nbsp; &nbsp;ELSE <span class="kw1">IF</span> DATEDIFF<span class="br0">&#40;</span>day, @StartDateTime, @EndDateTime<span class="br0">&#41;</span> &lt; <span class="nu0">7</span> <br />
&nbsp; &nbsp; &nbsp; BEGIN <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @tableSource = <span class="st0">&#8216;Perf.vPerfHourly&#8217;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @fieldsSource = <span class="st0">&#8216;vPerf.AverageValue, vPerf.MinValue, vPerf.MaxValue, vPerf.StandardDeviation&#8217;</span><br />
&nbsp; &nbsp; &nbsp; END<br />
&nbsp; &nbsp;ELSE<br />
&nbsp; &nbsp; &nbsp; BEGIN <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @tableSource = <span class="st0">&#8216;Perf.vPerfDaily&#8217;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @fieldsSource = <span class="st0">&#8216;vPerf.AverageValue, vPerf.MinValue, vPerf.MaxValue, vPerf.StandardDeviation&#8217;</span><br />
&nbsp; &nbsp; &nbsp; END<br />
&nbsp; &nbsp; <br />
&nbsp;<br />
&nbsp; &nbsp;<span class="co1">&#8212; Create SQL command</span><br />
&nbsp; &nbsp;<span class="kw1">SET</span> @SQLCommand = <span class="st0">&#8216;SELECT CONVERT(VARCHAR, vPerf.DateTime, 120) As DateTime, &#8216;</span>+@fieldsSource+<span class="st0">&#8216;, vPerformanceRuleInstance.InstanceName, vPerformanceRule.CounterName<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROM &#8216;</span>+@tableSource+<span class="st0">&#8216; As vPerf<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INNER JOIN vPerformanceRuleInstance ON vPerformanceRuleInstance.PerformanceRuleInstanceRowId = vPerf.PerformanceRuleInstanceRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INNER JOIN vPerformanceRule ON vPerformanceRule.RuleRowId = vPerformanceRuleInstance.RuleRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE vPerf.PerformanceRuleInstanceRowId IN (SELECT PerformanceRuleInstanceRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FROM vPerformanceRuleInstance<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHERE RuleRowId in (SELECT RuleRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FROM vPerformanceRule<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHERE ObjectName = &#8216;</span><span class="st0">&#8216;Processor&#8217;</span><span class="st0">&#8216; AND CounterName = &#8216;</span><span class="st0">&#8216;% Processor Time&#8217;</span><span class="st0">&#8216;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AND<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InstanceName = &#8216;</span><span class="st0">&#8216;_Total&#8217;</span><span class="st0">&#8216;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (vPerf.DateTime &gt;= &#8216;</span><span class="st0">&#8221;</span>+@StartDateTime+<span class="st0">&#8221;</span><span class="st0">&#8216;) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (vPerf.DateTime &lt;= &#8216;</span><span class="st0">&#8221;</span>+@EndDateTime+<span class="st0">&#8221;</span><span class="st0">&#8216;)&#8217;</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span class="co1">&#8212; Execute SQL command</span><br />
&nbsp; &nbsp;PRINT @SQLCommand<br />
&nbsp; &nbsp;EXEC <span class="br0">&#40;</span>@sqlCommand<span class="br0">&#41;</span> &nbsp; &nbsp;<br />
END<br />
GO</p>
<p><span class="kw1">GRANT</span> EXEC <span class="kw1">ON</span> <span class="br0">&#91;</span>dbo<span class="br0">&#93;</span>.<span class="br0">&#91;</span>spPerfDemo<span class="br0">&#93;</span> <span class="kw1">TO</span> OpsMgrReader<br />
GO</div>
<p>Now if we run the stored procedure with a start and end time with a range of less then one day (23 hours) then the data is retrieved from Perf.vPerfRaw. Since there is no average, minimum, maximum of standard deviation I’ve changed the source fields so it always returns the same columns (which is required if you want to create a universal report.</p>
<div class="dean_ch" style="white-space: wrap;">EXEC&nbsp; <span class="br0">&#91;</span>dbo<span class="br0">&#93;</span>.<span class="br0">&#91;</span>spPerfDemo<span class="br0">&#93;</span><br />
&nbsp; &nbsp; @StartDateTime = N<span class="st0">&#8217;2012-04-01 0:00:00&#8242;</span>,<br />
&nbsp; &nbsp; @EndDateTime = N<span class="st0">&#8217;2012-04-01 23:00:00&#8242;</span><br />
GO</div>
<p>If you look at the Message tab (where the SQL query is printed) you’ll see that the source table is Perf.vPerfRaw.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">SELECT</span> CONVERT<span class="br0">&#40;</span>VARCHAR, vPerf.DateTime, <span class="nu0">120</span><span class="br0">&#41;</span> <span class="kw1">AS</span> DateTime, vPerf.SampleValue <span class="kw1">AS</span> AverageValue, vPerf.SampleValue <span class="kw1">AS</span> MinValue, vPerf.SampleValue <span class="kw1">AS</span> MaxValue, <span class="nu0">0</span> a, vPerformanceRuleInstance.InstanceName, vPerformanceRule.CounterName<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">FROM</span> Perf.vPerfRaw <span class="kw1">AS</span> vPerf<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">INNER</span> <span class="kw1">JOIN</span> vPerformanceRuleInstance <span class="kw1">ON</span> vPerformanceRuleInstance.PerformanceRuleInstanceRowId = vPerf.PerformanceRuleInstanceRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">INNER</span> <span class="kw1">JOIN</span> vPerformanceRule <span class="kw1">ON</span> vPerformanceRule.RuleRowId = vPerformanceRuleInstance.RuleRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">WHERE</span> vPerf.PerformanceRuleInstanceRowId <span class="kw1">IN</span> <span class="br0">&#40;</span><span class="kw1">SELECT</span> PerformanceRuleInstanceRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">FROM</span> vPerformanceRuleInstance<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">WHERE</span> RuleRowId <span class="kw1">IN</span> <span class="br0">&#40;</span><span class="kw1">SELECT</span> RuleRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">FROM</span> vPerformanceRule<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">WHERE</span> ObjectName = <span class="st0">&#8216;Processor&#8217;</span> <span class="kw1">AND</span> CounterName = <span class="st0">&#8216;% Processor Time&#8217;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">AND</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InstanceName = <span class="st0">&#8216;_Total&#8217;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">AND</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span>vPerf.DateTime &gt;= <span class="st0">&#8217;2012-04-01 0:00:00&#8242;</span><span class="br0">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">AND</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span>vPerf.DateTime &lt;= <span class="st0">&#8217;2012-04-01 23:00:00&#8242;</span><span class="br0">&#41;</span></div>
<p>If we change the date range to more than a day (5 days)&#8230;</p>
<div class="dean_ch" style="white-space: wrap;">EXEC&nbsp; <span class="br0">&#91;</span>dbo<span class="br0">&#93;</span>.<span class="br0">&#91;</span>spPerfDemo<span class="br0">&#93;</span><br />
&nbsp; &nbsp; @StartDateTime = N<span class="st0">&#8217;2012-04-01 0:00:00&#8242;</span>,<br />
&nbsp; &nbsp; @EndDateTime = N<span class="st0">&#8217;2012-04-05 0:00:00&#8242;</span><br />
GO</div>
<p>…the data is retrieved from Perf.vPerfHourly .</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">SELECT</span> CONVERT<span class="br0">&#40;</span>VARCHAR, vPerf.DateTime, <span class="nu0">120</span><span class="br0">&#41;</span> <span class="kw1">AS</span> DateTime, vPerf.AverageValue, vPerf.MinValue, vPerf.MaxValue, vPerf.StandardDeviation, vPerformanceRuleInstance.InstanceName, vPerformanceRule.CounterName<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">FROM</span> Perf.vPerfHourly <span class="kw1">AS</span> vPerf<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">INNER</span> <span class="kw1">JOIN</span> vPerformanceRuleInstance <span class="kw1">ON</span> vPerformanceRuleInstance.PerformanceRuleInstanceRowId = vPerf.PerformanceRuleInstanceRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">INNER</span> <span class="kw1">JOIN</span> vPerformanceRule <span class="kw1">ON</span> vPerformanceRule.RuleRowId = vPerformanceRuleInstance.RuleRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">WHERE</span> vPerf.PerformanceRuleInstanceRowId <span class="kw1">IN</span> <span class="br0">&#40;</span><span class="kw1">SELECT</span> PerformanceRuleInstanceRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">FROM</span> vPerformanceRuleInstance<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">WHERE</span> RuleRowId <span class="kw1">IN</span> <span class="br0">&#40;</span><span class="kw1">SELECT</span> RuleRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">FROM</span> vPerformanceRule<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">WHERE</span> ObjectName = <span class="st0">&#8216;Processor&#8217;</span> <span class="kw1">AND</span> CounterName = <span class="st0">&#8216;% Processor Time&#8217;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">AND</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InstanceName = <span class="st0">&#8216;_Total&#8217;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">AND</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span>vPerf.DateTime &gt;= <span class="st0">&#8217;2012-04-01 0:00:00&#8242;</span><span class="br0">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">AND</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span>vPerf.DateTime &lt;= <span class="st0">&#8217;2012-04-05 0:00:00&#8242;</span><span class="br0">&#41;</span></div>
<h4>Dataset</h4>
<p>Now add a dataset to the ‘Report Project’ report in the Business Intelligence Development Studio (BIDS) and select the stored procedure you’ve created earlier. Don’t forget to add the parameters for the begin and end date.</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/datasetPerformanceData-Query_thumb1.png" class="thickbox no_icon" rel="gallery-4077" title="datasetPerformanceData---Query_thumb"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="datasetPerformanceData---Query_thumb" border="0" alt="datasetPerformanceData---Query_thumb" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/datasetPerformanceData-Query_thumb_thumb.png" width="204" height="211" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/datasetPerformanceData-Parameters_.png" class="thickbox no_icon" rel="gallery-4077" title="datasetPerformanceData---Parameters_"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="datasetPerformanceData---Parameters_" border="0" alt="datasetPerformanceData---Parameters_" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/datasetPerformanceData-Parameters__thumb.png" width="204" height="211" /></a> </p>
<p>  <br clear="all" />And create the report as you normally would.</p>
<h4>Authoring the management pack</h4>
<p>The next step is to add the report and the stored procedure to the management. This is done by creating a Data Warehouse Script.</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Data-Warehouse-Script-1_thumb2.png" class="thickbox no_icon" rel="gallery-4077" title="Data-Warehouse-Script---1_thumb2"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Data-Warehouse-Script---1_thumb2" border="0" alt="Data-Warehouse-Script---1_thumb2" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Data-Warehouse-Script-1_thumb2_thumb.png" width="79" height="79" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Data-Warehouse-Script-2_thumb2.png" class="thickbox no_icon" rel="gallery-4077" title="Data-Warehouse-Script---2_thumb2"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Data-Warehouse-Script---2_thumb2" border="0" alt="Data-Warehouse-Script---2_thumb2" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Data-Warehouse-Script-2_thumb2_thumb.png" width="79" height="79" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Data-Warehouse-Script-3_thumb2.png" class="thickbox no_icon" rel="gallery-4077" title="Data-Warehouse-Script---3_thumb2"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Data-Warehouse-Script---3_thumb2" border="0" alt="Data-Warehouse-Script---3_thumb2" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Data-Warehouse-Script-3_thumb2_thumb.png" width="79" height="79" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Data-Warehouse-Script-4_thumb2.png" class="thickbox no_icon" rel="gallery-4077" title="Data-Warehouse-Script---4_thumb2"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Data-Warehouse-Script---4_thumb2" border="0" alt="Data-Warehouse-Script---4_thumb2" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Data-Warehouse-Script-4_thumb2_thumb.png" width="79" height="79" /></a><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Data-Warehouse-Script-5_thumb2.png" class="thickbox no_icon" rel="gallery-4077" title="Data-Warehouse-Script---5_thumb2"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Data-Warehouse-Script---5_thumb2" border="0" alt="Data-Warehouse-Script---5_thumb2" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Data-Warehouse-Script-5_thumb2_thumb.png" width="79" height="79" /></a></p>
<h6>Install script</h6>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">IF</span> <span class="kw1">NOT</span> <span class="kw1">EXISTS</span> <span class="br0">&#40;</span><span class="kw1">SELECT</span> * <span class="kw1">FROM</span> sysobjects <span class="kw1">WHERE</span> type = <span class="st0">&#8216;P&#8217;</span> <span class="kw1">AND</span> name = <span class="st0">&#8216;spPerfDemo&#8217;</span><span class="br0">&#41;</span> <br />
BEGIN <br />
EXECUTE <span class="br0">&#40;</span><span class="st0">&#8216;CREATE PROCEDURE dbo.[spPerfDemo] AS RETURN 1&#8242;</span><span class="br0">&#41;</span> <br />
END <br />
GO</p>
<p><span class="kw1">ALTER</span> PROCEDURE <span class="br0">&#91;</span>dbo<span class="br0">&#93;</span>.<span class="br0">&#91;</span>spPerfDemo<span class="br0">&#93;</span> <br />
&nbsp; &nbsp; @StartDateTime VARCHAR<span class="br0">&#40;</span><span class="nu0">255</span><span class="br0">&#41;</span>, <br />
&nbsp; &nbsp; @EndDateTime VARCHAR<span class="br0">&#40;</span><span class="nu0">255</span><span class="br0">&#41;</span><br />
<span class="kw1">AS</span> <br />
BEGIN</p>
<p>&nbsp; <span class="co1">&#8211; SET NOCOUNT ON added to prevent extra result sets from</span><br />
&nbsp; <span class="co1">&#8211; interfering with SELECT statements.</span><br />
&nbsp; <span class="kw1">SET</span> NOCOUNT <span class="kw1">ON</span>;</p>
<p>
&nbsp; &nbsp; <span class="co1">&#8211; Declare variables</span><br />
&nbsp; &nbsp; DECLARE @tableSource VARCHAR<span class="br0">&#40;</span><span class="nu0">25</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; DECLARE @fieldsSource VARCHAR<span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; DECLARE @SQLCommand &nbsp;VARCHAR<span class="br0">&#40;</span>MAX<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <br />
&nbsp; <span class="co1">&#8212; Determine source table based on time range</span><br />
&nbsp; &nbsp;<span class="kw1">IF</span> DATEDIFF<span class="br0">&#40;</span>day, @StartDateTime, @EndDateTime<span class="br0">&#41;</span> &lt;= <span class="nu0">1</span> <br />
&nbsp; &nbsp; &nbsp; BEGIN <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @tableSource = <span class="st0">&#8216;Perf.vPerfRaw&#8217;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @fieldsSource = <span class="st0">&#8216;vPerf.SampleValue As AverageValue, vPerf.SampleValue As MinValue, vPerf.SampleValue As MaxValue, 0 as StandardDeviation&#8217;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;END<br />
&nbsp; &nbsp;ELSE <span class="kw1">IF</span> DATEDIFF<span class="br0">&#40;</span>day, @StartDateTime, @EndDateTime<span class="br0">&#41;</span> &lt; <span class="nu0">7</span> <br />
&nbsp; &nbsp; &nbsp; BEGIN <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @tableSource = <span class="st0">&#8216;Perf.vPerfHourly&#8217;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @fieldsSource = <span class="st0">&#8216;vPerf.AverageValue, vPerf.MinValue, vPerf.MaxValue, vPerf.StandardDeviation&#8217;</span><br />
&nbsp; &nbsp; &nbsp; END<br />
&nbsp; &nbsp;ELSE<br />
&nbsp; &nbsp; &nbsp; BEGIN <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @tableSource = <span class="st0">&#8216;Perf.vPerfDaily&#8217;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @fieldsSource = <span class="st0">&#8216;vPerf.AverageValue, vPerf.MinValue, vPerf.MaxValue, vPerf.StandardDeviation&#8217;</span><br />
&nbsp; &nbsp; &nbsp; END<br />
&nbsp; &nbsp; <br />
&nbsp;<br />
&nbsp; &nbsp;<span class="co1">&#8212; Create SQL command</span><br />
&nbsp; &nbsp;<span class="kw1">SET</span> @SQLCommand = <span class="st0">&#8216;SELECT CONVERT(VARCHAR, vPerf.DateTime, 120) As DateTime, &#8216;</span>+@fieldsSource+<span class="st0">&#8216;, vPerformanceRuleInstance.InstanceName, vPerformanceRule.CounterName<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROM &#8216;</span>+@tableSource+<span class="st0">&#8216; As vPerf<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INNER JOIN vPerformanceRuleInstance ON vPerformanceRuleInstance.PerformanceRuleInstanceRowId = vPerf.PerformanceRuleInstanceRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INNER JOIN vPerformanceRule ON vPerformanceRule.RuleRowId = vPerformanceRuleInstance.RuleRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE vPerf.PerformanceRuleInstanceRowId IN (SELECT PerformanceRuleInstanceRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FROM vPerformanceRuleInstance<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHERE RuleRowId in (SELECT RuleRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FROM vPerformanceRule<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHERE ObjectName = &#8216;</span><span class="st0">&#8216;Processor&#8217;</span><span class="st0">&#8216; AND CounterName = &#8216;</span><span class="st0">&#8216;% Processor Time&#8217;</span><span class="st0">&#8216;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AND<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InstanceName = &#8216;</span><span class="st0">&#8216;_Total&#8217;</span><span class="st0">&#8216;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (vPerf.DateTime &gt;= &#8216;</span><span class="st0">&#8221;</span>+@StartDateTime+<span class="st0">&#8221;</span><span class="st0">&#8216;) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (vPerf.DateTime &lt;= &#8216;</span><span class="st0">&#8221;</span>+@EndDateTime+<span class="st0">&#8221;</span><span class="st0">&#8216;)&#8217;</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span class="co1">&#8212; Execute SQL command</span><br />
&nbsp; &nbsp;PRINT @SQLCommand<br />
&nbsp; &nbsp;EXEC <span class="br0">&#40;</span>@sqlCommand<span class="br0">&#41;</span> &nbsp; &nbsp;<br />
END<br />
GO</p>
<p><span class="kw1">GRANT</span> EXEC <span class="kw1">ON</span> <span class="br0">&#91;</span>dbo<span class="br0">&#93;</span>.<span class="br0">&#91;</span>spPerfDemo<span class="br0">&#93;</span> <span class="kw1">TO</span> OpsMgrReader<br />
GO</div>
<h6>Uninstall script</h6>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">IF</span> &nbsp;<span class="kw1">EXISTS</span> <span class="br0">&#40;</span><span class="kw1">SELECT</span> * <span class="kw1">FROM</span> sys.objects <span class="kw1">WHERE</span> object_id = OBJECT_ID<span class="br0">&#40;</span>N<span class="st0">&#8216;[dbo].[spPerfDemo]&#8216;</span><span class="br0">&#41;</span> <span class="kw1">AND</span> type <span class="kw1">IN</span> <span class="br0">&#40;</span>N<span class="st0">&#8216;P&#8217;</span>, N<span class="st0">&#8216;PC&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
<span class="kw1">DROP</span> PROCEDURE <span class="br0">&#91;</span>dbo<span class="br0">&#93;</span>.spPerfDemo<span class="br0">&#93;</span><br />
GO</div>
<h6>Upgrade script</h6>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">ALTER</span> PROCEDURE <span class="br0">&#91;</span>dbo<span class="br0">&#93;</span>.<span class="br0">&#91;</span>spPerfDemo<span class="br0">&#93;</span> <br />
&nbsp; &nbsp; @StartDateTime VARCHAR<span class="br0">&#40;</span><span class="nu0">255</span><span class="br0">&#41;</span>, <br />
&nbsp; &nbsp; @EndDateTime VARCHAR<span class="br0">&#40;</span><span class="nu0">255</span><span class="br0">&#41;</span><br />
<span class="kw1">AS</span> <br />
BEGIN</p>
<p>&nbsp; <span class="co1">&#8211; SET NOCOUNT ON added to prevent extra result sets from</span><br />
&nbsp; <span class="co1">&#8211; interfering with SELECT statements.</span><br />
&nbsp; <span class="kw1">SET</span> NOCOUNT <span class="kw1">ON</span>;</p>
<p>
&nbsp; &nbsp; <span class="co1">&#8211; Declare variables</span><br />
&nbsp; &nbsp; DECLARE @tableSource VARCHAR<span class="br0">&#40;</span><span class="nu0">25</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; DECLARE @fieldsSource VARCHAR<span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; DECLARE @SQLCommand &nbsp;VARCHAR<span class="br0">&#40;</span>MAX<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <br />
&nbsp; <span class="co1">&#8212; Determine source table based on time range</span><br />
&nbsp; &nbsp;<span class="kw1">IF</span> DATEDIFF<span class="br0">&#40;</span>day, @StartDateTime, @EndDateTime<span class="br0">&#41;</span> &lt;= <span class="nu0">1</span> <br />
&nbsp; &nbsp; &nbsp; BEGIN <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @tableSource = <span class="st0">&#8216;Perf.vPerfRaw&#8217;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @fieldsSource = <span class="st0">&#8216;vPerf.SampleValue As AverageValue, vPerf.SampleValue As MinValue, vPerf.SampleValue As MaxValue, 0 as StandardDeviation&#8217;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;END<br />
&nbsp; &nbsp;ELSE <span class="kw1">IF</span> DATEDIFF<span class="br0">&#40;</span>day, @StartDateTime, @EndDateTime<span class="br0">&#41;</span> &lt; <span class="nu0">7</span> <br />
&nbsp; &nbsp; &nbsp; BEGIN <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @tableSource = <span class="st0">&#8216;Perf.vPerfHourly&#8217;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @fieldsSource = <span class="st0">&#8216;vPerf.AverageValue, vPerf.MinValue, vPerf.MaxValue, vPerf.StandardDeviation&#8217;</span><br />
&nbsp; &nbsp; &nbsp; END<br />
&nbsp; &nbsp;ELSE<br />
&nbsp; &nbsp; &nbsp; BEGIN <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @tableSource = <span class="st0">&#8216;Perf.vPerfDaily&#8217;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SET</span> @fieldsSource = <span class="st0">&#8216;vPerf.AverageValue, vPerf.MinValue, vPerf.MaxValue, vPerf.StandardDeviation&#8217;</span><br />
&nbsp; &nbsp; &nbsp; END<br />
&nbsp; &nbsp; <br />
&nbsp;<br />
&nbsp; &nbsp;<span class="co1">&#8212; Create SQL command</span><br />
&nbsp; &nbsp;<span class="kw1">SET</span> @SQLCommand = <span class="st0">&#8216;SELECT CONVERT(VARCHAR, vPerf.DateTime, 120) As DateTime, &#8216;</span>+@fieldsSource+<span class="st0">&#8216;, vPerformanceRuleInstance.InstanceName, vPerformanceRule.CounterName<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROM &#8216;</span>+@tableSource+<span class="st0">&#8216; As vPerf<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INNER JOIN vPerformanceRuleInstance ON vPerformanceRuleInstance.PerformanceRuleInstanceRowId = vPerf.PerformanceRuleInstanceRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INNER JOIN vPerformanceRule ON vPerformanceRule.RuleRowId = vPerformanceRuleInstance.RuleRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE vPerf.PerformanceRuleInstanceRowId IN (SELECT PerformanceRuleInstanceRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FROM vPerformanceRuleInstance<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHERE RuleRowId in (SELECT RuleRowId<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FROM vPerformanceRule<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHERE ObjectName = &#8216;</span><span class="st0">&#8216;Processor&#8217;</span><span class="st0">&#8216; AND CounterName = &#8216;</span><span class="st0">&#8216;% Processor Time&#8217;</span><span class="st0">&#8216;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AND<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InstanceName = &#8216;</span><span class="st0">&#8216;_Total&#8217;</span><span class="st0">&#8216;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (vPerf.DateTime &gt;= &#8216;</span><span class="st0">&#8221;</span>+@StartDateTime+<span class="st0">&#8221;</span><span class="st0">&#8216;) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (vPerf.DateTime &lt;= &#8216;</span><span class="st0">&#8221;</span>+@EndDateTime+<span class="st0">&#8221;</span><span class="st0">&#8216;)&#8217;</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span class="co1">&#8212; Execute SQL command</span><br />
&nbsp; &nbsp;PRINT @SQLCommand<br />
&nbsp; &nbsp;EXEC <span class="br0">&#40;</span>@sqlCommand<span class="br0">&#41;</span> &nbsp; &nbsp;<br />
END<br />
GO</p>
<p><span class="kw1">GRANT</span> EXEC <span class="kw1">ON</span> <span class="br0">&#91;</span>dbo<span class="br0">&#93;</span>.<span class="br0">&#91;</span>spPerfDemo<span class="br0">&#93;</span> <span class="kw1">TO</span> OpsMgrReader<br />
GO</div>
<p>
  <br clear="all" />Finally you need to reference the data warehouse script from the report that’s using the stored procedure.</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Report_thumb1.png" class="thickbox no_icon" rel="gallery-4077" title="Report_thumb1"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Report_thumb1" border="0" alt="Report_thumb1" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Report_thumb1_thumb.png" width="204" height="204" /></a></p>
<h4></h4>
<h4>Pitfalls</h4>
<p>Here are some pitfalls that you might encounter when creating your own.</p>
<h6></h6>
<h6>Upgrade script not set</h6>
<p>If you don’t set the upgrade script (the fourth tab) the management pack won’t import and an Event is logged from source OpsMgr SDK Service with event ID 26319.</p>
<pre>An exception was thrown while processing ExportManagementPack for session id uuid:0cd28904-1168-4c6a-b077-e2820605d1ee;id=591.
 Exception Message: The creator of this fault did not specify a Reason.
 Full Exception: System.ServiceModel.FaultException`1[Microsoft.EnterpriseManagement.Common.ManagementPackException]: The creator of this fault did not specify a Reason. (Fault Detail is equal to : An error occured while loading management pack Id: [38484469-d094-4dd8-da34-261492f13a45] from the database
XSD verification failed for management pack. [Line: 759, Position: 15]The element 'DataWarehouseScript' has incomplete content. List of possible elements expected: 'Upgrade, UpgradeUnsupported'.).</pre>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Event-26319_thumb1.png" class="thickbox no_icon" rel="gallery-4077" title="Event-26319_thumb1"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Event-26319_thumb1" border="0" alt="Event-26319_thumb1" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Event-26319_thumb1_thumb.png" width="204" height="143" /></a> </p>
<p>  <br clear="all" /></p>
<h6></h6>
<h6>Permissions not granted</h6>
<p>If you forget to grant the execute permissions to the OpsMgrReader login (see the last two lines in the install / upgrade script) the report is unable to retrieve data and the following error is thrown.</p>
<pre>An error occurred during report processing.
Query execution failed for dataset 'datasetPerformanceData'
The EXECUTE permission was denied on the object 'spPerfDemo', database 'OperationsManagerDW', schema 'dbo'.</pre>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/The-EXECUTE-permission-was-denied_th.png" class="thickbox no_icon" rel="gallery-4077" title="The-EXECUTE-permission-was-denied_th"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="The-EXECUTE-permission-was-denied_th" border="0" alt="The-EXECUTE-permission-was-denied_th" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/The-EXECUTE-permission-was-denied_th_thumb.png" width="504" height="39" /></a></p>
<h6>No data in chart shown with raw data</h6>
<p>When the data is shown in a chart and the source data is from Perf.vPerfRaw the data might not be shown. However, if you add markers you do see the data (so there is data). This happens when the following conditions apply:</p>
<ul>
<li>The data from Perf.vPerfRaw </li>
<li>Displayed in a (line) chart </li>
<li>Category Groups is [DateTime] </li>
<li>There is a series group with more than one instance. </li>
</ul>
<p>If you export the report to a comma separated file (CSV) you’ll notice that for each instance multiple records are stored but only one has a value, the number of records match the number of instances.</p>
<p>This is caused by the category group datetime. The line chart tries to show the data for each instance in time. Since the data is stored in raw format the timestamp doesn’t match exactly (probably off by a few milliseconds). </p>
<p>The is “solved” by removing the milliseconds from the datetime with the <a  href="http://msdn.microsoft.com/en-us/library/ms187928.aspx" target="_blank">CONVERT</a> statement and using style 120 (ODBC canonical).</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">SELECT</span> CONVERT<span class="br0">&#40;</span>VARCHAR, vPerf.DateTime, <span class="nu0">120</span><span class="br0">&#41;</span> <span class="kw1">AS</span> DateTime,</div>
]]></content:encoded>
			<wfw:commentRss>http://www.peppercrew.nl/index.php/2012/04/opsmgr-choose-source-table-based-on-date-range/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpsMgr: Where&#8217;s my management pack?</title>
		<link>http://www.peppercrew.nl/index.php/2012/04/opsmgr-wheres-my-management-pack/</link>
		<comments>http://www.peppercrew.nl/index.php/2012/04/opsmgr-wheres-my-management-pack/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 13:57:00 +0000</pubDate>
		<dc:creator>Ingmar Verheij</dc:creator>
				<category><![CDATA[Ingmar Verheij]]></category>
		<category><![CDATA[management pack]]></category>
		<category><![CDATA[OpsMgr]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[SCOM]]></category>

		<guid isPermaLink="false">http://www.peppercrew.nl/index.php/2012/04/opsmgr-wheres-my-management-pack/</guid>
		<description><![CDATA[Author: Ingmar Verheij After importing a management pack in System Center Operations Manager (SCOM) it might take a while until it is visible in the Operations Console. When developing a management pack (and especially when creating reports) this is frustrating since there are numerous reasons why the management pack isn’t working as expected. A common [...]]]></description>
			<content:encoded><![CDATA[<p>Author: <a  href="http://www.ingmarverheij.com/" target="_blank">Ingmar Verheij</a></p>
<p><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="" border="0" alt="" align="right" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/scom2007r2.jpg" width="119" height="68" />After importing a management pack in System Center Operations Manager (SCOM) it might take a while until it is visible in the Operations Console. When developing a management pack (and especially when creating reports) this is frustrating since there are numerous reasons why the management pack isn’t working as expected. </p>
<p>A common reason why the management pack (and the associated reports) aren’t showed in the Operations Console is because the management packs are <strong>queued</strong> awaiting synchronization. </p>
<p><span id="more-4052"></span><br />
<h4>Query</h4>
<p>With the SQL query below will help you find the management packs that are pending.&#160; Usually the management pack causing the delay are unsealed (XML) management packs. You can “force” (remember, this still is a system center product – click-and-wait) resynchronizing a management pack by increasing the version number and reimport.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">USE</span> OperationsManager<br />
<span class="kw1">SELECT</span> ManagementPackId, <br />
&nbsp; &nbsp; &nbsp; &nbsp;MPFriendlyName,<br />
&nbsp; &nbsp; &nbsp; &nbsp;MPName, <br />
&nbsp; &nbsp; &nbsp; &nbsp;MP.MPVersionDependentId, <br />
&nbsp; &nbsp; &nbsp; &nbsp;MPLastModified, <br />
&nbsp; &nbsp; &nbsp; &nbsp;MPKeyToken, <br />
&nbsp; &nbsp; &nbsp; &nbsp;ContentReadable<br />
<span class="kw1">FROM</span> ManagementPack mp<br />
<span class="kw1">WHERE</span> MPVersionDependentId <span class="kw1">NOT</span> <span class="kw1">IN</span> <span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">SELECT</span> mpv.ManagementPackVersionDependentGuid<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">FROM</span> OperationsManagerDW.dbo.ManagementPackVersion mpv<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">JOIN</span> OperationsMAnagerDW.dbo.ManagementGroupManagementPackVersion mgmpv <span class="kw1">ON</span> <span class="br0">&#40;</span>mpv.ManagementPackVersionRowId = mgmpv.ManagementPackVersionRowId<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">WHERE</span> <span class="br0">&#40;</span>mgmpv.LatestVersionInd &gt; <span class="nu0">0</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">AND</span> <span class="kw1">NOT</span> <span class="kw1">EXISTS</span> <span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">SELECT</span> * <span class="kw1">FROM</span> ManagementPackReferences mpr<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">JOIN</span> ManagementPack mpv <span class="kw1">ON</span> <span class="br0">&#40;</span>mpr.ManagementPackIdSource = mpv.ManagementPackId<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">WHERE</span> <span class="br0">&#40;</span>mpr.ManagementPackIdReffedBy = mp.ManagementPackId<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">AND</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span>mpv.MPVersionDependentId <span class="kw1">NOT</span> <span class="kw1">IN</span> <span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">SELECT</span> mpv.ManagementPackVersionDependentGuid<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">FROM</span> OperationsManagerDW.dbo.ManagementPackVersion mpv<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">JOIN</span> OperationsManagerDW.dbo.ManagementGroupManagementPackVersion mgmpv <span class="kw1">ON</span> <span class="br0">&#40;</span>mpv.ManagementPackVersionRowId = mgmpv.ManagementPackVersionRowId<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">WHERE</span> <span class="br0">&#40;</span>mgmpv.LatestVersionInd &gt; <span class="nu0">0</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#41;</span></div>
<h4>&#160;</h4>
<h4>Example</h4>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/04/Query-Example.png" class="thickbox no_icon" rel="gallery-4052" title=""><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="" border="0" alt="" align="left" src="http://www.peppercrew.nl/wp-content/uploads/2012/04/Query-Example_thumb.png" width="504" height="365" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peppercrew.nl/index.php/2012/04/opsmgr-wheres-my-management-pack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cookie Error on Citrix XenApp</title>
		<link>http://www.peppercrew.nl/index.php/2012/03/cookie-error-on-citrix-xenapp/</link>
		<comments>http://www.peppercrew.nl/index.php/2012/03/cookie-error-on-citrix-xenapp/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 08:05:29 +0000</pubDate>
		<dc:creator>Remko</dc:creator>
				<category><![CDATA[Remko Weijnen]]></category>
		<category><![CDATA[Citrix]]></category>
		<category><![CDATA[Cookies]]></category>
		<category><![CDATA[HDX]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[XenApp]]></category>

		<guid isPermaLink="false">http://www.peppercrew.nl/index.php/2012/03/cookie-error-on-citrix-xenapp/</guid>
		<description><![CDATA[A user reported that the following error while visiting a website on a Citrix XenApp server: I tried adding the site to the Trusted Sites List and adding the url to the Per Site Privacy list: But this didn’t work, but I noticed that the site was “flickering” a lot so I suspected that HDX [...]]]></description>
			<content:encoded><![CDATA[<p>A user reported that the following error while visiting a website on a Citrix XenApp server:</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/03/image6.png" class="thickbox no_icon" rel="gallery-4048" title="Cookie Error"><img style="display: inline" title="Cookie Error" alt="You must have cookies enabled in order to user this tool. Please reload the page and try again." src="http://www.peppercrew.nl/wp-content/uploads/2012/03/image_thumb6.png" width="415" height="94" /></a></p>
<p>I tried adding the site to the Trusted Sites List and adding the url to the Per Site Privacy list:</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/03/image7.png" class="thickbox no_icon" rel="gallery-4048" title="image"><img style="display: inline" title="image" alt="image" src="http://www.peppercrew.nl/wp-content/uploads/2012/03/image_thumb7.png" width="415" height="256" /></a></p>
<p>But this didn’t work, but I noticed that the site was “flickering” a lot so I suspected that HDX Flash Acceleration was the problem.</p>
<p><span id="more-4048"></span>
<p>I imported the adm file for HDX (HdxFlash-Server.adm) into a GPO and added the site to the Per-URL-blacklist:</p>
<p><a  href="http://www.peppercrew.nl/wp-content/uploads/2012/03/SNAGHTMLfc0ed9b.png" class="thickbox no_icon" rel="gallery-4048" title="SNAGHTMLfc0ed9b"><img style="display: inline" title="SNAGHTMLfc0ed9b" alt="SNAGHTMLfc0ed9b" src="http://www.peppercrew.nl/wp-content/uploads/2012/03/SNAGHTMLfc0ed9b_thumb.png" width="415" height="310" /></a></p>
<p>That fixed the problem!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peppercrew.nl/index.php/2012/03/cookie-error-on-citrix-xenapp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

