<?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>Uptime &#38; Performance Tips &#187; Monitis vs. Other services</title>
	<atom:link href="http://blog.monitis.com/index.php/category/monitis-vs-other-services/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.monitis.com</link>
	<description>Tips for SysAdmin, Webmaster, Network Admin</description>
	<lastBuildDate>Wed, 08 Feb 2012 09:46:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Monitis-Top… an open-source command-line interface for Monitis Agents and Monitors</title>
		<link>http://blog.monitis.com/index.php/2011/10/17/monitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors/</link>
		<comments>http://blog.monitis.com/index.php/2011/10/17/monitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 12:47:44 +0000</pubDate>
		<dc:creator>Ard-Jan Barnas</dc:creator>
				<category><![CDATA[Linux Servers Monitoring]]></category>
		<category><![CDATA[Management Scripts]]></category>
		<category><![CDATA[Monitis vs. Other services]]></category>
		<category><![CDATA[Monitoring Scripts]]></category>
		<category><![CDATA[Performance Management]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[Website Monitoring]]></category>
		<category><![CDATA[Windows Servers Monitoring]]></category>
		<category><![CDATA[command-line tools]]></category>
		<category><![CDATA[monitis-top]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[vbscript scripts]]></category>

		<guid isPermaLink="false">http://blog.monitis.com/?p=4005</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/10/17/monitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors/' addthis:title='Monitis-Top… an open-source command-line interface for Monitis Agents and Monitors '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div> In this article we’ll discuss creating a command line interface to query the Monitis Agents and Monitors you have activated for your systems. We’ll provide the source code for the utility in VBScript and we will also be working on a C# version.  We’ll keep things simple for now and start with VBScript and provide [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/10/17/monitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors/' addthis:title='Monitis-Top… an open-source command-line interface for Monitis Agents and Monitors '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p><img style="float: right; padding: 15px;" title="VBSccript_icon" src="http://blog.monitis.com/wp-content/uploads/2011/10/VBSccript_icon.png" alt="" width="64" height="64" /> In this article we’ll discuss creating a command line interface to query the Monitis Agents and Monitors you have activated for your systems. We’ll provide the source code for the utility in VBScript and we will also be working on a C# version.  We’ll keep things simple for now and start with VBScript and provide a link to the complete source at the end of this article.</p>
<p>To get started we need to identify what information we want to display from our Monitors, what can be easily supported, and what is not supported.  The main parts are the different types of agents that Monitis offers, which are the Internal,<br />
External, and custom monitors.</p>
<p>In this article we’ll focus on the basic ‘framework’ of the utility that deals with the definition of some classes to make working with the various agents and monitors easier, accepting and processing command-line arguments, and a small function library to keep our main script very clean. We’ll introduce a neat little feature of VBScript showing you how to work with include files.<span id="more-4005"></span></p>
<p>Let’s take a look at the functionality and output we like to get from Monitis-Top.</p>
<h3>Querying Internal Monitors</h3>
<p>We want to be able to display the latest performance counters from our internal, external, and custom monitors by entering commands like:</p>
<p><em>MonitisTop /cmd:listagents /type:internal /monitor:all</em></p>
<p>Which would return the performance counters for all<br />
supported monitors of the internal agents, or</p>
<p><em>MonitisTop /cmd:listagents /type:internal /monitor:cpu,memory,drive</em></p>
<p>This returns the Cpu, Memory, and Drive monitors for the internal agents.</p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/10/cm3.png"><img class="aligncenter size-full wp-image-4006" src="http://blog.monitis.com/wp-content/uploads/2011/10/cm3.png" alt="" width="640" height="237" /></a></p>
<h3></h3>
<h3>Querying Process Monitors</h3>
<p>We can enter query the process monitors that we’ve configured in our Monitis dashboard like so:</p>
<p><em>MonitisTop /cmd:listagents /type:int  /process:outlook,search</em></p>
<p>This will return any process monitors containing the phrases &#8216;outlook’ and ‘search’. MonitisTop will automatically wildcard any processes listed on the command line.</p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/10/cmd4.png"><img class="aligncenter size-full wp-image-4007" src="http://blog.monitis.com/wp-content/uploads/2011/10/cmd4.png" alt="" width="637" height="190" /></a></p>
<h3>Querying External Monitors</h3>
<p>Monitis Top can also be used to query external monitors. You can specify the parameter <em>/type:ext</em> or <em>/type:all</em>, where <em>ext</em> will only return the external monitors and <em>all</em> returns both internal and external monitor results. For example, the command:</p>
<p><em>MonitisTop /cmd:listagents /type:all /monitor:cpu</em></p>
<p>will return both the internal CPU monitor result and the external monitors.</p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/10/ExternalMonitors.png"><img class="aligncenter size-full wp-image-4076" src="http://blog.monitis.com/wp-content/uploads/2011/10/ExternalMonitors.png" alt="" width="637" height="467" /></a></p>
<p>The results will show by each location that you have specified for a monitor.</p>
<h3>Managing API and Secret Keys</h3>
<p>We want similar commands for the external and custom agents.  In addition, it would also be nice if there was some functionality to maintain our APIKeys, so we’ll add a function that allows you to set and display these keys by entering:</p>
<p><em>MonitisTop /cmd:setkeys  /apikey:&lt;yourapikey&gt; /secretkey:&lt;yoursecretkey&gt;</em></p>
<p>Similar, you can display the keys with the command:</p>
<p><em> </em><em>MonitisTop /cmd:getkeys</em></p>
<p>&nbsp;</p>
<h3>VBScript Include Files</h3>
<p>We’ll use VBScript to program the code for MonitisTop  initially. In the next phase of this project we’ll use C#. If you’re not  familiar with the possibility of using include files in VBScript, take a look  at the code snippet below.</p>
<div id="gist-1278782" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">Sub</span> <span class="nf">Include</span><span class="p">(</span><span class="n">strFilename</span><span class="p">)</span></div><div class='line' id='LC2'>	<span class="k">On</span> <span class="k">Error</span> <span class="k">Resume</span> <span class="k">Next</span></div><div class='line' id='LC3'>	<span class="k">Dim</span> <span class="n">oFSO</span><span class="p">,</span> <span class="n">f</span><span class="p">,</span> <span class="n">s</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'>	<span class="k">Set</span> <span class="n">oFSO</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Scripting.FileSystemObject&quot;</span><span class="p">)</span></div><div class='line' id='LC6'>	<span class="k">If</span> <span class="n">oFSO</span><span class="p">.</span><span class="n">FileExists</span><span class="p">(</span><span class="n">strFilename</span><span class="p">)</span> <span class="k">Then</span></div><div class='line' id='LC7'>		<span class="k">Set</span> <span class="n">f</span> <span class="o">=</span> <span class="n">oFSO</span><span class="p">.</span><span class="n">OpenTextFile</span><span class="p">(</span><span class="n">strFilename</span><span class="p">)</span></div><div class='line' id='LC8'>		<span class="n">s</span> <span class="o">=</span> <span class="n">f</span><span class="p">.</span><span class="n">ReadAll</span></div><div class='line' id='LC9'>		<span class="n">f</span><span class="p">.</span><span class="n">Close</span></div><div class='line' id='LC10'>		<span class="n">ExecuteGlobal</span> <span class="n">s</span></div><div class='line' id='LC11'>	<span class="k">End</span> <span class="k">If</span></div><div class='line' id='LC12'><br/></div><div class='line' id='LC13'>	<span class="k">Set</span> <span class="n">oFSO</span> <span class="o">=</span> <span class="k">Nothing</span></div><div class='line' id='LC14'>	<span class="k">Set</span> <span class="n">f</span> <span class="o">=</span> <span class="k">Nothing</span></div><div class='line' id='LC15'>	<span class="k">On</span> <span class="k">Error</span> <span class="k">Goto</span> <span class="mi">0</span></div><div class='line' id='LC16'><span class="k">End</span> <span class="k">Sub</span></div><div class='line' id='LC17'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1278782/8d7fc0456004349538f9fd80cd3669f42d16bd84/VBScriptInclude.vbs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1278782#file_vb_script_include.vbs" style="float:right;margin-right:10px;color:#666">VBScriptInclude.vbs</a>
            <a href="https://gist.github.com/1278782">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<h3>Class Definitions</h3>
<p>To make working with the various agents and monitors more manageable, we’ll create a few classes that we use to store the performance counter results we get back from the Monitis server. To start we’ll create a few classes; one for the agents, one for the monitors belonging to an agent, and one for the various metrics and values in a monitor. We want the Agent class to maintain a list of Monitors, and the Monitor class in its turn maintains a list of Metrics.</p>
<div id="gist-1282009" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">Class</span> <span class="nc">class_Metric</span></div><div class='line' id='LC2'>	<span class="k">Public</span> <span class="n">Name</span></div><div class='line' id='LC3'>	<span class="k">Public</span> <span class="n">Metric</span></div><div class='line' id='LC4'>	<span class="k">Public</span> <span class="n">Result</span></div><div class='line' id='LC5'>	<span class="k">Public</span> <span class="n">Suffix</span></div><div class='line' id='LC6'>	<span class="k">Public</span> <span class="n">Width</span></div><div class='line' id='LC7'><br/></div><div class='line' id='LC8'>	<span class="k">Private</span> <span class="k">Sub</span> <span class="nf">Class_Initialize</span></div><div class='line' id='LC9'>		<span class="n">Name</span> <span class="o">=</span> <span class="s">&quot;&quot;</span></div><div class='line' id='LC10'>		<span class="n">Metric</span> <span class="o">=</span> <span class="s">&quot;&quot;</span></div><div class='line' id='LC11'>		<span class="n">Result</span> <span class="o">=</span> <span class="s">&quot;&quot;</span></div><div class='line' id='LC12'>		<span class="n">Suffix</span> <span class="o">=</span> <span class="s">&quot;&quot;</span></div><div class='line' id='LC13'>		<span class="n">Width</span> <span class="o">=</span> <span class="mi">0</span></div><div class='line' id='LC14'>	<span class="k">End</span> <span class="k">Sub</span></div><div class='line' id='LC15'><span class="k">End</span> <span class="k">Class</span></div><div class='line' id='LC16'><br/></div><div class='line' id='LC17'><br/></div><div class='line' id='LC18'><span class="k">Class</span> <span class="nc">class_Monitor</span></div><div class='line' id='LC19'>	<span class="k">Public</span> <span class="n">Id</span></div><div class='line' id='LC20'>	<span class="k">Public</span> <span class="n">Name</span></div><div class='line' id='LC21'><br/></div><div class='line' id='LC22'>	<span class="k">Public</span> <span class="n">MetricList</span></div><div class='line' id='LC23'><br/></div><div class='line' id='LC24'>	<span class="k">Private</span> <span class="k">Sub</span> <span class="nf">Class_Initialize</span></div><div class='line' id='LC25'>		<span class="n">Id</span> <span class="o">=</span> <span class="s">&quot;&quot;</span></div><div class='line' id='LC26'>		<span class="n">Name</span> <span class="o">=</span> <span class="s">&quot;&quot;</span></div><div class='line' id='LC27'>		<span class="k">Set</span> <span class="n">MetricList</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Scripting.Dictionary&quot;</span><span class="p">)</span></div><div class='line' id='LC28'>	<span class="k">End</span> <span class="k">Sub</span></div><div class='line' id='LC29'><br/></div><div class='line' id='LC30'>	<span class="k">Private</span> <span class="k">Sub</span> <span class="nf">Class_Terminate</span></div><div class='line' id='LC31'>		<span class="k">Set</span> <span class="n">MetricList</span> <span class="o">=</span> <span class="k">Nothing</span></div><div class='line' id='LC32'>	<span class="k">End</span> <span class="k">Sub</span></div><div class='line' id='LC33'><span class="k">End</span> <span class="k">Class</span></div><div class='line' id='LC34'><br/></div><div class='line' id='LC35'><br/></div><div class='line' id='LC36'><span class="k">Class</span> <span class="nc">class_InternalAgent</span></div><div class='line' id='LC37'>	<span class="k">Public</span> <span class="n">Id</span></div><div class='line' id='LC38'>	<span class="k">Public</span> <span class="n">Name</span></div><div class='line' id='LC39'>	<span class="k">Public</span> <span class="n">MonitorList</span></div><div class='line' id='LC40'><br/></div><div class='line' id='LC41'>	<span class="k">Private</span> <span class="k">Sub</span> <span class="nf">Class_Initialize</span></div><div class='line' id='LC42'>		<span class="k">Set</span> <span class="n">MonitorList</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Scripting.Dictionary&quot;</span><span class="p">)</span></div><div class='line' id='LC43'>	<span class="k">End</span> <span class="k">Sub</span></div><div class='line' id='LC44'><br/></div><div class='line' id='LC45'>	<span class="k">Private</span> <span class="k">Sub</span> <span class="nf">Class_Terminate</span></div><div class='line' id='LC46'>		<span class="k">Set</span> <span class="n">MonitorList</span> <span class="o">=</span> <span class="k">Nothing</span></div><div class='line' id='LC47'>	<span class="k">End</span> <span class="k">Sub</span></div><div class='line' id='LC48'><span class="k">End</span> <span class="k">Class</span></div><div class='line' id='LC49'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1282009/93f573fbf8e199b22853146fba2177cedd1182e8/MonitisTopClasses.vbs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1282009#file_monitis_top_classes.vbs" style="float:right;margin-right:10px;color:#666">MonitisTopClasses.vbs</a>
            <a href="https://gist.github.com/1282009">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>In the class_InternalAgent we create a list of monitor objects that is initialized in the constructor of the class. Notice that in VBScript the methods Class_Initialize and Class_Terminate are automatically called if they are defined and these methods compare to your C# constructor and Dispose methods<em>.</em></p>
<h3>Retrieving the Internal Agents</h3>
<p>Once we have parsed the list of monitors that we want to show (specified on the command line), we can call the function <em>GetInternalAgents</em>. In the function below aObjHttp, aShowMonitors, and aShowProcesses  are input values, while aObjAgents is an output value. It returns the list of internal agents retrieved from the API.</p>
<div id="gist-1282557" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">Function</span> <span class="nf">GetInternalAgents</span><span class="p">(</span><span class="n">aObjHttp</span><span class="p">,</span> <span class="n">aObjAgents</span><span class="p">,</span> <span class="n">aShowMonitors</span><span class="p">,</span> <span class="n">aShowProcesses</span><span class="p">)</span></div><div class='line' id='LC2'>	<span class="k">Dim</span> <span class="n">objAgents</span><span class="p">,</span> <span class="n">xmlAgents</span></div><div class='line' id='LC3'>	<span class="k">Set</span> <span class="n">objAgents</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Scripting.Dictionary&quot;</span><span class="p">)</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'>	<span class="c">&#39;Retrieve the list of agents</span></div><div class='line' id='LC6'>	<span class="n">url</span> <span class="o">=</span> <span class="s">&quot;http://www.monitis.com/api?action=agents&amp;apikey=&quot;</span> <span class="o">+</span> <span class="n">apiKey</span> <span class="o">+</span> <span class="s">&quot;&amp;output=xml&quot;</span></div><div class='line' id='LC7'>	<span class="n">aObjHttp</span><span class="p">.</span><span class="n">open</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="k">False</span></div><div class='line' id='LC8'>	<span class="n">aObjHttp</span><span class="p">.</span><span class="n">send</span></div><div class='line' id='LC9'><br/></div><div class='line' id='LC10'>	<span class="c">&#39;Parse response</span></div><div class='line' id='LC11'>	<span class="k">Set</span> <span class="n">xmlAgents</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Microsoft.XMLDOM&quot;</span><span class="p">)</span></div><div class='line' id='LC12'>	<span class="n">xmlAgents</span><span class="p">.</span><span class="n">async</span> <span class="o">=</span> <span class="k">False</span></div><div class='line' id='LC13'>	<span class="n">xmlAgents</span><span class="p">.</span><span class="n">LoadXML</span><span class="p">(</span><span class="n">aObjHttp</span><span class="p">.</span><span class="n">responseText</span><span class="p">)</span></div><div class='line' id='LC14'>	<span class="k">If</span> <span class="n">xmlAgents</span><span class="p">.</span><span class="n">parseError</span><span class="p">.</span><span class="n">errorCode</span> <span class="o">&lt;&gt;</span> <span class="mi">0</span> <span class="k">Then</span>    </div><div class='line' id='LC15'>		<span class="n">wscript</span><span class="p">.</span><span class="n">Echo</span> <span class="n">xmlAgents</span><span class="p">.</span><span class="n">parseError</span><span class="p">.</span><span class="n">errorCode</span>    </div><div class='line' id='LC16'>		<span class="n">wscript</span><span class="p">.</span><span class="n">Echo</span> <span class="n">xmlAgents</span><span class="p">.</span><span class="n">parseError</span><span class="p">.</span><span class="n">reason</span>    </div><div class='line' id='LC17'>		<span class="n">wscript</span><span class="p">.</span><span class="n">Echo</span> <span class="n">xmlAgents</span><span class="p">.</span><span class="n">parseError</span><span class="p">.</span><span class="n">line</span></div><div class='line' id='LC18'>	<span class="k">End</span> <span class="k">If</span>  	</div><div class='line' id='LC19'><br/></div><div class='line' id='LC20'><br/></div><div class='line' id='LC21'>	<span class="c">&#39;Retrieve the agent information for each agent</span></div><div class='line' id='LC22'>	<span class="k">For</span> <span class="k">Each</span> <span class="n">agent</span> <span class="ow">in</span> <span class="n">xmlAgents</span><span class="p">.</span><span class="n">documentElement</span><span class="p">.</span><span class="n">childnodes</span></div><div class='line' id='LC23'><br/></div><div class='line' id='LC24'>		<span class="c">&#39;Create an InternalAgent Object	</span></div><div class='line' id='LC25'>		<span class="k">Set</span> <span class="n">IntAgent</span> <span class="o">=</span> <span class="k">New</span> <span class="n">class_InternalAgent</span></div><div class='line' id='LC26'>		<span class="n">IntAgent</span><span class="p">.</span><span class="n">Id</span> <span class="o">=</span> <span class="n">agent</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="s">&quot;id&quot;</span><span class="p">).</span><span class="n">text</span></div><div class='line' id='LC27'>		<span class="n">IntAgent</span><span class="p">.</span><span class="n">Name</span> <span class="o">=</span> <span class="n">agent</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="s">&quot;key&quot;</span><span class="p">).</span><span class="n">text</span></div><div class='line' id='LC28'><br/></div><div class='line' id='LC29'>		<span class="c">&#39;Retrieve the agent information </span></div><div class='line' id='LC30'>		<span class="n">url</span> <span class="o">=</span> <span class="s">&quot;http://www.monitis.com/api?action=agentInfo&amp;apikey=&quot;</span> <span class="o">+</span> <span class="n">apiKey</span> <span class="o">+</span> <span class="s">&quot;&amp;output=xml&amp;agentId=&quot;</span> <span class="o">+</span> <span class="n">IntAgent</span><span class="p">.</span><span class="n">Id</span> <span class="o">+</span> <span class="s">&quot;&amp;loadTests=true&quot;</span></div><div class='line' id='LC31'>		<span class="n">aObjHttp</span><span class="p">.</span><span class="n">open</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="k">False</span></div><div class='line' id='LC32'>		<span class="n">aObjHttp</span><span class="p">.</span><span class="n">send</span></div><div class='line' id='LC33'><br/></div><div class='line' id='LC34'>		<span class="k">Set</span> <span class="n">xmlAgentInfo</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Microsoft.XMLDOM&quot;</span><span class="p">)</span></div><div class='line' id='LC35'>		<span class="n">xmlAgentInfo</span><span class="p">.</span><span class="n">async</span> <span class="o">=</span> <span class="k">False</span></div><div class='line' id='LC36'>		<span class="n">xmlAgentInfo</span><span class="p">.</span><span class="n">LoadXML</span><span class="p">(</span><span class="n">aObjHttp</span><span class="p">.</span><span class="n">responseText</span><span class="p">)</span></div><div class='line' id='LC37'><br/></div><div class='line' id='LC38'>		<span class="k">For</span> <span class="k">Each</span> <span class="n">info</span> <span class="ow">in</span> <span class="n">xmlAgentInfo</span><span class="p">.</span><span class="n">documentElement</span><span class="p">.</span><span class="n">childnodes</span></div><div class='line' id='LC39'><br/></div><div class='line' id='LC40'>			<span class="k">If</span> <span class="n">aShowProcesses</span><span class="p">.</span><span class="n">Count</span> <span class="o">=</span> <span class="mi">0</span> <span class="k">Then</span></div><div class='line' id='LC41'>				<span class="n">GetGlobalMonitors</span> <span class="n">aObjHttp</span><span class="p">,</span> <span class="n">info</span><span class="p">.</span><span class="n">childnodes</span><span class="p">,</span> <span class="n">IntAgent</span><span class="p">,</span> <span class="n">aShowMonitors</span></div><div class='line' id='LC42'>			<span class="k">Else</span></div><div class='line' id='LC43'>				<span class="k">If</span> <span class="n">LCase</span><span class="p">(</span><span class="n">info</span><span class="p">.</span><span class="n">nodename</span><span class="p">)</span> <span class="o">=</span> <span class="s">&quot;processes&quot;</span> <span class="k">Then</span></div><div class='line' id='LC44'>					<span class="n">GetProcessMonitors</span> <span class="n">aObjHttp</span><span class="p">,</span> <span class="n">info</span><span class="p">.</span><span class="n">childnodes</span><span class="p">,</span> <span class="n">IntAgent</span><span class="p">,</span> <span class="n">aShowProcesses</span></div><div class='line' id='LC45'>				<span class="k">End</span> <span class="k">If</span></div><div class='line' id='LC46'>			<span class="k">End</span> <span class="k">If</span></div><div class='line' id='LC47'><br/></div><div class='line' id='LC48'>		<span class="k">Next</span></div><div class='line' id='LC49'><br/></div><div class='line' id='LC50'>		<span class="c">&#39;Add the agent object to the list of agents</span></div><div class='line' id='LC51'>		<span class="n">aObjAgents</span><span class="p">.</span><span class="n">Add</span> <span class="n">IntAgent</span><span class="p">.</span><span class="n">Id</span><span class="p">,</span> <span class="n">IntAgent</span></div><div class='line' id='LC52'>	<span class="k">Next</span></div><div class='line' id='LC53'><br/></div><div class='line' id='LC54'><span class="k">End</span> <span class="k">Function</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1282557/a44e358f1c29dd9d19f92de3dead5cc3299f1358/getInternalAgents.vbs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1282557#file_get_internal_agents.vbs" style="float:right;margin-right:10px;color:#666">getInternalAgents.vbs</a>
            <a href="https://gist.github.com/1282557">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The main part of this function is the creation of the Agent class, retrieving the ‘loadTests’ from the API and cycling through the list of returned Monitors for each Agent.</p>
<p>Because we want to build in support for querying process monitors as well as global drive, memory, and cpu monitors, we’ve included the list ‘<em>aShowProcesses’</em>. This list contains the processes entered on the command line that we want to query. If<br />
this list contains zero elements, the program defaults to collecting and returning the global monitors.</p>
<p>After <em>GetGlobalMonitors </em>(or <em>GetAgentProcessMonitors</em>) have returned, we’ll add the Internal Agent object to <em>aObjAgents</em>; the list of Internal Agents.</p>
<p>In the <em>GetAgentMonitors </em>function we’ll collect all the monitors of an agent and make a call to <em>GetResults</em> to retrieve all the metric<br />
values.</p>
<p><div id="gist-1282582" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">Function</span> <span class="nf">GetGlobalMonitors</span><span class="p">(</span><span class="n">aObjHttp</span><span class="p">,</span> <span class="n">oNames</span><span class="p">,</span> <span class="n">aObjAgent</span><span class="p">,</span> <span class="n">aShowMonitors</span><span class="p">)</span></div><div class='line' id='LC2'>	<span class="k">Dim</span> <span class="n">oName</span></div><div class='line' id='LC3'>&nbsp;&nbsp;</div><div class='line' id='LC4'>	<span class="k">For</span> <span class="k">Each</span> <span class="n">oName</span> <span class="ow">in</span> <span class="n">oNames</span></div><div class='line' id='LC5'><br/></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;	<span class="k">If</span> <span class="n">oName</span><span class="p">.</span><span class="n">NodeName</span> <span class="o">&lt;&gt;</span> <span class="s">&quot;#text&quot;</span> <span class="ow">And</span> <span class="n">oName</span><span class="p">.</span><span class="n">NodeName</span> <span class="o">&lt;&gt;</span> <span class="s">&quot;process&quot;</span> <span class="ow">And</span> <span class="n">_</span></div><div class='line' id='LC7'>		  <span class="n">SupportedMonitors</span><span class="p">.</span><span class="n">Exists</span><span class="p">(</span><span class="n">LCase</span><span class="p">(</span><span class="n">oName</span><span class="p">.</span><span class="n">NodeName</span><span class="p">))</span> <span class="ow">And</span> <span class="n">_</span></div><div class='line' id='LC8'>		  <span class="n">aShowMonitors</span><span class="p">.</span><span class="n">Exists</span><span class="p">(</span><span class="n">LCase</span><span class="p">(</span><span class="n">oName</span><span class="p">.</span><span class="n">NodeName</span><span class="p">))</span> <span class="k">Then</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;		<span class="c">&#39; Create new monitor object</span></div><div class='line' id='LC11'>			<span class="k">Set</span> <span class="n">Monitor</span> <span class="o">=</span> <span class="k">New</span> <span class="n">class_Monitor</span></div><div class='line' id='LC12'>			<span class="n">Monitor</span><span class="p">.</span><span class="n">Name</span> <span class="o">=</span> <span class="n">GetMonitorName</span><span class="p">(</span><span class="n">oName</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="s">&quot;name&quot;</span><span class="p">).</span><span class="n">text</span><span class="p">)</span></div><div class='line' id='LC13'>		    <span class="n">strMonitorName</span> <span class="o">=</span> <span class="n">LCase</span><span class="p">(</span><span class="n">GetMonitorBaseName</span><span class="p">(</span><span class="n">Monitor</span><span class="p">.</span><span class="n">Name</span><span class="p">))</span></div><div class='line' id='LC14'>			<span class="n">Monitor</span><span class="p">.</span><span class="n">Id</span> <span class="o">=</span> <span class="n">UCase</span><span class="p">(</span><span class="n">oName</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="s">&quot;id&quot;</span><span class="p">).</span><span class="n">text</span><span class="p">)</span></div><div class='line' id='LC15'>			<span class="n">Monitor</span><span class="p">.</span><span class="n">DisplayName</span> <span class="o">=</span> <span class="n">UCase</span><span class="p">(</span><span class="n">Monitor</span><span class="p">.</span><span class="n">Name</span><span class="p">)</span></div><div class='line' id='LC16'><br/></div><div class='line' id='LC17'>			<span class="n">url</span> <span class="o">=</span> <span class="s">&quot;http://www.monitis.com/api?version=2&amp;apikey=&quot;</span> <span class="o">&amp;</span> <span class="n">apikey</span> <span class="o">&amp;</span> <span class="s">&quot;&amp;output=xml&amp;action=top&quot;</span> <span class="o">&amp;</span> <span class="n">strMonitorName</span> <span class="o">&amp;</span> <span class="s">&quot;&amp;limit=50&amp;detailedResults=true&quot;</span></div><div class='line' id='LC18'><br/></div><div class='line' id='LC19'>			<span class="n">aObjHttp</span><span class="p">.</span><span class="n">open</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="k">False</span></div><div class='line' id='LC20'>			<span class="n">aObjHttp</span><span class="p">.</span><span class="n">send</span></div><div class='line' id='LC21'>			<span class="k">Set</span> <span class="n">oRes</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Microsoft.XMLDOM&quot;</span><span class="p">)</span></div><div class='line' id='LC22'>			<span class="n">oRes</span><span class="p">.</span><span class="n">async</span> <span class="o">=</span> <span class="k">False</span></div><div class='line' id='LC23'>			<span class="n">oRes</span><span class="p">.</span><span class="n">LoadXML</span><span class="p">(</span><span class="n">aObjHttp</span><span class="p">.</span><span class="n">responseText</span><span class="p">)</span></div><div class='line' id='LC24'><br/></div><div class='line' id='LC25'>			<span class="k">Set</span> <span class="n">oNode</span> <span class="o">=</span> <span class="n">oRes</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="s">&quot;data/tests&quot;</span><span class="p">)</span></div><div class='line' id='LC26'>			<span class="k">If</span> <span class="k">Not</span> <span class="n">oNode</span> <span class="ow">Is</span> <span class="k">Nothing</span> <span class="k">Then</span></div><div class='line' id='LC27'>				<span class="k">For</span> <span class="k">Each</span> <span class="n">oCell</span> <span class="ow">In</span> <span class="n">oNode</span><span class="p">.</span><span class="n">childnodes</span></div><div class='line' id='LC28'>					<span class="n">GetResult</span> <span class="n">oCell</span><span class="p">,</span> <span class="n">Monitor</span><span class="p">,</span> <span class="n">SupportedMonitors</span><span class="p">(</span><span class="n">strMonitorName</span><span class="p">)</span></div><div class='line' id='LC29'>				<span class="k">Next</span></div><div class='line' id='LC30'>				<span class="n">aObjAgent</span><span class="p">.</span><span class="n">MonitorList</span><span class="p">.</span><span class="n">Add</span> <span class="n">Monitor</span><span class="p">.</span><span class="n">Name</span><span class="p">,</span> <span class="n">Monitor</span></div><div class='line' id='LC31'>			<span class="k">End</span> <span class="k">If</span></div><div class='line' id='LC32'>		<span class="k">End</span> <span class="k">If</span> </div><div class='line' id='LC33'><br/></div><div class='line' id='LC34'>	<span class="k">Next</span>  </div><div class='line' id='LC35'><span class="k">End</span> <span class="k">Function</span></div><div class='line' id='LC36'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1282582/980e24e8a75914e8ad1874a02c2b15a1da9c3670/getGlobalMonitors.vbs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1282582#file_get_global_monitors.vbs" style="float:right;margin-right:10px;color:#666">getGlobalMonitors.vbs</a>
            <a href="https://gist.github.com/1282582">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>
</a></p>
<p>In <em>GetGlobalMonitors </em>we create a Monitor object for each required monitor we want to return and call the function GetResult to retrieve the metric values for each monitor.</p>
<div id="gist-1282593" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">Function</span> <span class="nf">GetProcessMonitors</span><span class="p">(</span><span class="n">aObjHttp</span><span class="p">,</span> <span class="n">oNames</span><span class="p">,</span> <span class="n">aObjAgent</span><span class="p">,</span> <span class="n">aShowProcesses</span><span class="p">)</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'>	<span class="n">url</span> <span class="o">=</span> <span class="s">&quot;http://www.monitis.com/api?version=2&amp;apikey=&quot;</span> <span class="o">&amp;</span> <span class="n">apikey</span> <span class="o">&amp;</span> <span class="s">&quot;&amp;output=xml&amp;action=topProcessByCPUUsage&amp;limit=50&amp;detailedResults=true&quot;</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'>	<span class="n">aObjHttp</span><span class="p">.</span><span class="n">open</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="k">False</span></div><div class='line' id='LC6'>	<span class="n">aObjHttp</span><span class="p">.</span><span class="n">send</span></div><div class='line' id='LC7'>	<span class="k">Set</span> <span class="n">oRes</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Microsoft.XMLDOM&quot;</span><span class="p">)</span></div><div class='line' id='LC8'>	<span class="n">oRes</span><span class="p">.</span><span class="n">async</span> <span class="o">=</span> <span class="k">False</span></div><div class='line' id='LC9'>	<span class="n">oRes</span><span class="p">.</span><span class="n">LoadXML</span><span class="p">(</span><span class="n">aObjHttp</span><span class="p">.</span><span class="n">responseText</span><span class="p">)</span></div><div class='line' id='LC10'><br/></div><div class='line' id='LC11'>	<span class="k">Set</span> <span class="n">oNode</span> <span class="o">=</span> <span class="n">oRes</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="s">&quot;data/tests&quot;</span><span class="p">)</span></div><div class='line' id='LC12'>	<span class="k">For</span> <span class="k">Each</span> <span class="n">t</span> <span class="ow">In</span> <span class="n">oNode</span><span class="p">.</span><span class="n">childnodes</span></div><div class='line' id='LC13'><br/></div><div class='line' id='LC14'>		<span class="k">Set</span> <span class="n">oTest</span> <span class="o">=</span> <span class="n">t</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="s">&quot;testName&quot;</span><span class="p">)</span></div><div class='line' id='LC15'>		<span class="k">If</span> <span class="k">Not</span> <span class="n">oTest</span> <span class="ow">Is</span> <span class="k">Nothing</span> <span class="k">Then</span></div><div class='line' id='LC16'><br/></div><div class='line' id='LC17'>			<span class="k">If</span> <span class="n">ShowThisProcess</span><span class="p">(</span><span class="n">oTest</span><span class="p">.</span><span class="n">text</span><span class="p">,</span> <span class="n">aShowProcesses</span><span class="p">)</span> <span class="k">Then</span></div><div class='line' id='LC18'><br/></div><div class='line' id='LC19'>				<span class="c">&#39;Create a new monitor object</span></div><div class='line' id='LC20'>				<span class="k">Set</span> <span class="n">Monitor</span> <span class="o">=</span> <span class="k">New</span> <span class="n">class_Monitor</span></div><div class='line' id='LC21'>				<span class="n">Monitor</span><span class="p">.</span><span class="n">Id</span> <span class="o">=</span> <span class="n">t</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="s">&quot;id&quot;</span><span class="p">).</span><span class="n">text</span></div><div class='line' id='LC22'>				<span class="n">Monitor</span><span class="p">.</span><span class="n">Name</span> <span class="o">=</span> <span class="n">t</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="s">&quot;testName&quot;</span><span class="p">).</span><span class="n">text</span></div><div class='line' id='LC23'>				<span class="n">Monitor</span><span class="p">.</span><span class="n">DisplayName</span> <span class="o">=</span> <span class="n">GetMonitorName</span><span class="p">(</span><span class="n">t</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="s">&quot;testName&quot;</span><span class="p">).</span><span class="n">text</span><span class="p">)</span></div><div class='line' id='LC24'><br/></div><div class='line' id='LC25'>				<span class="c">&#39;Retrieve the results for this monitor</span></div><div class='line' id='LC26'>				<span class="n">GetResult</span> <span class="n">t</span><span class="p">,</span> <span class="n">Monitor</span><span class="p">,</span> <span class="n">SupportedMonitors</span><span class="p">.</span><span class="n">Item</span><span class="p">(</span><span class="s">&quot;process&quot;</span><span class="p">)</span></div><div class='line' id='LC27'><br/></div><div class='line' id='LC28'>				<span class="c">&#39;Add the monitor to the list of agents</span></div><div class='line' id='LC29'>				<span class="n">aObjAgent</span><span class="p">.</span><span class="n">MonitorList</span><span class="p">.</span><span class="n">Add</span> <span class="n">Monitor</span><span class="p">.</span><span class="n">Id</span><span class="p">,</span> <span class="n">Monitor</span></div><div class='line' id='LC30'><br/></div><div class='line' id='LC31'>			<span class="k">End</span> <span class="k">If</span></div><div class='line' id='LC32'><br/></div><div class='line' id='LC33'>		<span class="k">End</span> <span class="k">If</span></div><div class='line' id='LC34'><br/></div><div class='line' id='LC35'>	<span class="k">Next</span></div><div class='line' id='LC36'><br/></div><div class='line' id='LC37'><span class="k">End</span> <span class="k">Function</span></div><div class='line' id='LC38'><br/></div><div class='line' id='LC39'><span class="c">&#39;-------------------------------------------------------------------</span></div><div class='line' id='LC40'><br/></div><div class='line' id='LC41'><span class="k">Function</span> <span class="nf">ShowThisProcess</span><span class="p">(</span><span class="n">aProcess</span><span class="p">,</span> <span class="n">aShowProcesses</span><span class="p">)</span></div><div class='line' id='LC42'>	<span class="n">ShowThisProcess</span> <span class="o">=</span> <span class="k">False</span></div><div class='line' id='LC43'>	<span class="k">For</span> <span class="k">Each</span> <span class="n">sp</span> <span class="ow">In</span> <span class="n">aShowProcesses</span></div><div class='line' id='LC44'>		<span class="k">If</span> <span class="p">(</span><span class="n">InStr</span><span class="p">(</span><span class="n">LCase</span><span class="p">(</span><span class="n">aProcess</span><span class="p">),</span> <span class="n">LCase</span><span class="p">(</span><span class="n">sp</span><span class="p">))</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="ow">Or</span> <span class="p">(</span><span class="n">sp</span> <span class="o">=</span> <span class="s">&quot;all&quot;</span><span class="p">)</span> <span class="k">Then</span></div><div class='line' id='LC45'>			<span class="n">ShowThisProcess</span> <span class="o">=</span> <span class="k">True</span></div><div class='line' id='LC46'>		<span class="k">End</span> <span class="k">If</span></div><div class='line' id='LC47'>	<span class="k">Next</span></div><div class='line' id='LC48'><span class="k">End</span> <span class="k">Function</span></div><div class='line' id='LC49'><br/></div><div class='line' id='LC50'><span class="c">&#39;-------------------------------------------------------------------</span></div><div class='line' id='LC51'><br/></div><div class='line' id='LC52'><span class="k">Function</span> <span class="nf">GetResult</span><span class="p">(</span><span class="n">aNode</span><span class="p">,</span> <span class="n">aMonitor</span><span class="p">,</span> <span class="n">aFields</span><span class="p">)</span></div><div class='line' id='LC53'>	<span class="n">arrValues</span> <span class="o">=</span> <span class="n">Split</span><span class="p">(</span><span class="n">aFields</span><span class="p">,</span> <span class="s">&quot;|&quot;</span><span class="p">)</span></div><div class='line' id='LC54'>	<span class="k">For</span> <span class="k">Each</span> <span class="n">value</span> <span class="ow">In</span> <span class="n">arrValues</span> </div><div class='line' id='LC55'><br/></div><div class='line' id='LC56'>		<span class="c">&#39;Split each value in the API field name and the suffix string </span></div><div class='line' id='LC57'>		<span class="n">arrDetails</span> <span class="o">=</span> <span class="n">Split</span><span class="p">(</span><span class="n">value</span><span class="p">,</span><span class="s">&quot;,&quot;</span><span class="p">)</span></div><div class='line' id='LC58'>		<span class="n">strValue</span> <span class="o">=</span> <span class="n">arrDetails</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span></div><div class='line' id='LC59'>		<span class="n">strSuffix</span> <span class="o">=</span> <span class="n">arrDetails</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span></div><div class='line' id='LC60'><br/></div><div class='line' id='LC61'>		<span class="c">&#39;Retrieve the result for the given counter</span></div><div class='line' id='LC62'>		<span class="k">Set</span> <span class="n">t</span> <span class="o">=</span> <span class="n">aNode</span><span class="p">.</span><span class="n">selectSingleNode</span><span class="p">(</span><span class="n">strValue</span><span class="p">)</span></div><div class='line' id='LC63'>		<span class="k">If</span> <span class="k">Not</span> <span class="n">t</span> <span class="ow">Is</span> <span class="k">Nothing</span> <span class="k">Then</span></div><div class='line' id='LC64'><br/></div><div class='line' id='LC65'>			<span class="c">&#39;Create a new metric object</span></div><div class='line' id='LC66'>			<span class="k">Set</span> <span class="n">Metric</span> <span class="o">=</span> <span class="k">New</span> <span class="n">class_Metric</span></div><div class='line' id='LC67'>			<span class="n">Metric</span><span class="p">.</span><span class="n">Name</span> <span class="o">=</span> <span class="n">strValue</span></div><div class='line' id='LC68'>			<span class="n">Metric</span><span class="p">.</span><span class="n">Result</span> <span class="o">=</span> <span class="n">t</span><span class="p">.</span><span class="n">text</span> <span class="o">&amp;</span> <span class="n">strSuffix</span></div><div class='line' id='LC69'><br/></div><div class='line' id='LC70'>			<span class="c">&#39;Add the metric object to the current monitor object</span></div><div class='line' id='LC71'>		 	<span class="n">aMonitor</span><span class="p">.</span><span class="n">MetricList</span><span class="p">.</span><span class="n">Add</span> <span class="n">Metric</span><span class="p">.</span><span class="n">Name</span><span class="p">,</span> <span class="n">Metric</span></div><div class='line' id='LC72'>		<span class="k">End</span> <span class="k">If</span></div><div class='line' id='LC73'><br/></div><div class='line' id='LC74'>	<span class="k">Next</span></div><div class='line' id='LC75'><span class="k">End</span> <span class="k">Function</span></div><div class='line' id='LC76'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1282593/ee4f5ba90158ae27428ebaf29df6918c856e84bc/getProcessMonitor.vbs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1282593#file_get_process_monitor.vbs" style="float:right;margin-right:10px;color:#666">getProcessMonitor.vbs</a>
            <a href="https://gist.github.com/1282593">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The <em>GetResult </em>function loops through all the result values of a monitor, creates a Metric object for each monitor and adds it to the Monitor object, and finally the function ShowInternalAgents writes all results to the screen.</p>
<div id="gist-1282602" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">Sub</span> <span class="nf">ShowInternalAgentsMonitors</span>	</div><div class='line' id='LC2'>	<span class="c">&#39;Write the list of agents to the screen	</span></div><div class='line' id='LC3'>	<span class="k">For</span> <span class="k">Each</span> <span class="n">agent</span> <span class="ow">In</span> <span class="n">InternalAgents</span><span class="p">.</span><span class="n">Items</span></div><div class='line' id='LC4'>		<span class="n">WScript</span><span class="p">.</span><span class="n">Echo</span> <span class="s">&quot;&quot;</span> </div><div class='line' id='LC5'>		<span class="n">WScript</span><span class="p">.</span><span class="n">Echo</span> <span class="s">&quot;-------------------------------------------------------------------------------&quot;</span></div><div class='line' id='LC6'>		<span class="n">WScript</span><span class="p">.</span><span class="n">Echo</span> <span class="s">&quot; AGENT: &quot;</span> <span class="o">&amp;</span> <span class="n">agent</span><span class="p">.</span><span class="n">Name</span></div><div class='line' id='LC7'>		<span class="n">WScript</span><span class="p">.</span><span class="n">Echo</span> <span class="s">&quot;-------------------------------------------------------------------------------&quot;</span></div><div class='line' id='LC8'><br/></div><div class='line' id='LC9'>		<span class="n">strHeader</span> <span class="o">=</span> <span class="s">&quot;&quot;</span></div><div class='line' id='LC10'>		<span class="n">strRow</span> <span class="o">=</span> <span class="s">&quot;&quot;</span></div><div class='line' id='LC11'><br/></div><div class='line' id='LC12'>		<span class="k">For</span> <span class="k">Each</span> <span class="n">monitor</span> <span class="ow">In</span> <span class="n">agent</span><span class="p">.</span><span class="n">MonitorList</span><span class="p">.</span><span class="n">Items</span></div><div class='line' id='LC13'><br/></div><div class='line' id='LC14'>			<span class="k">For</span> <span class="k">Each</span> <span class="n">objMetric</span> <span class="ow">In</span> <span class="n">Monitor</span><span class="p">.</span><span class="n">MetricList</span><span class="p">.</span><span class="n">Items</span></div><div class='line' id='LC15'>				<span class="n">strHeader</span> <span class="o">=</span> <span class="n">strHeader</span> <span class="o">&amp;</span> <span class="n">format</span><span class="p">(</span><span class="n">objMetric</span><span class="p">.</span><span class="n">Name</span><span class="p">,</span> <span class="n">objMetric</span><span class="p">.</span><span class="n">Width</span><span class="p">)</span></div><div class='line' id='LC16'>				<span class="n">strRow</span> <span class="o">=</span> <span class="n">strRow</span> <span class="o">&amp;</span> <span class="n">format</span><span class="p">(</span><span class="n">objMetric</span><span class="p">.</span><span class="n">Result</span> <span class="o">&amp;</span> <span class="n">objMetric</span><span class="p">.</span><span class="n">Suffix</span><span class="p">,</span> </div><div class='line' id='LC17'>				<span class="n">objMetric</span><span class="p">.</span><span class="n">Width</span><span class="p">)</span></div><div class='line' id='LC18'>			<span class="k">Next</span></div><div class='line' id='LC19'><br/></div><div class='line' id='LC20'>		<span class="k">Next</span></div><div class='line' id='LC21'><br/></div><div class='line' id='LC22'>		<span class="n">WScript</span><span class="p">.</span><span class="n">Echo</span> <span class="n">strHeader</span></div><div class='line' id='LC23'>		<span class="n">WScript</span><span class="p">.</span><span class="n">Echo</span> <span class="n">strRow</span></div><div class='line' id='LC24'>	<span class="k">Next</span></div><div class='line' id='LC25'><span class="k">End</span> <span class="k">Sub</span></div><div class='line' id='LC26'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1282602/aae4a11b3918da4caa8cf72a8fb52c24be811c60/ShowInternalAgentsMonitors.vbs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1282602#file_show_internal_agents_monitors.vbs" style="float:right;margin-right:10px;color:#666">ShowInternalAgentsMonitors.vbs</a>
            <a href="https://gist.github.com/1282602">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The function <em>GetExternalMonitors</em> gathers all the external monitors, the locations, and the monitor results.</p>
<div id="gist-1288393" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">Function</span> <span class="nf">GetExternalMonitors</span><span class="p">(</span><span class="n">aObjHttp</span><span class="p">,</span> <span class="n">aObjAgents</span><span class="p">,</span> <span class="n">aShowMonitors</span><span class="p">)</span></div><div class='line' id='LC2'>	<span class="k">Dim</span> <span class="n">objAgents</span><span class="p">,</span> <span class="n">xmlAgents</span></div><div class='line' id='LC3'>	<span class="k">Set</span> <span class="n">objAgents</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Scripting.Dictionary&quot;</span><span class="p">)</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'>	<span class="c">&#39;Create the dummy Agent object</span></div><div class='line' id='LC6'>	<span class="k">Set</span> <span class="n">Agent</span> <span class="o">=</span> <span class="k">New</span> <span class="n">class_InternalAgent</span></div><div class='line' id='LC7'>	<span class="n">Agent</span><span class="p">.</span><span class="n">Id</span> <span class="o">=</span> <span class="s">&quot;&quot;</span></div><div class='line' id='LC8'>	<span class="n">Agent</span><span class="p">.</span><span class="n">Name</span> <span class="o">=</span> <span class="s">&quot;EXTERNAL&quot;</span></div><div class='line' id='LC9'><br/></div><div class='line' id='LC10'>	<span class="n">WScript</span><span class="p">.</span><span class="n">Echo</span> <span class="s">&quot;Acquiring external monitors...&quot;</span></div><div class='line' id='LC11'><br/></div><div class='line' id='LC12'>	<span class="c">&#39;Retrieve the list of agents</span></div><div class='line' id='LC13'>	<span class="n">url</span> <span class="o">=</span> <span class="s">&quot;http://www.monitis.com/api?apikey=&quot;</span> <span class="o">+</span> <span class="n">apiKey</span> <span class="o">+</span> <span class="s">&quot;&amp;output=xml&amp;version=2&amp;action=tests&quot;</span></div><div class='line' id='LC14'>	<span class="n">aObjHttp</span><span class="p">.</span><span class="n">open</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="k">False</span></div><div class='line' id='LC15'>	<span class="n">aObjHttp</span><span class="p">.</span><span class="n">send</span></div><div class='line' id='LC16'><br/></div><div class='line' id='LC17'>	<span class="c">&#39;Parse response</span></div><div class='line' id='LC18'>	<span class="k">Set</span> <span class="n">xmlMonitors</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Microsoft.XMLDOM&quot;</span><span class="p">)</span></div><div class='line' id='LC19'>	<span class="n">xmlMonitors</span><span class="p">.</span><span class="n">async</span> <span class="o">=</span> <span class="k">False</span></div><div class='line' id='LC20'>	<span class="n">xmlMonitors</span><span class="p">.</span><span class="n">LoadXML</span><span class="p">(</span><span class="n">aObjHttp</span><span class="p">.</span><span class="n">responseText</span><span class="p">)</span></div><div class='line' id='LC21'>	<span class="k">If</span> <span class="n">xmlMonitors</span><span class="p">.</span><span class="n">parseError</span><span class="p">.</span><span class="n">errorCode</span> <span class="o">&lt;&gt;</span> <span class="mi">0</span> <span class="k">Then</span>    </div><div class='line' id='LC22'>		<span class="n">wscript</span><span class="p">.</span><span class="n">Echo</span> <span class="n">xmlMonitors</span><span class="p">.</span><span class="n">parseError</span><span class="p">.</span><span class="n">errorCode</span>    </div><div class='line' id='LC23'>		<span class="n">wscript</span><span class="p">.</span><span class="n">Echo</span> <span class="n">xmlMonitors</span><span class="p">.</span><span class="n">parseError</span><span class="p">.</span><span class="n">reason</span>    </div><div class='line' id='LC24'>		<span class="n">wscript</span><span class="p">.</span><span class="n">Echo</span> <span class="n">xmlMonitors</span><span class="p">.</span><span class="n">parseError</span><span class="p">.</span><span class="n">line</span></div><div class='line' id='LC25'>	<span class="k">End</span> <span class="k">If</span>  	</div><div class='line' id='LC26'><br/></div><div class='line' id='LC27'><br/></div><div class='line' id='LC28'>	<span class="c">&#39;Retrieve the agent information for each agent</span></div><div class='line' id='LC29'>	<span class="k">For</span> <span class="k">Each</span> <span class="n">mon</span> <span class="ow">in</span> <span class="n">xmlMonitors</span><span class="p">.</span><span class="n">documentElement</span><span class="p">.</span><span class="n">childnodes</span></div><div class='line' id='LC30'><br/></div><div class='line' id='LC31'>		<span class="c">&#39;Create a Monitor Object	</span></div><div class='line' id='LC32'>		<span class="k">Set</span> <span class="n">Monitor</span> <span class="o">=</span> <span class="k">New</span> <span class="n">class_Monitor</span></div><div class='line' id='LC33'>		<span class="n">Monitor</span><span class="p">.</span><span class="n">Id</span> <span class="o">=</span> <span class="n">mon</span><span class="p">.</span><span class="n">Attributes</span><span class="p">.</span><span class="n">getNamedItem</span><span class="p">(</span><span class="s">&quot;id&quot;</span><span class="p">).</span><span class="n">text</span></div><div class='line' id='LC34'>		<span class="n">Monitor</span><span class="p">.</span><span class="n">Name</span> <span class="o">=</span> <span class="n">mon</span><span class="p">.</span><span class="n">text</span></div><div class='line' id='LC35'>		<span class="n">Monitor</span><span class="p">.</span><span class="n">DisplayName</span> <span class="o">=</span> <span class="n">mon</span><span class="p">.</span><span class="n">text</span></div><div class='line' id='LC36'><br/></div><div class='line' id='LC37'>		<span class="n">dt</span> <span class="o">=</span> <span class="n">DateSerial</span><span class="p">(</span><span class="n">year</span><span class="p">(</span><span class="n">now</span><span class="p">),</span> <span class="n">month</span><span class="p">(</span><span class="n">now</span><span class="p">),</span> <span class="n">day</span><span class="p">(</span><span class="n">now</span><span class="p">))</span></div><div class='line' id='LC38'>		<span class="n">url</span> <span class="o">=</span> <span class="s">&quot;http://www.monitis.com/api?action=testresult&amp;apikey=&quot;</span> <span class="o">+</span> <span class="n">apiKey</span> <span class="o">+</span> <span class="s">&quot;&amp;output=xml&amp;testId=&quot;</span> <span class="o">&amp;</span> <span class="n">Monitor</span><span class="p">.</span><span class="n">Id</span> <span class="o">+</span> <span class="s">&quot;&amp;timezone=&quot;</span> <span class="o">&amp;</span> <span class="n">timezone</span> <span class="o">&amp;</span> <span class="s">&quot;&amp;day=&quot;</span> <span class="o">&amp;</span> <span class="n">day</span><span class="p">(</span><span class="n">dt</span><span class="p">)</span> <span class="o">&amp;</span> <span class="s">&quot;&amp;month=&quot;</span> <span class="o">&amp;</span> <span class="n">month</span><span class="p">(</span><span class="n">dt</span><span class="p">)</span> <span class="o">&amp;</span> <span class="s">&quot;&amp;year=&quot;</span> <span class="o">&amp;</span> <span class="n">year</span><span class="p">(</span><span class="n">dt</span><span class="p">)</span></div><div class='line' id='LC39'>		<span class="n">aObjHttp</span><span class="p">.</span><span class="n">open</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="k">False</span></div><div class='line' id='LC40'>		<span class="n">aObjHttp</span><span class="p">.</span><span class="n">send</span></div><div class='line' id='LC41'><br/></div><div class='line' id='LC42'>		<span class="k">Set</span> <span class="n">oRes</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">&quot;Microsoft.XMLDOM&quot;</span><span class="p">)</span></div><div class='line' id='LC43'>		<span class="n">oRes</span><span class="p">.</span><span class="n">async</span> <span class="o">=</span> <span class="k">False</span></div><div class='line' id='LC44'>		<span class="n">oRes</span><span class="p">.</span><span class="n">LoadXML</span><span class="p">(</span><span class="n">aObjHttp</span><span class="p">.</span><span class="n">responseText</span><span class="p">)</span></div><div class='line' id='LC45'><br/></div><div class='line' id='LC46'>		<span class="c">&#39;Loop throught the locations</span></div><div class='line' id='LC47'>		<span class="k">For</span> <span class="k">Each</span> <span class="n">t</span> <span class="ow">In</span> <span class="n">oRes</span><span class="p">.</span><span class="n">firstchild</span><span class="p">.</span><span class="n">childnodes</span></div><div class='line' id='LC48'>			<span class="k">If</span> <span class="n">t</span><span class="p">.</span><span class="n">nodeName</span> <span class="o">=</span> <span class="s">&quot;location&quot;</span> <span class="k">Then</span></div><div class='line' id='LC49'><br/></div><div class='line' id='LC50'>				<span class="k">Set</span> <span class="n">Metric</span> <span class="o">=</span> <span class="k">New</span> <span class="n">class_Metric</span></div><div class='line' id='LC51'>				<span class="n">Metric</span><span class="p">.</span><span class="n">Name</span> <span class="o">=</span> <span class="n">t</span><span class="p">.</span><span class="n">Attributes</span><span class="p">.</span><span class="n">GetNamedItem</span><span class="p">(</span><span class="s">&quot;name&quot;</span><span class="p">).</span><span class="n">text</span></div><div class='line' id='LC52'><br/></div><div class='line' id='LC53'>				<span class="c">&#39;Loop through the results for the current location</span></div><div class='line' id='LC54'>				<span class="k">For</span> <span class="k">Each</span> <span class="n">cell</span> <span class="ow">In</span> <span class="n">t</span><span class="p">.</span><span class="n">firstChild</span><span class="p">.</span><span class="n">childnodes</span></div><div class='line' id='LC55'>					<span class="k">If</span> <span class="n">LCase</span><span class="p">(</span><span class="n">cell</span><span class="p">.</span><span class="n">nodename</span><span class="p">)</span> <span class="o">=</span> <span class="s">&quot;cell&quot;</span> <span class="k">Then</span></div><div class='line' id='LC56'>						<span class="n">Metric</span><span class="p">.</span><span class="n">Result</span> <span class="o">=</span> <span class="n">cell</span><span class="p">.</span><span class="n">text</span>	</div><div class='line' id='LC57'>					<span class="k">End</span> <span class="k">If</span></div><div class='line' id='LC58'>				<span class="k">Next</span></div><div class='line' id='LC59'><br/></div><div class='line' id='LC60'>				<span class="c">&#39;Add the Metric object to the Monitor List</span></div><div class='line' id='LC61'>				<span class="n">Monitor</span><span class="p">.</span><span class="n">MetricList</span><span class="p">.</span><span class="n">Add</span> <span class="n">Metric</span><span class="p">.</span><span class="n">Name</span><span class="p">,</span> <span class="n">Metric</span></div><div class='line' id='LC62'>			<span class="k">End</span> <span class="k">If</span></div><div class='line' id='LC63'>		<span class="k">Next</span></div><div class='line' id='LC64'><br/></div><div class='line' id='LC65'>		<span class="c">&#39;Add the agent object to the list of agents</span></div><div class='line' id='LC66'>		<span class="n">Agent</span><span class="p">.</span><span class="n">MonitorList</span><span class="p">.</span><span class="n">Add</span> <span class="n">Monitor</span><span class="p">.</span><span class="n">Id</span><span class="p">,</span> <span class="n">Monitor</span></div><div class='line' id='LC67'>	<span class="k">Next</span></div><div class='line' id='LC68'><br/></div><div class='line' id='LC69'><br/></div><div class='line' id='LC70'>	<span class="n">aObjAgents</span><span class="p">.</span><span class="n">Add</span> <span class="n">Agent</span><span class="p">.</span><span class="n">Id</span><span class="p">,</span> <span class="n">Agent</span></div><div class='line' id='LC71'><span class="k">End</span> <span class="k">Function</span></div><div class='line' id='LC72'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1288393/17daf67efb08d79fbfd48ff0a79e90c7898e11bd/funcExternalMonitors.vbs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1288393#file_func_external_monitors.vbs" style="float:right;margin-right:10px;color:#666">funcExternalMonitors.vbs</a>
            <a href="https://gist.github.com/1288393">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The complete code of this article is available for<a href="https://github.com/monitisexchange/Windows-Monitoring-Scripts/tree/master/vbscript"> download at GitHub.</a></p>
Share Now:<a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F10%2F17%2Fmonitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors%2F&amp;title=Monitis-Top%E2%80%A6%20an%20open-source%20command-line%20interface%20for%20Monitis%20Agents%20and%20Monitors&amp;notes=%C2%A0In%20this%20article%20we%E2%80%99ll%20discuss%20creating%20a%20command%20line%20interface%20to%20query%20the%20Monitis%20Agents%20and%20Monitors%20you%20have%20activated%20for%20your%20systems.%20We%E2%80%99ll%20provide%20the%20source%20code%20for%20the%20utility%20in%20VBScript%20and%20we%20will%20also%20be%20working%20on%20a%20C%23%20version." ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F10%2F17%2Fmonitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors%2F&amp;title=Monitis-Top%E2%80%A6%20an%20open-source%20command-line%20interface%20for%20Monitis%20Agents%20and%20Monitors&amp;bodytext=%C2%A0In%20this%20article%20we%E2%80%99ll%20discuss%20creating%20a%20command%20line%20interface%20to%20query%20the%20Monitis%20Agents%20and%20Monitors%20you%20have%20activated%20for%20your%20systems.%20We%E2%80%99ll%20provide%20the%20source%20code%20for%20the%20utility%20in%20VBScript%20and%20we%20will%20also%20be%20working%20on%20a%20C%23%20version." ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F10%2F17%2Fmonitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors%2F&amp;t=Monitis-Top%E2%80%A6%20an%20open-source%20command-line%20interface%20for%20Monitis%20Agents%20and%20Monitors" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F10%2F17%2Fmonitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors%2F&amp;title=Monitis-Top%E2%80%A6%20an%20open-source%20command-line%20interface%20for%20Monitis%20Agents%20and%20Monitors&amp;source=Uptime+%26amp%3B+Performance+Tips+Tips+for+SysAdmin%2C+Webmaster%2C+Network+Admin&amp;summary=%C2%A0In%20this%20article%20we%E2%80%99ll%20discuss%20creating%20a%20command%20line%20interface%20to%20query%20the%20Monitis%20Agents%20and%20Monitors%20you%20have%20activated%20for%20your%20systems.%20We%E2%80%99ll%20provide%20the%20source%20code%20for%20the%20utility%20in%20VBScript%20and%20we%20will%20also%20be%20working%20on%20a%20C%23%20version." ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow"   href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F10%2F17%2Fmonitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors%2F&amp;Title=Monitis-Top%E2%80%A6%20an%20open-source%20command-line%20interface%20for%20Monitis%20Agents%20and%20Monitors" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/blinklist.png" class="sociable-img sociable-hovers" title="BlinkList" alt="BlinkList" /></a><a rel="nofollow"   href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F10%2F17%2Fmonitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors%2F&amp;title=Monitis-Top%E2%80%A6%20an%20open-source%20command-line%20interface%20for%20Monitis%20Agents%20and%20Monitors" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/dzone.png" class="sociable-img sociable-hovers" title="DZone" alt="DZone" /></a><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F10%2F17%2Fmonitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors%2F&amp;title=Monitis-Top%E2%80%A6%20an%20open-source%20command-line%20interface%20for%20Monitis%20Agents%20and%20Monitors&amp;annotation=%C2%A0In%20this%20article%20we%E2%80%99ll%20discuss%20creating%20a%20command%20line%20interface%20to%20query%20the%20Monitis%20Agents%20and%20Monitors%20you%20have%20activated%20for%20your%20systems.%20We%E2%80%99ll%20provide%20the%20source%20code%20for%20the%20utility%20in%20VBScript%20and%20we%20will%20also%20be%20working%20on%20a%20C%23%20version." ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow"   href="http://reddit.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F10%2F17%2Fmonitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors%2F&amp;title=Monitis-Top%E2%80%A6%20an%20open-source%20command-line%20interface%20for%20Monitis%20Agents%20and%20Monitors" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/reddit.png" class="sociable-img sociable-hovers" title="Reddit" alt="Reddit" /></a><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F10%2F17%2Fmonitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors%2F&amp;title=Monitis-Top%E2%80%A6%20an%20open-source%20command-line%20interface%20for%20Monitis%20Agents%20and%20Monitors" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow"   href="http://twitter.com/home?status=Monitis-Top%E2%80%A6%20an%20open-source%20command-line%20interface%20for%20Monitis%20Agents%20and%20Monitors%20-%20http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F10%2F17%2Fmonitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors%2F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow"   href="http://blog.monitis.com/index.php/feed/" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.monitis.com/index.php/2011/10/17/monitis-top-an-open-source-command-line-interface-for-monitis-agents-and-monitors/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nagios to Monitis converter: Making life easier for sysadmins</title>
		<link>http://blog.monitis.com/index.php/2011/09/13/nagios-to-monitis-converter-making-life-easier-for-sysadmins/</link>
		<comments>http://blog.monitis.com/index.php/2011/09/13/nagios-to-monitis-converter-making-life-easier-for-sysadmins/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 08:29:52 +0000</pubDate>
		<dc:creator>Dan Fruehauf</dc:creator>
				<category><![CDATA[101 Reasons To Choose Monitis]]></category>
		<category><![CDATA[Applications Monitoring]]></category>
		<category><![CDATA[Linux Servers Monitoring]]></category>
		<category><![CDATA[Management Scripts]]></category>
		<category><![CDATA[Monitis API]]></category>
		<category><![CDATA[Monitis vs. Other services]]></category>
		<category><![CDATA[Monitoring Scripts]]></category>
		<category><![CDATA[Network Monitoring]]></category>
		<category><![CDATA[Web Server Monitoring]]></category>
		<category><![CDATA[agent-based monitoring]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[M3]]></category>
		<category><![CDATA[nagios]]></category>

		<guid isPermaLink="false">http://blog.monitis.com/?p=3433</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/09/13/nagios-to-monitis-converter-making-life-easier-for-sysadmins/' addthis:title='Nagios to Monitis converter: Making life easier for sysadmins '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>In the previous article we&#8217;ve shown how easy it is to integrate popular Nagios server monitoring commands, or plugins, with Monitis M3 monitoring framework. However, given the fact you have a working Nagios configuration, which is vast and complex – I can sympathize with your unwillingness to actually migrate to Monitis. Porting each and every systems monitoring [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/09/13/nagios-to-monitis-converter-making-life-easier-for-sysadmins/' addthis:title='Nagios to Monitis converter: Making life easier for sysadmins '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p><a href="http://blog.monitis.com/wp-content/uploads/2011/06/nagiosweb.png"><img class="alignnone size-full wp-image-2520" style="float: right;" title="Nagios Web Site" src="http://blog.monitis.com/wp-content/uploads/2011/06/nagiosweb.png" alt="Nagios Web Site" width="250" /></a>In the <a href="http://blog.monitis.com/index.php/2011/08/21/monitis-m3-nagios-a-very-simple-integration/">previous article</a> we&#8217;ve shown how easy it is to integrate popular Nagios server monitoring commands, or plugins, with <a href="http://blog.monitis.com/index.php/2011/07/21/m3-monitis-monitor-manager/">Monitis M3</a> monitoring framework.</p>
<p>However, given the fact you have a working Nagios configuration, which is vast and complex – I can sympathize with your unwillingness to actually migrate to <a href="http://www.monitis.com">Monitis</a>.<span id="more-3433"></span></p>
<p>Porting each and every systems monitoring command manually to M3 can be a tedious task, but this is why we invented programming, didn&#8217;t we?</p>
<p>In the following short (but useful) article I&#8217;ll outline the design and usage of the “Nagios to M3 converter”.</p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/08/NagiosToM3FlowChart.jpg"><img src="http://blog.monitis.com/wp-content/uploads/2011/08/NagiosToM3FlowChart.jpg" alt="" width="318" height="400" /></a></p>
<h3>The voice of reason</h3>
<p>Why would you want to port your Nagios configuration and have Monitis handle it?<br />
Monitis is not only a hosted service, but it&#8217;ll also let you setup more comprehensive alerts when one of your services is down. This would purely improve your server monitoring in your organization, providing higher availability and less maintenance.</p>
<h3>M3 Universal monitoring framework – a short refresh</h3>
<p><a href="http://blog.monitis.com/index.php/2011/07/21/m3-monitis-monitor-manager/">Monitis Monitor Manager or M3</a>, for those of you who for any awkward reason managed to forget, is a very simple utility that would help you load command output to <a href="http://www.monitis.com">Monitis</a>.</p>
<p>M3 uses an XML file for configuration, whereas for each command you are required to specify the following:</p>
<ol>
<li>The command to invoke</li>
<li>The regular expression that parses your interesting output</li>
</ol>
<p>Pretty simple indeed. In the last article about <a href="http://blog.monitis.com/index.php/2011/07/21/m3-monitis-monitor-manager/">M3</a>, I&#8217;ve provided a link to a <a href="https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/M3/config_nagios.xml">sample M3 configuration</a> for various Nagios commands.</p>
<h3>Nagios to M3 converter</h3>
<p>Also this time your loyal servant has done most of the work for you, implementing as much as possible for you. Yes, it does make the articles slimmer and your job a lot easier.<br />
The code checkout snippet:</p>
<pre style="word-wrap: break-word; white-space: pre-wrap; padding: 15px;"><code> # mkdir -p /usr/share/monitisexchange &amp;&amp; cd /usr/share/monitisexchange # git clone git://github.com/monitisexchange/Monitis-Linux-Scripts.git # cd Monitis-Linux-Scripts/M3 </code></pre>
<h3>Prerequisites</h3>
<p>The converter requires the perl module <a href="http://search.cpan.org/~duncs/Nagios-Object-0.21.15/">Nagios::Object</a>.<br />
The module is used for parsing nagios&#8217; configuration. It can be easily installed via <a href="http://perl.about.com/od/packagesmodules/qt/perlcpan.htm">CPAN</a>, or by downloading the module and installing it manually.<br />
Via CPAN, the command would be:</p>
<pre style="padding-left: 30px; padding-bottom: 1em;"><code> # perl -MCPAN -e 'install Nagios::Object' </code></pre>
<h3>A simple invocation</h3>
<p>OK, it&#8217;s checked out, how is it used? &#8211; easy:</p>
<pre style="word-wrap: break-word; white-space: pre-wrap; padding: 15px;"><code> # cd /usr/share/monitisexchange # ./NagiosToM3Converter.pl /etc/nagios/conf.d/internet.cfg &gt; m3_nagios_config.xml </code></pre>
<p>This will dump to STDOUT a M3 formatted XML with the relevant configuration from your nagios configuration. Essentially it&#8217;ll just port your nagios configuration to a M3 format.<br />
Then we can invoke M3 with the newly created configuration:</p>
<pre style="word-wrap: break-word; white-space: pre-wrap; padding: 15px;"><code> # ./Example.pl m3_nagios_config.xml </code></pre>
<p>Easy as, ain&#8217;t it?</p>
<h3>Design of Nagios to M3 converter</h3>
<p>I believe in reusing code snippets if they exist. As mentioned &#8211; for the implementation of the NagiosToM3Converter I used the perl module Nagios::Object.<br />
Iterating on the various commands and hosts configured in a nagios configuration is very easy. For each command we encounter, we&#8217;ll invoke a callback function.</p>
<p>Throughout the invocation we have a XML context, the one we&#8217;ll dump to STDOUT in the end of the execution.</p>
<p>So in order to configure the &#8220;check_ping&#8221; command, we&#8217;ll call &#8220;_cb_check_ping&#8221;, which would in turn just add the relevant XML elements to our context.</p>
<p>The Nagios to M3 converter is still work in progress. Currently the only commands implemented are check_ping and check_http. However, more commands will be added shortly – and please contribute if you can.<br />
Now that&#8217;s all folks, just use it – it&#8217;s plain easy!</p>
<p>Liked it? Sign up for <a href="http://www.monitis.com">Monitis</a> and try it now! Don’t forget to check also <a href="https://github.com/monitisexchange">monitisexchange</a> – our git-hub open source repository for some more surprises.</p>
Share Now:<a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F09%2F13%2Fnagios-to-monitis-converter-making-life-easier-for-sysadmins%2F&amp;title=Nagios%20to%20Monitis%20converter%3A%20Making%20life%20easier%20for%20sysadmins&amp;notes=In%20the%20previous%20article%20we%27ve%20shown%20how%20easy%20it%20is%20to%20integrate%20popular%20Nagios%20server%20monitoring%20commands%2C%20or%20plugins%2C%20with%20Monitis%20M3%C2%A0monitoring%C2%A0framework.%0D%0A%0D%0AHowever%2C%20given%20the%20fact%20you%20have%20a%20working%20Nagios%20configuration%2C%20which%20is%20vast%20and%20compl" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F09%2F13%2Fnagios-to-monitis-converter-making-life-easier-for-sysadmins%2F&amp;title=Nagios%20to%20Monitis%20converter%3A%20Making%20life%20easier%20for%20sysadmins&amp;bodytext=In%20the%20previous%20article%20we%27ve%20shown%20how%20easy%20it%20is%20to%20integrate%20popular%20Nagios%20server%20monitoring%20commands%2C%20or%20plugins%2C%20with%20Monitis%20M3%C2%A0monitoring%C2%A0framework.%0D%0A%0D%0AHowever%2C%20given%20the%20fact%20you%20have%20a%20working%20Nagios%20configuration%2C%20which%20is%20vast%20and%20compl" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F09%2F13%2Fnagios-to-monitis-converter-making-life-easier-for-sysadmins%2F&amp;t=Nagios%20to%20Monitis%20converter%3A%20Making%20life%20easier%20for%20sysadmins" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F09%2F13%2Fnagios-to-monitis-converter-making-life-easier-for-sysadmins%2F&amp;title=Nagios%20to%20Monitis%20converter%3A%20Making%20life%20easier%20for%20sysadmins&amp;source=Uptime+%26amp%3B+Performance+Tips+Tips+for+SysAdmin%2C+Webmaster%2C+Network+Admin&amp;summary=In%20the%20previous%20article%20we%27ve%20shown%20how%20easy%20it%20is%20to%20integrate%20popular%20Nagios%20server%20monitoring%20commands%2C%20or%20plugins%2C%20with%20Monitis%20M3%C2%A0monitoring%C2%A0framework.%0D%0A%0D%0AHowever%2C%20given%20the%20fact%20you%20have%20a%20working%20Nagios%20configuration%2C%20which%20is%20vast%20and%20compl" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow"   href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F09%2F13%2Fnagios-to-monitis-converter-making-life-easier-for-sysadmins%2F&amp;Title=Nagios%20to%20Monitis%20converter%3A%20Making%20life%20easier%20for%20sysadmins" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/blinklist.png" class="sociable-img sociable-hovers" title="BlinkList" alt="BlinkList" /></a><a rel="nofollow"   href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F09%2F13%2Fnagios-to-monitis-converter-making-life-easier-for-sysadmins%2F&amp;title=Nagios%20to%20Monitis%20converter%3A%20Making%20life%20easier%20for%20sysadmins" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/dzone.png" class="sociable-img sociable-hovers" title="DZone" alt="DZone" /></a><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F09%2F13%2Fnagios-to-monitis-converter-making-life-easier-for-sysadmins%2F&amp;title=Nagios%20to%20Monitis%20converter%3A%20Making%20life%20easier%20for%20sysadmins&amp;annotation=In%20the%20previous%20article%20we%27ve%20shown%20how%20easy%20it%20is%20to%20integrate%20popular%20Nagios%20server%20monitoring%20commands%2C%20or%20plugins%2C%20with%20Monitis%20M3%C2%A0monitoring%C2%A0framework.%0D%0A%0D%0AHowever%2C%20given%20the%20fact%20you%20have%20a%20working%20Nagios%20configuration%2C%20which%20is%20vast%20and%20compl" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow"   href="http://reddit.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F09%2F13%2Fnagios-to-monitis-converter-making-life-easier-for-sysadmins%2F&amp;title=Nagios%20to%20Monitis%20converter%3A%20Making%20life%20easier%20for%20sysadmins" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/reddit.png" class="sociable-img sociable-hovers" title="Reddit" alt="Reddit" /></a><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F09%2F13%2Fnagios-to-monitis-converter-making-life-easier-for-sysadmins%2F&amp;title=Nagios%20to%20Monitis%20converter%3A%20Making%20life%20easier%20for%20sysadmins" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow"   href="http://twitter.com/home?status=Nagios%20to%20Monitis%20converter%3A%20Making%20life%20easier%20for%20sysadmins%20-%20http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F09%2F13%2Fnagios-to-monitis-converter-making-life-easier-for-sysadmins%2F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow"   href="http://blog.monitis.com/index.php/feed/" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.monitis.com/index.php/2011/09/13/nagios-to-monitis-converter-making-life-easier-for-sysadmins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitis (M3) &amp; Nagios &#8211; a very simple integration</title>
		<link>http://blog.monitis.com/index.php/2011/08/21/monitis-m3-nagios-a-very-simple-integration/</link>
		<comments>http://blog.monitis.com/index.php/2011/08/21/monitis-m3-nagios-a-very-simple-integration/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 08:52:23 +0000</pubDate>
		<dc:creator>Dan Fruehauf</dc:creator>
				<category><![CDATA[101 Reasons To Choose Monitis]]></category>
		<category><![CDATA[Linux Servers Monitoring]]></category>
		<category><![CDATA[Monitis API]]></category>
		<category><![CDATA[Monitis vs. Other services]]></category>
		<category><![CDATA[Monitoring Scripts]]></category>
		<category><![CDATA[Network Monitoring]]></category>
		<category><![CDATA[Web Server Monitoring]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[M3]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nagios plugins]]></category>

		<guid isPermaLink="false">http://blog.monitis.com/?p=3250</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/08/21/monitis-m3-nagios-a-very-simple-integration/' addthis:title='Monitis (M3) &#38; Nagios &#8211; a very simple integration '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Nagios, a systems monitoring software What&#8217;s Nagios? &#8211; Nagios is a rather simplistic monitoring software. And I like simple things. Nagios&#8217; responsibility is not necessarily to draw nice graphs for your boss or collect data you may or may not need. Nagios simply decides whether your system runs properly. And for this question there is [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/08/21/monitis-m3-nagios-a-very-simple-integration/' addthis:title='Monitis (M3) &amp; Nagios &#8211; a very simple integration '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p><img style="margin: 10px; float: right;" title="Nagios Web Site" src="http://blog.monitis.com/wp-content/uploads/2011/06/nagiosweb.png" alt="Nagios Web Site" width="35%" /></p>
<h3>Nagios, a systems monitoring software</h3>
<p>What&#8217;s N<a href="http://www.nagios.org/">agios</a>? &#8211; Nagios is a rather simplistic monitoring software. And I like simple things. Nagios&#8217; responsibility is not necessarily to draw nice graphs for your boss or collect data you may or may not need.</p>
<p>Nagios simply decides whether your system runs properly. And for this question there is a very explicit answer – a YES or a NO. Nagios will alert you if the answer is a NO.</p>
<p>In the following article I&#8217;m going to show how easy it is to integrate Nagios with Monitis.<span id="more-3250"></span></p>
<h3>M3 &#8211; a Universal monitoring framework for Monitis custom scripts</h3>
<p>M3 (Monitis Monitor Manager) design and usage examples were outlined in this <a href="../index.php/2011/07/21/m3-monitis-monitor-manager/">previous article</a> &#8211; which I suggest reading before proceeding with this one.</p>
<p>I had a claim in the previous article that M3 is fairly versatile and not much longer after comitting M3 came the challenge – integrate M3 with N<a href="http://www.nagios.org/">agios</a>.</p>
<h3>OK, why hosted monitoring?</h3>
<p>Yes, it&#8217;s a good question, if Nagios gives you the nice functionality, then why export this data to <a href="http://www.monitis.com/">Monitis</a> and start all over again?</p>
<p>Honestly, <a href="http://www.monitis.com/">Monitis</a>&#8216; hosted monitoring will give you much more than Nagios. In addition to the invaluable alerts, it&#8217;ll give your enterprise a much more comprehensive and centralized monitoring solution than Nagios.</p>
<p>Let me please ask you one simple quest -what&#8217;s monitoring your nagios server? &#8211; I&#8217;m sorry to hear it is a single point of failure. Please consider <a href="http://www.monitis.com/">Monitis</a> then.</p>
<p>Not only that by using cloud-based monitoring you can (and should) eliminate the need for another dedicated monitoring server in your business, Monitis, being a hosted service rather than a piece of software is much more tolerant to network or server failures. The headache of taking care for a rock solid monitoring solution is ours &#8211; we&#8217;ll do it for you &#8211; and we love it.</p>
<h3>Slight code changes to M3 framework</h3>
<p>M3 was designed to collect data counters from various applications using <a href="http://en.wikipedia.org/wiki/Regular_expression">regular expressions</a> and parse the desired data.</p>
<p>However, with Nagios, it is less about collecting “89MB” or “29 r/s”. With Nagios it&#8217;s more about deciding whether the desired check is OK or not.<span class="Apple-style-span" style="font-family: monospace; font-size: 12px; line-height: 18px; white-space: pre;"> 2.0</span></p>
<p>For example, lets have a look at the infamous <em>check_ssh</em> plugins. It&#8217;ll simply check if SSH is reachable on a host – usually used to make sure a host is alive. Upon success we&#8217;ll have:</p>
<pre style="padding-left: 30px; padding-bottom: 1em;"><code> SSH OK - OpenSSH_5.6 (protocol) </code></pre>
<p>And on failure:</p>
<pre style="padding-left: 30px; padding-bottom: 1em;"><code> Connection refused </code></pre>
<p>Or:</p>
<pre style="padding-left: 30px; padding-bottom: 1em;"><code> CRITICAL - Socket timeout after 10 seconds </code></pre>
<p>From our point of view, only if we had “SSH OK” then the test succeeded, upon any other case we consider the test as a failure.</p>
<p>In Monitis API we can define a boolean variable for checks. M3 reflects Monitis API, thus, if we&#8217;ll define a boolean check in M3 we&#8217;ll get a slightly different behavior than any other check (integer, string or float) – and this was the only code change required. In the next example we&#8217;ll delve into it.</p>
<h3>Quick start</h3>
<p>In the <a href="../index.php/2011/07/21/m3-monitis-monitor-manager/">previous article about M3</a> I outlined how to use M3. This time the only change is that you have to use the <a href="https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/M3/config_nagios.xml">config_nagios.xml</a> sample file instead. I suggest having a look at <a href="https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/M3/config_nagios.xml">config_nagios.xml</a> as it might just be self-explanatory for many people.</p>
<h3>First Nagios plugin: check_ssh</h3>
<p>We&#8217;ve already shown what values <em>check_ssh</em> might return. Here comes an XML configuration snippet for M3 if you want to integrate <em>check_ssh</em>:</p>
<pre>&lt;monitor name="Nagios check_ssh"&gt;
	&lt;exectemplate&gt;/usr/lib/nagios/plugins/check_ssh monkey
	&lt;/exectemplate&gt;
	&lt;metric name="SSH check"&gt;
		&lt;type&gt;boolean&lt;/type&gt;
		&lt;uom&gt;SSH Connectivity&lt;/uom&gt;
		&lt;regex&gt;^SSH OK&lt;/regex&gt;
	&lt;/metric&gt;
&lt;/monitor&gt;</pre>
<pre><span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;">What happens here is very simple. M3 will execute “/usr/lib/nagios/plugins/check_ssh monkey” and if the string returned contains “SSH OK”, we'll simply report this check to Monitis as a success. If there's no “SSH OK” in the string we'll declare it as a failure.</span></pre>
<p>Simple, isn&#8217;t it?</p>
<h3>Second Nagios plugin: check_load</h3>
<p>In a <a href="../index.php/2011/06/28/create-nagios-plugin-monitor-on-monitis-com/">previous article</a> the integration of Nagios and Monitis was outlined, integrating the <em>check_load</em> plugin. M3 can do it just as well. The configuration for the <em>check_load</em> plugin would produce 3 counters that we will parse them all and send their data to Monitis: <span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;">There is nothing special about this example, it&#8217;s a simple M3 capability.</span></p>
<pre>&lt;monitor name="Nagios check_load"&gt;
	&lt;exectemplate&gt;/usr/lib/nagios/plugins/check_load -w 0,0,0 -c 0,0,0
	&lt;/exectemplate&gt;
	&lt;metric name="Load1"&gt;
		&lt;type&gt;integer&lt;/type&gt;
		&lt;uom&gt;Processes in queue&lt;/uom&gt;
		&lt;regex&gt;load1=([0-9.]+);&lt;/regex&gt;
	&lt;/metric&gt;
	&lt;metric name="Load5"&gt;
		&lt;type&gt;integer&lt;/type&gt;
		&lt;uom&gt;Processes in queue&lt;/uom&gt;
		&lt;regex&gt;load5=([0-9.]+);&lt;/regex&gt; &lt;/metric&gt;
	&lt;metric name="Load15"&gt; &lt;type&gt;integer&lt;/type&gt;
		&lt;uom&gt;Processes in queue&lt;/uom&gt;
		&lt;regex&gt;load15=([0-9.]+);&lt;/regex&gt;
	&lt;/metric&gt;
&lt;/monitor&gt;</pre>
<p>However, it is recommended later to set your limits in Monitis and decide when and how to receive alerts. Setting your limits and alerts are described in <a href="../index.php/2011/06/28/create-nagios-plugin-monitor-on-monitis-com/">this article</a>.</p>
<h3>More Nagios plugin examples</h3>
<p>config_nagios.xml provide some more examples for integrating nagios plugins with Monitis, among them are <em>check_mysql</em>, <em>check_procs</em>, <em>check_users</em> and some others.<br />
There&#8217;s no real need in my opinion to delve into them as they merely represent some more regular expressions that&#8217;ll parse some different output.</p>
<p><a href="http://portal.monitis.com/?utm_source=blog&amp;utm_medium=banner&amp;utm_campaign=m3_nag"><img class="alignnone size-full wp-image-2647" title="Monitis Systems Monitoring Platform" src="http://blog.monitis.com/wp-content/uploads/2011/07/Banner-468-x-60.jpg" alt="Monitis Systems Monitoring Platform" width="468" height="60" /></a></p>
<p>Liked it? Sign up for <a href="http://www.monitis.com/">Monitis</a> and try it now! Don’t forget to check (and follow) also <a href="https://github.com/monitisexchange">monitis exchange</a> &#8211; our <a href="https://github.com/">github</a> open source repository for some more surprises.</p>
Share Now:<a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F08%2F21%2Fmonitis-m3-nagios-a-very-simple-integration%2F&amp;title=Monitis%20%28M3%29%20%26%20Nagios%20-%20a%20very%20simple%20integration&amp;notes=%0D%0ANagios%2C%20a%20systems%20monitoring%20software%0D%0AWhat%27s%20Nagios%3F%20-%20Nagios%20is%20a%20rather%20simplistic%20monitoring%20software.%20And%20I%20like%20simple%20things.%20Nagios%27%20responsibility%20is%20not%20necessarily%20to%20draw%20nice%20graphs%20for%20your%20boss%20or%20collect%20data%20you%20may%20or%20may%20not%20need" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F08%2F21%2Fmonitis-m3-nagios-a-very-simple-integration%2F&amp;title=Monitis%20%28M3%29%20%26%20Nagios%20-%20a%20very%20simple%20integration&amp;bodytext=%0D%0ANagios%2C%20a%20systems%20monitoring%20software%0D%0AWhat%27s%20Nagios%3F%20-%20Nagios%20is%20a%20rather%20simplistic%20monitoring%20software.%20And%20I%20like%20simple%20things.%20Nagios%27%20responsibility%20is%20not%20necessarily%20to%20draw%20nice%20graphs%20for%20your%20boss%20or%20collect%20data%20you%20may%20or%20may%20not%20need" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F08%2F21%2Fmonitis-m3-nagios-a-very-simple-integration%2F&amp;t=Monitis%20%28M3%29%20%26%20Nagios%20-%20a%20very%20simple%20integration" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F08%2F21%2Fmonitis-m3-nagios-a-very-simple-integration%2F&amp;title=Monitis%20%28M3%29%20%26%20Nagios%20-%20a%20very%20simple%20integration&amp;source=Uptime+%26amp%3B+Performance+Tips+Tips+for+SysAdmin%2C+Webmaster%2C+Network+Admin&amp;summary=%0D%0ANagios%2C%20a%20systems%20monitoring%20software%0D%0AWhat%27s%20Nagios%3F%20-%20Nagios%20is%20a%20rather%20simplistic%20monitoring%20software.%20And%20I%20like%20simple%20things.%20Nagios%27%20responsibility%20is%20not%20necessarily%20to%20draw%20nice%20graphs%20for%20your%20boss%20or%20collect%20data%20you%20may%20or%20may%20not%20need" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow"   href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F08%2F21%2Fmonitis-m3-nagios-a-very-simple-integration%2F&amp;Title=Monitis%20%28M3%29%20%26%20Nagios%20-%20a%20very%20simple%20integration" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/blinklist.png" class="sociable-img sociable-hovers" title="BlinkList" alt="BlinkList" /></a><a rel="nofollow"   href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F08%2F21%2Fmonitis-m3-nagios-a-very-simple-integration%2F&amp;title=Monitis%20%28M3%29%20%26%20Nagios%20-%20a%20very%20simple%20integration" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/dzone.png" class="sociable-img sociable-hovers" title="DZone" alt="DZone" /></a><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F08%2F21%2Fmonitis-m3-nagios-a-very-simple-integration%2F&amp;title=Monitis%20%28M3%29%20%26%20Nagios%20-%20a%20very%20simple%20integration&amp;annotation=%0D%0ANagios%2C%20a%20systems%20monitoring%20software%0D%0AWhat%27s%20Nagios%3F%20-%20Nagios%20is%20a%20rather%20simplistic%20monitoring%20software.%20And%20I%20like%20simple%20things.%20Nagios%27%20responsibility%20is%20not%20necessarily%20to%20draw%20nice%20graphs%20for%20your%20boss%20or%20collect%20data%20you%20may%20or%20may%20not%20need" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow"   href="http://reddit.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F08%2F21%2Fmonitis-m3-nagios-a-very-simple-integration%2F&amp;title=Monitis%20%28M3%29%20%26%20Nagios%20-%20a%20very%20simple%20integration" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/reddit.png" class="sociable-img sociable-hovers" title="Reddit" alt="Reddit" /></a><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F08%2F21%2Fmonitis-m3-nagios-a-very-simple-integration%2F&amp;title=Monitis%20%28M3%29%20%26%20Nagios%20-%20a%20very%20simple%20integration" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow"   href="http://twitter.com/home?status=Monitis%20%28M3%29%20%26%20Nagios%20-%20a%20very%20simple%20integration%20-%20http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F08%2F21%2Fmonitis-m3-nagios-a-very-simple-integration%2F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow"   href="http://blog.monitis.com/index.php/feed/" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.monitis.com/index.php/2011/08/21/monitis-m3-nagios-a-very-simple-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Too busy to go premium? Our New Upgrade Wizard will do it for you</title>
		<link>http://blog.monitis.com/index.php/2011/07/19/too-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you/</link>
		<comments>http://blog.monitis.com/index.php/2011/07/19/too-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 10:21:41 +0000</pubDate>
		<dc:creator>Seb Kiureghian</dc:creator>
				<category><![CDATA[101 Reasons To Choose Monitis]]></category>
		<category><![CDATA[Monitis vs. Other services]]></category>
		<category><![CDATA[Network Monitoring]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Server Management]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[Uptime Monitoring]]></category>
		<category><![CDATA[Website Monitoring]]></category>
		<category><![CDATA[external monitoring]]></category>
		<category><![CDATA[free site monitoring]]></category>
		<category><![CDATA[free website monitoring]]></category>
		<category><![CDATA[mon.itor.us]]></category>
		<category><![CDATA[monitor.us]]></category>
		<category><![CDATA[monitorus]]></category>
		<category><![CDATA[systems administration]]></category>
		<category><![CDATA[uptime]]></category>
		<category><![CDATA[uptime monitoring]]></category>

		<guid isPermaLink="false">http://blog.monitis.com/?p=3007</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/07/19/too-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you/' addthis:title='Too busy to go premium? Our New Upgrade Wizard will do it for you '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Mon.itor.us is our 100% free website and server monitoring service. It is unique among similar services in that it imposes no cap on the number of URL&#8217;s monitored. As a result, we have some users monitoring hundreds, even thousands of URL&#8217;s from one account, for free, forever. That&#8217;s great, but what if you want to [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/07/19/too-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you/' addthis:title='Too busy to go premium? Our New Upgrade Wizard will do it for you '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p><img class="alignnone" style="float: right; padding: 10px;" title="free website monitoring" src="http://blog.mon.itor.us/wp-content/uploads/2011/03/Monitorus-50.png" alt="" width="250" /><a href="http://Mon.itor.us">Mon.itor.us</a> is our 100% free website and server monitoring service. It is unique among similar services in that it imposes no cap on the number of URL&#8217;s monitored. As a result, we have some users monitoring hundreds, even thousands of URL&#8217;s from one account, for free, forever. That&#8217;s great, but what if you want to upgrade to our premium service, <a href="http://portal.monitis.com">Monitis</a>? Until now, you had to set everything up from scratch, but we&#8217;ve decided to make it extremely easy with a new Upgrade Wizard. It walks you through easy steps that allow you to select the monitors you&#8217;d like to keep and/or add in your upgraded account.<span id="more-3007"></span></p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/07/6DnRX.png"><img class="size-full wp-image-3037" title="Monitis Upgrade Wizard" src="http://blog.monitis.com/wp-content/uploads/2011/07/6DnRX.png" alt="" width="453" height="284" /></a></p>
<p>The first step lets you select the <a href="http://portal.monitis.com/index.php/external-monitor">external monitors</a> you&#8217;d like to keep and specify how many additional ones you&#8217;ll need and their frequency. The monthly and annual price is reflected at the bottom of each step. The next 2 steps allow you to add <a href="http://portal.monitis.com/index.php/full-page-test">fullpage</a>, <a href="http://portal.monitis.com/index.php/transactions-monitoring">transaction</a>, <a href="http://portal.monitis.com/index.php/internal-monitorserver-health">internal</a> and <a href="http://portal.monitis.com/index.php/cloud-monitoring">cloud</a> monitors to your account. The last step lets you select <a href="http://portal.monitis.com/index.php/products/open-ai">API</a> access, specify your <a href="http://portal.monitis.com/index.php/products/notifications">SMS alert</a> needs and select a payment method and Bam, proceed to checkout.</p>
<p>The Wizard has been active for a day and we&#8217;ve received great feedback so far. I think the step-by-step approach is a huge improvement in User Experience over the previous Upgrade form, which showed a bunch of stuff in one window. If you have upgraded from Mon.itor.us to Monitis and have any thoughts on our upgrade process please comment.</p>
Share Now:<a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F07%2F19%2Ftoo-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you%2F&amp;title=Too%20busy%20to%20go%20premium%3F%20Our%20New%20Upgrade%20Wizard%20will%20do%20it%20for%20you%20&amp;notes=Mon.itor.us%20is%20our%20100%25%20free%20website%20and%20server%20monitoring%20service.%20It%20is%20unique%20among%20similar%20services%20in%20that%20it%20imposes%20no%20cap%20on%20the%20number%20of%20URL%27s%20monitored.%20As%20a%20result%2C%20we%20have%20some%20users%20monitoring%20hundreds%2C%20even%20thousands%20of%20URL%27s%20from%20one%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F07%2F19%2Ftoo-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you%2F&amp;title=Too%20busy%20to%20go%20premium%3F%20Our%20New%20Upgrade%20Wizard%20will%20do%20it%20for%20you%20&amp;bodytext=Mon.itor.us%20is%20our%20100%25%20free%20website%20and%20server%20monitoring%20service.%20It%20is%20unique%20among%20similar%20services%20in%20that%20it%20imposes%20no%20cap%20on%20the%20number%20of%20URL%27s%20monitored.%20As%20a%20result%2C%20we%20have%20some%20users%20monitoring%20hundreds%2C%20even%20thousands%20of%20URL%27s%20from%20one%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F07%2F19%2Ftoo-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you%2F&amp;t=Too%20busy%20to%20go%20premium%3F%20Our%20New%20Upgrade%20Wizard%20will%20do%20it%20for%20you%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F07%2F19%2Ftoo-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you%2F&amp;title=Too%20busy%20to%20go%20premium%3F%20Our%20New%20Upgrade%20Wizard%20will%20do%20it%20for%20you%20&amp;source=Uptime+%26amp%3B+Performance+Tips+Tips+for+SysAdmin%2C+Webmaster%2C+Network+Admin&amp;summary=Mon.itor.us%20is%20our%20100%25%20free%20website%20and%20server%20monitoring%20service.%20It%20is%20unique%20among%20similar%20services%20in%20that%20it%20imposes%20no%20cap%20on%20the%20number%20of%20URL%27s%20monitored.%20As%20a%20result%2C%20we%20have%20some%20users%20monitoring%20hundreds%2C%20even%20thousands%20of%20URL%27s%20from%20one%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow"   href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F07%2F19%2Ftoo-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you%2F&amp;Title=Too%20busy%20to%20go%20premium%3F%20Our%20New%20Upgrade%20Wizard%20will%20do%20it%20for%20you%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/blinklist.png" class="sociable-img sociable-hovers" title="BlinkList" alt="BlinkList" /></a><a rel="nofollow"   href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F07%2F19%2Ftoo-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you%2F&amp;title=Too%20busy%20to%20go%20premium%3F%20Our%20New%20Upgrade%20Wizard%20will%20do%20it%20for%20you%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/dzone.png" class="sociable-img sociable-hovers" title="DZone" alt="DZone" /></a><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F07%2F19%2Ftoo-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you%2F&amp;title=Too%20busy%20to%20go%20premium%3F%20Our%20New%20Upgrade%20Wizard%20will%20do%20it%20for%20you%20&amp;annotation=Mon.itor.us%20is%20our%20100%25%20free%20website%20and%20server%20monitoring%20service.%20It%20is%20unique%20among%20similar%20services%20in%20that%20it%20imposes%20no%20cap%20on%20the%20number%20of%20URL%27s%20monitored.%20As%20a%20result%2C%20we%20have%20some%20users%20monitoring%20hundreds%2C%20even%20thousands%20of%20URL%27s%20from%20one%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow"   href="http://reddit.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F07%2F19%2Ftoo-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you%2F&amp;title=Too%20busy%20to%20go%20premium%3F%20Our%20New%20Upgrade%20Wizard%20will%20do%20it%20for%20you%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/reddit.png" class="sociable-img sociable-hovers" title="Reddit" alt="Reddit" /></a><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F07%2F19%2Ftoo-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you%2F&amp;title=Too%20busy%20to%20go%20premium%3F%20Our%20New%20Upgrade%20Wizard%20will%20do%20it%20for%20you%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow"   href="http://twitter.com/home?status=Too%20busy%20to%20go%20premium%3F%20Our%20New%20Upgrade%20Wizard%20will%20do%20it%20for%20you%20%20-%20http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F07%2F19%2Ftoo-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you%2F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow"   href="http://blog.monitis.com/index.php/feed/" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.monitis.com/index.php/2011/07/19/too-busy-to-go-premium-our-new-upgrade-wizard-will-do-it-for-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Nagios Plugin Monitor on Monitis.com</title>
		<link>http://blog.monitis.com/index.php/2011/06/28/create-nagios-plugin-monitor-on-monitis-com/</link>
		<comments>http://blog.monitis.com/index.php/2011/06/28/create-nagios-plugin-monitor-on-monitis-com/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 10:09:08 +0000</pubDate>
		<dc:creator>Hovhannes Avoyan</dc:creator>
				<category><![CDATA[Linux Servers Monitoring]]></category>
		<category><![CDATA[Monitis vs. Other services]]></category>
		<category><![CDATA[Monitoring Scripts]]></category>
		<category><![CDATA[Network Monitoring]]></category>
		<category><![CDATA[Performance Management]]></category>
		<category><![CDATA[Server Management]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[nagios]]></category>

		<guid isPermaLink="false">http://blog.monitis.com/?p=2516</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/28/create-nagios-plugin-monitor-on-monitis-com/' addthis:title='Create Nagios Plugin Monitor on Monitis.com '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Nagios is a widely used monitoring software for systems and networks. It provides the flexibility to monitor anything on your systems or networks using a script or plugin.  Known for having plugins and scripts available to monitor your needs, Nagios’ the interface and user friendliness leaves much to be desired.  Plus you have to maintain [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/28/create-nagios-plugin-monitor-on-monitis-com/' addthis:title='Create Nagios Plugin Monitor on Monitis.com '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p><img class="alignright" style="margin: 10px;" title="Nagios Web Site" src="http://blog.monitis.com/wp-content/uploads/2011/06/nagiosweb.png" alt="Nagios Web Site" width="35%" />Nagios is a widely used <a title="Nagios" href="http://nagios.org" target="_blank">monitoring <strong>software</strong> for systems and networks.</a> It provides the flexibility to monitor anything on your systems or networks using a script or plugin.  Known for having plugins and scripts available to monitor your needs, Nagios’ the interface and user friendliness leaves much to be desired.  Plus you have to maintain and monitor another server to store and analyze the data provided through your Nagios plugins and scripts.  And worst of all, if your Nagios server or network fail &#8211; you may not get an alert at all when you need them the most.</p>
<p>A hosted system monitor gathering your stats is a good way to ensure that alerts get to you, and having it have nice tools and interfaces is definitely a bonus.  Monitis is <a title="hosted systems and network monitoring" href="http://portal.monitis.com" target="_blank">a <strong>hosted</strong> systems and networks monitoring solution </a>that offers a simple user interface, with powerful tools, and a distributed network to prevent any service failures  blocking your alerts.  It will free up your sysadmins from monitoring their monitoring servers, and will allow them to focus on the issues rather than looking for the issues.<span id="more-2516"></span></p>
<p>But suppose you already rely on Nagios scripts and plugins.  There is a simple way to utilize these already known and popular plugins and scripts with a simple wrapper script loading data to your Monitis account.</p>
<p>Monitis provides you with the ability to measure any metric you want through the Custom Monitor.  I will demonstrate by creating a Custom Monitor that accepts data from the Load plugin of Nagios. The Load plugin for Nagios monitors the average load in 1 minute, 5 minute, and 15 minute increments and will alert on user-defined Warning and Critical levels for each of the 3 average load increments.</p>
<h2 dir="ltr">Create Monitis Custom Monitors</h2>
<p>The first thing you need when sending data to Monitis is a <a title="Monitis Custom Monitor API" href="http://monitis.com/api/api.html#addCustomMonitor" target="_blank">Custom Monitor</a>.  The Custom Monitor is where you will store your information for analysis or alerting purposes.  In order to quickly setup the Custom Monitor download this script: <a href="https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/API/monitis_create_monitor.sh">https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/API/monitis_create_monitor.sh</a>.</p>
<p>To use the above script, you will need your API Key and Secret Key available from your Monitis Account page.   If you do not have a Monitis Account, you can get a <a title="Monitis Free Trial" href="https://www.monitis.com/free_signup.jsp" target="_blank">free trial by going here</a>.</p>
<p>Now we are set to create our Custom Monitor where we can load data from the Load plugin for Nagios.  The Load plugin for Nagios monitors 3 results plus has a state value (OK, WARNING or CRITICAL).  So the Custom Monitor that we need to create will monitor these same values, plus use a numeric state value for graphing.  You can run the check_load plugin without the use of nagios to see its default values and expected parameters.</p>
<p>The -w sets the warning level of the avg load and the -c sets the critical level.  You have three options for 1, 5, 15 minute intervals.  So run the plugin with some values in -w and -c.  In the output, you should notice that it gives you State, the load averages results, and then after the | is the performance data.  Performance data is not present for every plugin.</p>
<p>We want to capture the load averages and state for our Custom Monitor.  So we need to setup a Custom Monitor that has 5 columns – load1, load5, load15, state, and state_val.  State_val is used for graphing the different states of OK, WARNING, or CRITICAL.  Here is how to run monitis_create_monitor.sh:</p>
<pre style="word-wrap: break-word; white-space: pre-wrap;"><code>
$ ./monitis_create_monitor.sh -n "Load Monitor" -m loadMonitor -r "state:State:state:3;state_val:State Value:state:2;load1:Load 1 Min:load:2;load5:Load 5 Min:load:2;load15:Load 15 Min:load:2" -a API_KEY -s SECRET_KEY</code></pre>
<p>&nbsp;</p>
<p>The -n is the Name of the Custom Monitor, -m is the Tag of the Custom Monitor, -r is the ResultParams of the Custom Monitor, -a is your API Key, and -s is the Secret Key.  Definitions for the ResultParams and other necessary Custom Monitor API requests, are available here: <a href="http://www.monitis.com/api/api.html#addCustomMonitor">http://www.monitis.com/api/api.html#addCustomMonitor</a></p>
<p>Now you should be able to log into your Monitis account and go to Monitors -&gt; Manage Monitors -&gt; Custom Monitors and add your newly created monitor.</p>
<p>In front of you is your customizable systems monitoring Dashboard.  You are able to place the monitors that are most important to you right in front of your face, not amongst a list of never-ending checks and monitors.  You can have graphs and status checks mixed on the same Dashboard.  The interface is intuitive and has many possibilities for server and network health analysis.</p>
<h2 dir="ltr">Create Nagios Wrapper Script to Send Data to Monitis</h2>
<p>Since a Custom Monitor without any data is not all that interesting, we want to populate it with some data, from the Nagios plugin.  The simplest way is to wrap the plugin script with a custom wrapper script.  Here is an example for the check_load plugin: <a href="https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/nagios/monitis_nagios_load_wrapper.sh">https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/nagios/monitis_nagios_load_wrapper.sh</a></p>
<p>This script relies on the script found here to upload data to your Custom Monitor: <a href="https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/API/monitis_add_data.sh">https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/API/monitis_add_data.sh</a></p>
<p>Using these two scripts, you are able to quickly upload data to your Custom Monitor.</p>
<p>Basically this script runs the plugin then parses through the data and sends the results off to your Custom Monitor.  We are now able to call this script from the command-line and send output to Monitis Custom Monitor.  Here is an example:</p>
<pre style="word-wrap: break-word; white-space: pre-wrap;"><code>
$ ./monitis_nagios_load_wrapper.sh -w 5,3,3 -c10,5,4
OK - load average: 0.88, 0.74, 0.65|load1=0.880;5.000;10.000;0; load5=0.740;3.000;5.000;0; load15=0.650;3.000;4.000;0;</code></pre>
<p>&nbsp;</p>
<p>As you notice, it outputs the same value as the original check_load plugin.   We are now able to utilize this script to run without Nagios and send data to the Custom Monitor we created.  This frees up the Nagios server we used to have for other services, such as that overloaded webserver, that you have been meaning to scale up for load balancing.</p>
<p>For checking load on a regular basis, we could set the wrapper up in a cronjob.  Since we are also outputting the original output of the check_load plugin, we are able to place this script directly into Nagios and replace the check_load plugin.  This would allow you to utilize both your internal monitoring server and your Monitis account during the transition from Nagios to Monitis, or as a second layer of monitoring.</p>
<p>Once you create your cron or restart Nagios, it will start sending data to your Custom Monitor.<br />
<a href="http://blog.monitis.com/wp-content/uploads/2011/06/Nagios_Widget.png"><img class="alignnone size-full wp-image-2517" title="Nagios_Widget" src="http://blog.monitis.com/wp-content/uploads/2011/06/Nagios_Widget.png" alt="Nagios Widget in Monitis" width="80%" /></a></p>
<p>Here is a sample output from a graph of the Custom Monitor we created.  I put a nice load on the end there by doing a large bzip2 process, while copying files to a different filesystem.  Much nicer than any graph displayed in Nagios.</p>
<h2 dir="ltr">Setting Up Alerts from Monitis:</h2>
<p>OK, we have the data graphing, we all think the interface is beautiful, but we need to setup alerts.  Relying on Nagios to alert you is not always the most comforting solution, if the alert is due to network failure or if the Nagios server is not functioning properly, the alert will never get to you.</p>
<p>Monitis has a distributed framework, which means a single failure on a monitoring server will not prevent you from receiving your alert.  You get to leverage the benefits of this network for alerting from within your Custom Monitor.  In the Dashboard, from your Custom Monitor we can go to Notification rules and setup a new notification:<br />
<a href="http://blog.monitis.com/wp-content/uploads/2011/06/NagiosAlerts.png"><img class="alignnone size-full wp-image-2518" title="NagiosAlerts" src="http://blog.monitis.com/wp-content/uploads/2011/06/NagiosAlerts.png" alt="Set Nagios Alert" width="80%" /></a></p>
<p>Here you can setup alerts based on the numeric values we captured in the wrapper script.  So we can have an alert on Load 1 Min &gt; 10 or Load 5 Mins &gt; 8.  We can also setup an alert if the load is too low, i.e. you are not receiving requests on your web server that always runs at &gt;1 in the 1 min average.</p>
<p>That’s it, you now have hosted monitoring utilizing the plugins you already know and trust, but with the added benefit of an easy to use interface, and a distributed network ensuring alert delivery.<br />
Monitis:</p>
<p>The Monitis account is flexible, allowing for integration with many other systems.</p>
<p>Utilizing Nagios plugins and scripts is just one way to monitor your servers.  It has many other tools and monitoring agents available.  But most of all the easy to use interface allows system administrators to focus on using their tools rather than learning their tools.  The distributed network that Monitis has built up around the tool, ensures that your alerts will get to you when you need them.  Get started utilizing Monitis: <a href="https://www.monitis.com/free_signup.jsp">https://www.monitis.com/free_signup.jsp</a>.</p>
<p>External Scripts:<br />
<a href="https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/API/monitis_create_monitor.sh">https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/API/monitis_create_monitor.sh</a><br />
<a href="https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/API/monitis_add_data.sh">https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/API/monitis_add_data.sh</a><br />
<a href="https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/nagios/monitis_nagios_load_wrapper.sh">https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/nagios/monitis_nagios_load_wrapper.sh</a></p>
<p>External Links for further information:<br />
<a href="http://monitis.com/api/api.html#addCustomMonitor">http://monitis.com/api/api.html#addCustomMonitor</a><br />
<a href="https://www.monitis.com/free_signup.jsp">https://www.monitis.com/free_signup.jsp</a></p>
Share Now:<a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F28%2Fcreate-nagios-plugin-monitor-on-monitis-com%2F&amp;title=Create%20Nagios%20Plugin%20Monitor%20on%20Monitis.com&amp;notes=Nagios%20is%20a%20widely%20used%20monitoring%20software%20for%20systems%20and%20networks.%20It%20provides%20the%20flexibility%20to%20monitor%20anything%20on%20your%20systems%20or%20networks%20using%20a%20script%20or%20plugin.%20%C2%A0Known%20for%20having%20plugins%20and%20scripts%20available%20to%20monitor%20your%20needs%2C%20Nagios" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F28%2Fcreate-nagios-plugin-monitor-on-monitis-com%2F&amp;title=Create%20Nagios%20Plugin%20Monitor%20on%20Monitis.com&amp;bodytext=Nagios%20is%20a%20widely%20used%20monitoring%20software%20for%20systems%20and%20networks.%20It%20provides%20the%20flexibility%20to%20monitor%20anything%20on%20your%20systems%20or%20networks%20using%20a%20script%20or%20plugin.%20%C2%A0Known%20for%20having%20plugins%20and%20scripts%20available%20to%20monitor%20your%20needs%2C%20Nagios" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F28%2Fcreate-nagios-plugin-monitor-on-monitis-com%2F&amp;t=Create%20Nagios%20Plugin%20Monitor%20on%20Monitis.com" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F28%2Fcreate-nagios-plugin-monitor-on-monitis-com%2F&amp;title=Create%20Nagios%20Plugin%20Monitor%20on%20Monitis.com&amp;source=Uptime+%26amp%3B+Performance+Tips+Tips+for+SysAdmin%2C+Webmaster%2C+Network+Admin&amp;summary=Nagios%20is%20a%20widely%20used%20monitoring%20software%20for%20systems%20and%20networks.%20It%20provides%20the%20flexibility%20to%20monitor%20anything%20on%20your%20systems%20or%20networks%20using%20a%20script%20or%20plugin.%20%C2%A0Known%20for%20having%20plugins%20and%20scripts%20available%20to%20monitor%20your%20needs%2C%20Nagios" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow"   href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F28%2Fcreate-nagios-plugin-monitor-on-monitis-com%2F&amp;Title=Create%20Nagios%20Plugin%20Monitor%20on%20Monitis.com" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/blinklist.png" class="sociable-img sociable-hovers" title="BlinkList" alt="BlinkList" /></a><a rel="nofollow"   href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F28%2Fcreate-nagios-plugin-monitor-on-monitis-com%2F&amp;title=Create%20Nagios%20Plugin%20Monitor%20on%20Monitis.com" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/dzone.png" class="sociable-img sociable-hovers" title="DZone" alt="DZone" /></a><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F28%2Fcreate-nagios-plugin-monitor-on-monitis-com%2F&amp;title=Create%20Nagios%20Plugin%20Monitor%20on%20Monitis.com&amp;annotation=Nagios%20is%20a%20widely%20used%20monitoring%20software%20for%20systems%20and%20networks.%20It%20provides%20the%20flexibility%20to%20monitor%20anything%20on%20your%20systems%20or%20networks%20using%20a%20script%20or%20plugin.%20%C2%A0Known%20for%20having%20plugins%20and%20scripts%20available%20to%20monitor%20your%20needs%2C%20Nagios" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow"   href="http://reddit.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F28%2Fcreate-nagios-plugin-monitor-on-monitis-com%2F&amp;title=Create%20Nagios%20Plugin%20Monitor%20on%20Monitis.com" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/reddit.png" class="sociable-img sociable-hovers" title="Reddit" alt="Reddit" /></a><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F28%2Fcreate-nagios-plugin-monitor-on-monitis-com%2F&amp;title=Create%20Nagios%20Plugin%20Monitor%20on%20Monitis.com" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow"   href="http://twitter.com/home?status=Create%20Nagios%20Plugin%20Monitor%20on%20Monitis.com%20-%20http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F28%2Fcreate-nagios-plugin-monitor-on-monitis-com%2F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow"   href="http://blog.monitis.com/index.php/feed/" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.monitis.com/index.php/2011/06/28/create-nagios-plugin-monitor-on-monitis-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Easily Monitor Windows Performance Counters with VBScript on Monitis</title>
		<link>http://blog.monitis.com/index.php/2011/06/24/how-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis/</link>
		<comments>http://blog.monitis.com/index.php/2011/06/24/how-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 12:06:38 +0000</pubDate>
		<dc:creator>Hovhannes Avoyan</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Monitis API]]></category>
		<category><![CDATA[Monitis vs. Other services]]></category>
		<category><![CDATA[Monitoring Scripts]]></category>
		<category><![CDATA[Performance Management]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[Windows Servers Monitoring]]></category>
		<category><![CDATA[performance counters]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://blog.monitis.com/?p=2453</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/24/how-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis/' addthis:title='How to Easily Monitor Windows Performance Counters with VBScript on Monitis '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Monitis provides you with the ability to monitor almost any detail on your Windows server (also see our post How to Monitor Windows Servers with VBScript, WMI and Monitis). Using a simple Visual Basic Script (VBS), you will be able to read the value of any Performance Counter on your Windows Server and send it to [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/24/how-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis/' addthis:title='How to Easily Monitor Windows Performance Counters with VBScript on Monitis '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p><a href="http://www.monitis.com/">Monitis</a> provides you with the ability to monitor almost any detail on your<a title="Server Monitoring" href="http://portal.monitis.com/index.php/products/internal-monitorserver-health"> Windows server</a> (also see our post <a title="Permanent Link to How to Monitor Windows Servers with VBScript, WMI and Monitis" rel="bookmark" href="http://blog.monitis.com/index.php/2011/06/14/how-to-monitor-windows-servers-with-vbscript-wmi-and-monitis/">How to Monitor Windows Servers with VBScript, WMI and Monitis</a>).</p>
<p>Using a simple Visual Basic Script (VBS), you will be able to read the value of any Performance Counter on your Windows Server and send it to a Custom Monitor.</p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/06/cake.jpg"><img class="alignnone size-full wp-image-2460" title="cake" src="http://blog.monitis.com/wp-content/uploads/2011/06/cake.jpg" alt="" width="160" height="106" /></a></p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/06/cake.jpg"></a>It’s easy as pie. Keep reading for the recipe!<span id="more-2453"></span></p>
<h2 dir="ltr">About Performance Counters</h2>
<p>&nbsp;</p>
<p>Performance Counters are used to provide information as to how well the operating system or an application, service, or driver is performing.  Performance Counters are highly detailed, and their counter value covers Processor, Disk, Network interface and a lot of other parameters.  The data from these counters can help determine system bottlenecks, and you can fine tune system and application performance.</p>
<p>You can access data from Performance Counters using interactive applications, such as Performance Monitor, or Windows Management Instrumentation (WMI) programs.  All Performance Counters’s value are made available through WMI via the classes named Win32_PerfFormattedData*.  The values’s names and instances are the same, which you can see within Performance Monitor and other interactive tools.</p>
<p>Also, you can browse available classes and values using WMI Explorer, and you can download it from this address: <a href="http://www.ks-soft.net/hostmon.eng/wmi/index.htm">http://www.ks-soft.net/hostmon.eng/wmi/index.htm</a>.</p>
<p>In this article, we will monitor the counter Connections Established in the Tcpip_TCPv4 class.<br />
Monitoring established connections is important because it can give you a precise idea about what the usage pattern looks like. It can also give you a clue that your server is under attack or it is being exploited.  Of course, if you’re using Monitis to monitor your Performance Counters and something should go wrong, we’ll <a href="http://portal.monitis.com/index.php/products/notifications">notify</a> you immediately via a variety of ways &#8212; including cell phone, instant messaging, email, SMS, Twitter and URL callback.</p>
<p>You can learn more about monitoring Performance Counters with WMI here: <a href="http://msdn.microsoft.com/en-us/library/aa392397%28v=vs.85%29.aspx#using_raw_performance_data_classes">http://msdn.microsoft.com/en-us/library/aa392397%28v=vs.85%29.aspx#using_raw_performance_data_classes</a></p>
<h2 dir="ltr">API Access</h2>
<p>&nbsp;</p>
<p>The first thing you will need in order to monitor WMI data is the<a href="http://portal.monitis.com/index.php/resources/api"> Monitis API Key</a> and Secret Key.  The API Key is an alphanumeric code that allows you to access the Monitis API urls and transmit or receive data about your Monitis services.  The Secret Key is an alphanumeric code that allows you to digitally sign your information to ensure that only you can transmit data to your Monitis account.</p>
<p>Your API Key may be disclosed to anyone, but your Secret Key must be maintained private and should not be shared or transmitted.  How safe is that? Very. To obtain your Monitis API Key and Secret Key, log into your account and from the top menu bar, go to:</p>
<ul>
<li>Tools,</li>
<li>API</li>
<li>API Key</li>
</ul>
<p>Both your API Key and your Secret Key will appear.</p>
<h2 dir="ltr">Create a Custom Monitor</h2>
<p>&nbsp;</p>
<p>A Custom Monitor is needed to display the values you get from<a href="http://portal.monitis.com/index.php/products/external-monitor"> external sources</a>.</p>
<p>In order to create it you need go through the following steps:</p>
<ol>
<li>Connect to<a href="http://portal.monitis.com/index.php/products/open-ai"> Monits API</a> and obtain an authorization token</li>
<li>Create the <a href="http://monitis.com/api/api.html#addCustomMonitor">Custom Monitor</a> tailored to your needs.</li>
</ol>
<p>The following VBScript code does it all for you:</p>
<pre style="word-wrap: break-word; white-space: pre-wrap;">'You API key and Secret Key
apiKey = "your API key here"
secretKey = "your secret key here"

'Connecting to WMI, "." is for local computer, specify computer name for another computer
computer = "."
Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + computer + "\root\cimv2")

'Finds current timezone to obtain GMT date
dtGMT = now
Set oRes = oWMI.ExecQuery("Select LocalDateTime from Win32_OperatingSystem")
For each oEntry in oRes
  dtGMT = DateAdd("n", -CInt(right(oEntry.LocalDateTime, 4)), dtGMT)
next

'Initialize HTTP connection object
Set objHTTP = CreateObject("Microsoft.XMLHTTP")

'Request a token to use in following calls
url = "http://www.monitis.com/api?action=authToken&amp;apikey=" + apiKey + "&amp;secretkey=" + secretKey
objHTTP.open "GET", url, False
objHTTP.send
resp = objHTTP.responseText
token = DissectStr(resp, "authToken"":""", """")

'Adds the custom monitor
url = "http://www.monitis.com/customMonitorApi"
monitorParams = "PerfCtrs_data:Connections:Connections+established:3:false;"
resultParams = "connections:Connections:N%2FA:2;"
name = "Connections established"
tag = "[perfctrs+sample]"
objHTTP.open "POST", url, False
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
postData = "apikey=" + apiKey + "&amp;validation=token&amp;authToken=" + token + "&amp;timestamp=" + FmtDate(dtGMT) + "&amp;action=addMonitor&amp;monitorParams=" + monitorParams + "&amp;resultParams=" + resultParams + "&amp;name=" + name + "&amp;tag=" + tag
objHTTP.send postData
resp = objHTTP.responseText

Set objHTTP = Nothing

Function DissectStr(cString, cStart, cEnd)
  dim nStart, nEnd
  nStart = InStr(cString, cStart)
  if nStart = 0 then
    DissectStr = ""
  else
    nStart = nStart + len(cStart)
    if cEnd = "" then
  	nEnd = len(cString)
    else
  	nEnd = InStr(nStart, cString, cEnd)
  	if nEnd = 0 then nEnd = nStart else nEnd = nEnd - nStart
    end if
	DissectStr = mid(cString, nStart, nEnd)
  end if
End Function

Function FmtDate(dt)
  FmtDate = cstr(Datepart("yyyy", dt)) + "-" + right("0" + cstr(Datepart("m", dt)),2) + "-" +  right("0" + cstr(Datepart ("d", dt)),2) + " " + right("0" + cstr(Datepart("h", dt)),2) + ":" + right("0" + cstr(Datepart("n", dt)),2) + ":" + right("0" + cstr(Datepart("S", dt)),2)
end function</pre>
<p>Save this code to a file with a .vbs extension (such as createCustMon.vbs) and save it, then run it executing the following command from a command prompt:</p>
<p>cscript createCustMon.vbs</p>
<h2 dir="ltr">Uploading Performance Counters values to Custom Monitor</h2>
<p>&nbsp;</p>
<p>Once your custom monitor is created you can start uploading Performance Counters values into it.</p>
<p>Take the following steps:</p>
<ol>
<li>Connect to Monits API and obtain an authToken</li>
<li>Get the list of Custom Monitors and locate the ID of the monitor you want to add data to</li>
<li>Execute your WMI query and get the necessary Performance Counter values</li>
<li>Upload the value to the Custom Monitor</li>
</ol>
<p>The following script does exactly that:</p>
<pre style="word-wrap: break-word; white-space: pre-wrap;">'You API key and Secret Key
apiKey = "your API key here"
secretKey = "your secret key here"

'Connecting to WMI, "." is for local computer, specify computer name for another computer
computer = "."
Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + computer + "\root\cimv2")

'Finds current timezone to obtain GMT date
dtGMT = now
Set oRes = oWMI.ExecQuery("Select LocalDateTime from Win32_OperatingSystem")
For each oEntry in oRes
  dtGMT = DateAdd("n", -CInt(right(oEntry.LocalDateTime, 4)), dtGMT)
next

'Initialize HTTP connection object
Set objHTTP = CreateObject("Microsoft.XMLHTTP")

'Request a token to use in following calls
url = "http://www.monitis.com/api?action=authToken&amp;apikey=" + apiKey + "&amp;secretkey=" + secretKey
objHTTP.open "GET", url, False
objHTTP.send
resp = objHTTP.responseText
token = DissectStr(resp, "authToken"":""", """")

'Requests the monitor list in order to find the MonitorID
tag = "[perfctrs+sample]"
url = "http://www.monitis.com/customMonitorApi?action=getMonitors&amp;apikey=" + apiKey + "&amp;tag=" + tag + "&amp;output=xml"
objHTTP.open "GET", url, False
objHTTP.send
resp = objHTTP.responseText

Set oResp = CreateObject("Microsoft.XMLDOM")
oResp.async = False
oResp.LoadXML(resp)

for each oNode in oResp.documentElement.childnodes
  if oNode.selectSingleNode("name").text = "Connections established" then
     monitorID = oNode.selectSingleNode("id").text
     exit for
  end if
next

wscript.echo "Monitor ID: " + monitorID

'Executes the WMI Query to obtain the data
Set oRes = oWMI.ExecQuery ("select ConnectionsEstablished from Win32_PerfFormattedData_Tcpip_TCPv4")
For each oEntry in oRes
  value = oEntry.ConnectionsEstablished
next

wscript.echo "Connections established: " &amp; value

'Posts data
url = "http://www.monitis.com/customMonitorApi"
action = "addResult"
results = "connections:" &amp; value &amp; ";"
unixDate = CStr(DateDiff("s", "01/01/1970 00:00:00", DateSerial(Year(dtGMT), Month(dtGMT), Day(dtGMT)) + TimeSerial(Hour(dtGMT), Minute(dtGMT), Second(dtGMT)))) + "000"
objHTTP.open "POST", url, False
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
postData = "apikey=" + apiKey + "&amp;validation=token&amp;authToken=" + token + "&amp;timestamp=" + FmtDate(dtGMT) + "&amp;action=" + action + "&amp;monitorId=" + monitorID + "&amp;checktime=" + unixDate + "&amp;results=" + results
objHTTP.send postData
resp = objHTTP.responseText

Function DissectStr(cString, cStart, cEnd)
  'Generic string manipulation function to extract value from JSON output
  dim nStart, nEnd
  nStart = InStr(cString, cStart)
  if nStart = 0 then
    DissectStr = ""
  else
    nStart = nStart + len(cStart)
    if cEnd = "" then
  	nEnd = len(cString)
    else
  	nEnd = InStr(nStart, cString, cEnd)
  	if nEnd = 0 then nEnd = nStart else nEnd = nEnd - nStart
    end if
    DissectStr = mid(cString, nStart, nEnd)
  end if
End Function

Function FmtDate(dt)
  FmtDate = cstr(Datepart("yyyy", dt)) + "-" + right("0" + cstr(Datepart("m", dt)),2) + "-" +  right("0" + cstr(Datepart ("d", dt)),2) + " " + right("0" + cstr(Datepart("h", dt)),2) + ":" + right("0" + cstr(Datepart("n", dt)),2) + ":" + right("0" + cstr(Datepart("S", dt)),2)
end function</pre>
<p>Save this code to a file with a .vbs extension (such as pushDataPerfCtrs.vbs). Then run it executing the following command from a command prompt:</p>
<p>cscript pushDataPerfCtrs.vbs</p>
<h2>Testing the Monitor</h2>
<p>&nbsp;</p>
<p>Each time you run the second script, a value is uploaded to your Custom Monitor.<br />
You can use Windows Task Scheduler to run the script automatically and as frequently as you need.</p>
<p>Add your Custom Monitor widget to your Monitis account like this:</p>
<p>From the Monitors menu, select and click Manage Monitors. Select Create Custom Monitor, then click Add to Window.<br />
<a href="http://blog.monitis.com/wp-content/uploads/2011/06/Monitis-Custom-Monitor.jpg"><img class="alignnone size-full wp-image-2461" title="Monitis Custom WMI Monitor" src="http://blog.monitis.com/wp-content/uploads/2011/06/Monitis-Custom-Monitor.jpg" alt="WMI Monitor" width="486" height="198" /></a></p>
<p>Refresh the page after adding new data to see them show up inside the widget.</p>
<p>We at Monitis hope this information on monitoring Performance Counters with VBScript will help you see how important &#8212; and easy &#8212; it is to use an independent monitoring service for servers. That’s what we do best. If you don’t believe us, check out the testimony of customers who have found extraordinary value in hosted monitoring. For example, one customer,<a href="http://portal.monitis.com/index.php/company/testimonials"> DCmedia Hosting</a>,  says Monitis’s “unique interface is easy to use and informative at the same time making setting up monitoring in a browser anywhere a breeze.”</p>
<p>&nbsp;</p>
Share Now:<a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F24%2Fhow-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis%2F&amp;title=How%20to%20Easily%20Monitor%20Windows%20Performance%20Counters%20with%20VBScript%20on%20Monitis&amp;notes=Monitis%20provides%20you%20with%20the%20ability%20to%20monitor%20almost%20any%20detail%20on%20your%20Windows%20server%20%28also%20see%20our%20post%C2%A0How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis%29.%0D%0A%0D%0AUsing%20a%20simple%20Visual%20Basic%20Script%20%28VBS%29%2C%20you%20will%20be%20able%20to%20read%20the%20va" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F24%2Fhow-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis%2F&amp;title=How%20to%20Easily%20Monitor%20Windows%20Performance%20Counters%20with%20VBScript%20on%20Monitis&amp;bodytext=Monitis%20provides%20you%20with%20the%20ability%20to%20monitor%20almost%20any%20detail%20on%20your%20Windows%20server%20%28also%20see%20our%20post%C2%A0How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis%29.%0D%0A%0D%0AUsing%20a%20simple%20Visual%20Basic%20Script%20%28VBS%29%2C%20you%20will%20be%20able%20to%20read%20the%20va" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F24%2Fhow-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis%2F&amp;t=How%20to%20Easily%20Monitor%20Windows%20Performance%20Counters%20with%20VBScript%20on%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F24%2Fhow-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis%2F&amp;title=How%20to%20Easily%20Monitor%20Windows%20Performance%20Counters%20with%20VBScript%20on%20Monitis&amp;source=Uptime+%26amp%3B+Performance+Tips+Tips+for+SysAdmin%2C+Webmaster%2C+Network+Admin&amp;summary=Monitis%20provides%20you%20with%20the%20ability%20to%20monitor%20almost%20any%20detail%20on%20your%20Windows%20server%20%28also%20see%20our%20post%C2%A0How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis%29.%0D%0A%0D%0AUsing%20a%20simple%20Visual%20Basic%20Script%20%28VBS%29%2C%20you%20will%20be%20able%20to%20read%20the%20va" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow"   href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F24%2Fhow-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis%2F&amp;Title=How%20to%20Easily%20Monitor%20Windows%20Performance%20Counters%20with%20VBScript%20on%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/blinklist.png" class="sociable-img sociable-hovers" title="BlinkList" alt="BlinkList" /></a><a rel="nofollow"   href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F24%2Fhow-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis%2F&amp;title=How%20to%20Easily%20Monitor%20Windows%20Performance%20Counters%20with%20VBScript%20on%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/dzone.png" class="sociable-img sociable-hovers" title="DZone" alt="DZone" /></a><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F24%2Fhow-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis%2F&amp;title=How%20to%20Easily%20Monitor%20Windows%20Performance%20Counters%20with%20VBScript%20on%20Monitis&amp;annotation=Monitis%20provides%20you%20with%20the%20ability%20to%20monitor%20almost%20any%20detail%20on%20your%20Windows%20server%20%28also%20see%20our%20post%C2%A0How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis%29.%0D%0A%0D%0AUsing%20a%20simple%20Visual%20Basic%20Script%20%28VBS%29%2C%20you%20will%20be%20able%20to%20read%20the%20va" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow"   href="http://reddit.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F24%2Fhow-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis%2F&amp;title=How%20to%20Easily%20Monitor%20Windows%20Performance%20Counters%20with%20VBScript%20on%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/reddit.png" class="sociable-img sociable-hovers" title="Reddit" alt="Reddit" /></a><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F24%2Fhow-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis%2F&amp;title=How%20to%20Easily%20Monitor%20Windows%20Performance%20Counters%20with%20VBScript%20on%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow"   href="http://twitter.com/home?status=How%20to%20Easily%20Monitor%20Windows%20Performance%20Counters%20with%20VBScript%20on%20Monitis%20-%20http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F24%2Fhow-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis%2F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow"   href="http://blog.monitis.com/index.php/feed/" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.monitis.com/index.php/2011/06/24/how-to-easily-monitor-windows-performance-counters-with-vbscript-on-monitis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Munin + Monitis = Muminitis?</title>
		<link>http://blog.monitis.com/index.php/2011/06/23/munin-monitis-muminitis/</link>
		<comments>http://blog.monitis.com/index.php/2011/06/23/munin-monitis-muminitis/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 08:37:34 +0000</pubDate>
		<dc:creator>Hovhannes Avoyan</dc:creator>
				<category><![CDATA[101 Reasons To Choose Monitis]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Linux Servers Monitoring]]></category>
		<category><![CDATA[Monitis vs. Other services]]></category>
		<category><![CDATA[Monitoring Scripts]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[mrtg]]></category>
		<category><![CDATA[munin]]></category>
		<category><![CDATA[rrd]]></category>

		<guid isPermaLink="false">http://blog.monitis.com/?p=2432</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/23/munin-monitis-muminitis/' addthis:title='Munin + Monitis = Muminitis? '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Munin in a nutshell Munin is an open source monitoring application. Munin has its cons and pros but the following blog post is not going to discuss it. Munin by itself, like it or not, became a very popular monitoring platform among SysAdmins all around the world. I can easily understand why – despite its [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/23/munin-monitis-muminitis/' addthis:title='Munin + Monitis = Muminitis? '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><div>
<p id="internal-source-marker_0.016779544297605753" dir="ltr"><span style="font-size: 20px; font-weight: bold;"><a href="http://blog.monitis.com/wp-content/uploads/2011/06/munin.png"><img class="alignright" title="munin" src="http://blog.monitis.com/wp-content/uploads/2011/06/munin.png" alt="munin" width="30%" height="15%" /></a>Munin in a nutshell</span></p>
<p>Munin is an open source monitoring application. Munin has its cons and pros but the following blog post is not going to discuss it.</p>
<p>Munin by itself, like it or not, became a very popular monitoring platform among SysAdmins all around the world. I can easily understand why – despite its cons, it is a brilliant piece of software in my opinion.</p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/06/munin.png"></a><span id="more-2432"></span>I believe that the main features which made Munin so successful are:</p>
<p style="padding-left: 30px;">1. Ease of operation – installing Munin is easy, even for the novice SysAdmin.</p>
<p style="padding-left: 30px;">2. Adding custom plugins is just as easy. Choose your favorite language, handle some STDIN and STDOUT and you have a Munin plugin.</p>
<p>Another trait I&#8217;d like to mention about Munin is its storage backend – which is <a href="http://www.mrtg.org/rrdtool/">RRD</a>. RRD stand for Round Robin Database. Essentially what RRD does is stores data in a circular buffer and also defines an interface for displaying this data in graphs.</p>
<p>Originally RRD was designed to store data for the infamous <a href="http://www.mrtg.org/mrtg/">MRTG</a> monitoring platform. RRD popularity has grown rapidly during the last few years and many other projects have started to use it just as well.</p>
<p>Simplistically, we could say that Munin has a server side and client side. The workflow of Munin is very simple:</p>
<ul>
<li>Server wakes up</li>
<li>Server polls data from all configured clients and stores it in its RRD backend</li>
<li>Server generates graphs for each host</li>
</ul>
<p>This is all nice and simple, but one of the main drawbacks of Munin is that the server polls for data, instead of having the client connect to the server and send its data. This usually makes Munin a bit hard to operate behind strict firewalls.</p>
<p>Ideally, from my humble experience, what I would do is set a Munin server for each site and when a problem arises – just have a look at the relevant Munin installation.</p>
<p>So imagine yourself, the SysAdmin you are, you&#8217;re sitting in your spacious office, happy but slightly bothered. Happy because you have Munin, but a bit bothered because you have dozens of Munin installations around the world. Yes, they do show you graphs about anything you could have dreamed of, but it&#8217;s scattered. You have already invested countless hours in Munin writing custom-tailored plugins for software that runs on your servers, so you don&#8217;t want to switch to another monitoring solution. But you do appreciate the power and flexibility of a centralized monitoring platform.</p>
<p>What you would actually want your Munin to do better are probably these 2 things:</p>
<p style="padding-left: 30px;">1. You would like a centralized interface for monitoring all of your servers</p>
<p style="padding-left: 30px;">2. You would like a comprehensive system of alerting for all of these</p>
<p>Integrating Munin and Monitis eases the pain. Don&#8217;t worry! There&#8217;s not much for you to do, your loyal servant has done all of it for you, just read on.</p>
<p>And another “don&#8217;t worry!” for the fearful – you can still keep your current Munin installation – actually you have to!</p>
<h2 dir="ltr">Muminitis?</h2>
<div>We all love the <a href="http://en.wikipedia.org/wiki/Moomin">Moomins</a>, don&#8217;t we? &#8211; But I think we&#8217;re going to love Moominitis much more.</div>
<div>
<p>I call the integration of Monitis and Munin – Moominitis or Muminitis. But it’s not the name, it’s what it does.</p>
<p>Continuing on I assume you have a working Munin installation as the procedures and commands following operate on functional Munin RRD data.</p>
<p>First of all, let&#8217;s checkout the latest <a href="https://github.com/monitisexchange/Monitis-Linux-Scripts">Monitis-Linux-Scripts</a> repository (I&#8217;ll work under /usr/share/monitisexchange):</p>
<p><code># mkdir -p /usr/share/monitisexchange &amp;&amp; cd /usr/share/monitisexchange<br />
# git clone git://github.com/monitisexchange/Monitis-Linux-Scripts.git<br />
# cd Monitis-Linux-Scripts/RRD<br />
# vim monitis_config</code></p>
<p>While editing monitis_config you should add your proper API key and secret key. This can be easily obtained from the Monitis interface under &#8216;Tools -&gt; API -&gt; API key&#8217;.</p>
<p>After this is working, we can start playing with Monitis and Munin. E.g.:<br />
<code># ./monitis_rrd.sh munin list_hosts /var/lib/munin<br />
</code><br />
monitis_rrd.sh takes a couple of parameters:</p>
</div>
<div>1. RRD interface to use (currently only munin is suppported, but stay tuned for more!)</div>
<div>2. Function to perform, supported functions are:</div>
<div>
<ul>
<li>list_hosts – List the hosts that Munin has collected data for</li>
<li>list_monitors – List all the monitors that are configured for a certain host</li>
<li>list_counters_for_monitor – List all counters a monitor can produce</li>
<li>add_monitor – Adds a monitor using the Monitis REST API</li>
<li>update_data_for_monitor – Update the latest data for a monitor using the Monitis REST API</li>
</ul>
</div>
<div>3. The rest of the arguments are plugin specific, for munin we&#8217;ll always specify as the 3rd argument the munin data dir (commonly /var/lib/munin)</div>
<p>The last command showed us the hosts Munin has collected data for. Another important function is list_counters_for_monitor.</p>
<p>In case you&#8217;d like to list the counters a monitor produces, use:</p>
<p><code># ./monitis_rrd.sh munin list_counters_for_monitor /var/lib/munin localhost memory</code></p>
<p>This will list all the counters the Munin monitor of &#8216;memory&#8217; produces for the host &#8216;localhost&#8217;.</p>
<p>But lets go with a concrete example. Say we&#8217;d like to add to Monitis a Munin counter that shows the amount of threads running on the system.</p>
<p>I’m assuming here my hostname is called &#8216;localhost&#8217;, but please change it to suit the hostname you are willing to monitor:</p>
<p><code># ./monitis_rrd.sh munin add_monitor /var/lib/munin localhost threads threads<br />
</code><br />
If all went good this will add the counter to Monitis, under &#8216;Monitors -&gt; Manage Monitors -&gt; Custom Monitors&#8217;.</p>
<p>Now lets add some data. to test if it is working at all, run the following:</p>
<p><code># ./monitis_rrd.sh munin update_data_for_monitor /var/lib/munin localhost threads threads</code></p>
<p>Via the Monitis interface you should witness under &#8216;RRD_localhost_munin_threads&#8217; that a result returned, showing the number of threads as polled by Munin:</p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/06/image001.jpg"><img class="alignnone size-full wp-image-2433" title="Monitis Dashboard with Munin" src="http://blog.monitis.com/wp-content/uploads/2011/06/image001.jpg" alt="Monitis Dashboard with Munin" width="400" height="350" /></a></p>
<h2 dir="ltr">Hooking it all together</h2>
</div>
<div>
<p>Obviously the trick is to get the data updated as soon as Munin polls for new values. As I previously mentioned, Munin usually wakes up every once in a while (usually every 5 minutes) and polls for new data.</p>
<p>In order to get this data to update also on Moninis, we&#8217;ll create the following hook script that would be executed every time Munin does:</p>
<p><code>#!/bin/bash</code></p>
<p><code># silence!<br />
exec &gt;&amp; /dev/null</code></p>
<p><code> </code><code>cd  /usr/share/monitisexchange/Monitis-Linux-Scripts/RRD &amp;&amp; \<br />
./monitis_rrd.sh munin update_data_for_monitor /var/lib/munin localhost threads threads</code></p>
<p>Note: the script template can be found <a href="https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/RRD/munin_hook_example.sh">here.</a><br />
Save it as monitis_hook.sh and set it with execution permissions (chmod +x monitis_hook.sh).</p>
<p>In Fedora and Debian Munin is invoked in /etc/cron.d/munin, change the following line:</p>
<p><code>*/5 * * * *     munin test -x /usr/bin/munin-cron &amp;&amp; /usr/bin/munin-cron</code></p>
<p>To:</p>
<p><code>*/5 * * * *     munin test -x /usr/bin/munin-cron &amp;&amp; /usr/bin/munin-cron &amp;&amp; /usr/share/monitisexchange/Monitis-Linux-Scripts/RRD/monitis_hook.sh</code></p>
<p>That&#8217;s it. Every time now Munin will be invoked, it&#8217;ll also update in Monitis the counters you&#8217;ve set to update.</p>
<p>Look! It&#8217;s generating a graph!!!</p>
</div>
<div>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/06/munin.jpg"><img class="alignnone size-full wp-image-2434" title="munin monitis" src="http://blog.monitis.com/wp-content/uploads/2011/06/munin.jpg" alt="munin monitis integration" width="450" height="220" /></a></p>
<p>Yes I know &#8211; this specific graph is not that interesting, but do trust me it is authentic Munin RRD data that was sampled from my humble computer.</p>
<p>Good luck with your Moominitis installation!</p>
<p>Liked it? Sign up for <a href="http://www.monitis.com/">Monitis</a> and try it now! Don’t forget to check also <a href="https://github.com/monitisexchange">monitisexchange</a> &#8211; our git-hub open source repository for some more surprises.</p>
</div>
<p>&nbsp;</p>
Share Now:<a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F23%2Fmunin-monitis-muminitis%2F&amp;title=Munin%20%2B%20Monitis%20%3D%20Muminitis%3F&amp;notes=%0D%0AMunin%20in%20a%20nutshell%0D%0AMunin%20is%20an%20open%20source%20monitoring%20application.%20Munin%20has%20its%20cons%20and%20pros%20but%20the%20following%20blog%20post%20is%20not%20going%20to%20discuss%20it.%0D%0A%0D%0AMunin%20by%20itself%2C%20like%20it%20or%20not%2C%20became%20a%20very%20popular%20monitoring%20platform%20among%20SysAdmins%20a" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F23%2Fmunin-monitis-muminitis%2F&amp;title=Munin%20%2B%20Monitis%20%3D%20Muminitis%3F&amp;bodytext=%0D%0AMunin%20in%20a%20nutshell%0D%0AMunin%20is%20an%20open%20source%20monitoring%20application.%20Munin%20has%20its%20cons%20and%20pros%20but%20the%20following%20blog%20post%20is%20not%20going%20to%20discuss%20it.%0D%0A%0D%0AMunin%20by%20itself%2C%20like%20it%20or%20not%2C%20became%20a%20very%20popular%20monitoring%20platform%20among%20SysAdmins%20a" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F23%2Fmunin-monitis-muminitis%2F&amp;t=Munin%20%2B%20Monitis%20%3D%20Muminitis%3F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F23%2Fmunin-monitis-muminitis%2F&amp;title=Munin%20%2B%20Monitis%20%3D%20Muminitis%3F&amp;source=Uptime+%26amp%3B+Performance+Tips+Tips+for+SysAdmin%2C+Webmaster%2C+Network+Admin&amp;summary=%0D%0AMunin%20in%20a%20nutshell%0D%0AMunin%20is%20an%20open%20source%20monitoring%20application.%20Munin%20has%20its%20cons%20and%20pros%20but%20the%20following%20blog%20post%20is%20not%20going%20to%20discuss%20it.%0D%0A%0D%0AMunin%20by%20itself%2C%20like%20it%20or%20not%2C%20became%20a%20very%20popular%20monitoring%20platform%20among%20SysAdmins%20a" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow"   href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F23%2Fmunin-monitis-muminitis%2F&amp;Title=Munin%20%2B%20Monitis%20%3D%20Muminitis%3F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/blinklist.png" class="sociable-img sociable-hovers" title="BlinkList" alt="BlinkList" /></a><a rel="nofollow"   href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F23%2Fmunin-monitis-muminitis%2F&amp;title=Munin%20%2B%20Monitis%20%3D%20Muminitis%3F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/dzone.png" class="sociable-img sociable-hovers" title="DZone" alt="DZone" /></a><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F23%2Fmunin-monitis-muminitis%2F&amp;title=Munin%20%2B%20Monitis%20%3D%20Muminitis%3F&amp;annotation=%0D%0AMunin%20in%20a%20nutshell%0D%0AMunin%20is%20an%20open%20source%20monitoring%20application.%20Munin%20has%20its%20cons%20and%20pros%20but%20the%20following%20blog%20post%20is%20not%20going%20to%20discuss%20it.%0D%0A%0D%0AMunin%20by%20itself%2C%20like%20it%20or%20not%2C%20became%20a%20very%20popular%20monitoring%20platform%20among%20SysAdmins%20a" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow"   href="http://reddit.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F23%2Fmunin-monitis-muminitis%2F&amp;title=Munin%20%2B%20Monitis%20%3D%20Muminitis%3F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/reddit.png" class="sociable-img sociable-hovers" title="Reddit" alt="Reddit" /></a><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F23%2Fmunin-monitis-muminitis%2F&amp;title=Munin%20%2B%20Monitis%20%3D%20Muminitis%3F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow"   href="http://twitter.com/home?status=Munin%20%2B%20Monitis%20%3D%20Muminitis%3F%20-%20http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F23%2Fmunin-monitis-muminitis%2F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow"   href="http://blog.monitis.com/index.php/feed/" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.monitis.com/index.php/2011/06/23/munin-monitis-muminitis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Linux User Login Monitor on Monitis</title>
		<link>http://blog.monitis.com/index.php/2011/06/15/create-linux-user-login-monitor-on-monitis/</link>
		<comments>http://blog.monitis.com/index.php/2011/06/15/create-linux-user-login-monitor-on-monitis/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 08:28:25 +0000</pubDate>
		<dc:creator>Hovhannes Avoyan</dc:creator>
				<category><![CDATA[101 Reasons To Choose Monitis]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Linux Servers Monitoring]]></category>
		<category><![CDATA[Monitis vs. Other services]]></category>
		<category><![CDATA[Monitoring Scripts]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.monitis.com/?p=2274</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/15/create-linux-user-login-monitor-on-monitis/' addthis:title='Create Linux User Login Monitor on Monitis '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Monitis provides the ability to monitor almost any operation on your server.  Using simple Linux tools and scripts you are able to monitor each time a user logs into the server and capture various information, including username, host address and login service.  Using pam_script and bash scripts, you are able to transmit information to a [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/15/create-linux-user-login-monitor-on-monitis/' addthis:title='Create Linux User Login Monitor on Monitis '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><div>
<p>Monitis provides the ability to monitor almost any operation on your server.  Using simple Linux tools and scripts you are able to monitor each time a user logs into the server and capture various information, including username, host address and login service.  Using pam_script and bash scripts, you are able to transmit information to a Custom Monitor with this information.</p>
<h3>API Access</h3>
</div>
<div>
<p>The first thing you will need in order to create this monitor is the <a title="Monitis API" href="http://monitis.com/api/api.html#api_home" target="_blank">Monitis API</a> Key and Secret Key.  The API Key is a alphanumeric code that allows you to access the Monitis API url&#8217;s and transmit or receive data about your Monitis services.  The Secret Key is an alphanumeric code that allows you to digitally sign your information to ensure that only you can transmit data to your Monitis account.  Your API Key may be disclosed to anyone, but your Secret Key must be maintained private and should not be shared nor transmitted.  To obtain your Monitis API Key and Secret Key, log into your account and from the top menu bar, go to Tools then API then API Key, it will display both your API Key and your Secret Key.<span id="more-2274"></span></p>
<p>Now let&#8217;s test your API access.  You should be able to connect and get an Auth Token:</p>
</div>
<p><code>curl 'http://www.monitis.com/api?action=authToken&amp;apikey=[API Key]&amp;secretkey=[Secret Key]&amp;version=2'</code></p>
<div>In the above command you should replace [API Key] and [Secret Key] with your API Key and Secret Key.  We are using curl in order to connect to <a href="http://www.monitis.com/">http://www.monitis.com</a> and access the API to get a Auth Token.  The return value is json and sends back something similar to:</div>
<div>
<div>
<p><code>{"authToken":"3TVQN32TIP1DN71OB4GOML1D7N"}</code></p>
<div>Where the alphanumeric code will be your Auth Token.  You can use your Auth Token to validate against the API later.   However sending your Secret Key is not extremely secure, others could possibly  obtain your Secret Key this way.  The more secure method of authenticating is to send your data using POST instead of GET and using a Base64-encoded RFC 2104-compliant HMAC signature to sign the post data.  The signature is sent in the checksum parameter of the POST data.  To calculate the checksum you must follow these rules:</div>
<div>
<ol>
<li>sort all parameters alphabetically by name (excluding the checksum parameter)</li>
<li>concat all parameter names and values like this: name1value1name2value2&#8230;</li>
<li>create Base64-encoded RFC 2104-compliant HMAC signature using Secret Key</li>
</ol>
<p>The final rule can be calculated using openssl:</p>
</div>
</div>
<p><code>echo -en “name1value1name2value2” |  openssl dgst -sha1 -hmac [Secret Key] -binary | openssl enc -base64</code></p>
<div>
<h3 id="internal-source-marker_0.4761642648372799">Creating a Custom Monitor</h3>
<p>In order to create a custom monitor, you must send a POST request to the API.  This POST request must contain several parameters: action, name, resultsParams, and tag (refer to <a href="http://monitis.com/api/api.html#addCustomMonitor">http://monitis.com/api/api.html#addCustomMonitor</a> for specifications).  We will use the following specifications for the params:</p>
<ul>
<li>action=addMonitor</li>
<li>name=Login Monitor</li>
<li>resultsParam=user_login:Login Name:logins:3;host:Host Address:hostaddress:3;srv:Service:service:3</li>
<li>tag=loginMonitor</li>
</ul>
<p>There is other necessary information in order to communicate with the API:</p>
<ul>
<li>apikey=[API Key]</li>
<li>timestamp=[Current UTC time]</li>
<li>version=2</li>
</ul>
</div>
<div>In order to create our new monitor called Login Monitor we would post this data plus a checksum to <a href="http://monitis.com/customMonitorApi">http://monitis.com/customMonitorApi</a> which is the Custom Monitor API url.  Here is a simple script that will accomplish this:</div>
<p><code>#!/bin/bash<br />
# create a Custom Monitor for Monitis<br />
# Be sure to modify the API Key and Secret Key<br />
ACTION="addMonitor"<br />
APIKEY="[API Key]"<br />
NAME="login monitor"<br />
RESULTPARAMS="user_login:Login Name:logins:3;host:Host Address:hostaddress:3;srv:Service:service:3"<br />
TAG="loginMonitor"<br />
TIMESTAMP=`date -u +"%F %T"`<br />
VERSION="2"<br />
SECRETKEY="[Secret Key]"<br />
URL="http://monitis.com/customMonitorApi" </code></p>
<p><code># Create Checksum<br />
CHECKSUM_STR="action"$ACTION"apikey"$APIKEY"name"$NAME"resultParams"$RESULTPARAMS"tag"$ TAG"timestamp"$TIMESTAMP"version"$VERSION<br />
CHECKSUM=$(echo -en $CHECKSUM_STR | openssl dgst -sha1 -hmac $SECRETKEY -binary | openssl enc -base64 )</code></p>
<p><code># Post Data to API<br />
POSTDATA="--data-urlencode \"action="$ACTION"\" --data-urlencode \"apikey="$APIKEY"\" --data-urlencode \"name="$NAME"\" --data-urlencode \"resultParams="$RESULTPARAMS"\" --data-urlencode \"tag="$TAG"\" --data-urlencode \"timestamp=$TIMESTAMP\" --data-urlencode \"version="$VERSION"\" --data-urlencode \"checksum="$CHECKSUM"\""</code></p>
<p><code> </code><code>eval "curl ${POSTDATA} $URL"</code></p>
<div>Save the above script into a file called monitis_create_monitor.sh, be sure not to change the order of the variables in the checksum calculation as they must be in alphabetical order.  Ensure to make this file executable:</div>
<div>
<div>
<p><code>chmod 755 monitis_create_monitor.sh</code></p>
<div>Now run it:</div>
<div><code>./monitis_create_monitor.sh</code></div>
<div>
<p>The output should look similar to this:</p>
<p><code>{"status":"ok","data":305}</code></p>
<p>This is showing us that the monitor was successfully created and that the id of the resulting monitor is 305.  If you go to your Monitis account now, you will be able to access this monitor.  From the top level menu, go to Monitors then Manage Monitors and then Custom Monitors.  Here you should find the Login Monitor.  Click the check box next to the title and then click Add to Window.  A window will pop up below the Custom Monitors dialog box.  Close the Custom Monitors dialog box and you will see your new monitor there.  But no data has been sent to it, so it is not that interesting.</p>
</div>
</div>
</div>
<div>
<h3 id="internal-source-marker_0.4761642648372799">Sending Data to Custom Monitor</h3>
</div>
<div>
<p>In order to send data to your Custom Monitor, you must provide the action, monitorId, checktime, and results (refer to <a href="http://monitis.com/api/api.html#addCustomMonitorResult">http://monitis.com/api/api.html#addCustomMonitorResult</a> for specifications).  The action is addResult, the monitorId is the id that was returned to us in the previous example (If you forgot the id, don&#8217;t worry we will get it back), the checktime is the timestamp of the results data, and the results is a string of the parameters and values in this format: name1value1;name2value2</p>
<p>The following script will send data to your Custom Monitor:</p>
</div>
<div>
<div>
<p><code> # add result to Custom Monitor for Monitis</code></p>
<p><code>#!/bin/bash<br />
usage()<br />
{<br />
cat &lt;&lt; EOF<br />
usage: $0 options</code></p>
<p><code>This script will add results to a Custom Monitis Monitor.</code></p>
<p><code>OPTIONS:<br />
-h      Show this message<br />
-a      api key<br />
-s      secret key<br />
-m      monitor tag<br />
-i      monitor id<br />
-t      timestamp (defaults to utc now)<br />
-r      results name:value[;name2:value2...]<br />
EOF<br />
}</code></p>
<p><code>APIKEY=<br />
VERSION="2"<br />
SECRETKEY=<br />
URL="http://monitis.com/customMonitorApi"<br />
OUTPUT="xml"<br />
MONITOR=<br />
ID=<br />
CHECKTIME=`date -u +"%s"000`<br />
TIMESTAMP=`date -u +"%F %T"`<br />
RESULTS=<br />
SESSIONACTION=</code></p>
<p><code>while getopts "ha:s:m:i:t:r:s:" OPTION<br />
do<br />
case $OPTION in</code></p>
<p><code>h)<br />
usage<br />
exit 1<br />
;;<br />
a)<br />
APIKEY=$OPTARG<br />
;;<br />
s)<br />
SECRETKEY=$OPTARG<br />
;;<br />
m)<br />
MONITOR=$OPTARG<br />
;;<br />
i)<br />
ID=$OPTARG<br />
;;<br />
t)<br />
CHECKTIME=$OPTARG<br />
;;<br />
r)<br />
RESULTS=$OPTARG<br />
;;<br />
esac<br />
done</p>
<p>if [[ -z $APIKEY ]] || [[ -z $SECRETKEY ]] || [[ -z $MONITOR$ID ]] || [[ -z $RESULTS ]] || [[ -z $CHECKTIME ]]<br />
then<br />
usage<br />
exit 1<br />
fi</p>
<p># Get id of monitor if not provided<br />
if [[ -z $ID ]]<br />
then<br />
XMLID=$(curl -s "$URL?apikey=$APIKEY&amp;output=$OUTPUT&amp;version=$VERSION&amp;action=getMonitors&amp;tag=$MONITOR" | xpath -q -e /monitors/monitor/id)<br />
ID=${XMLID//[^0-9]/}<br />
fi</p>
<p># Add monitor result<br />
ACTION="addResult"<br />
# Create Checksum<br />
CHECKSUM_STR="action"$ACTION"apikey"$APIKEY"checktime"$CHECKTIME"monitorId"$ID"results"$ RESULTS"timestamp"$TIMESTAMP"version"$VERSION<br />
CHECKSUM=$(echo -en $CHECKSUM_STR | openssl dgst -sha1 -hmac $SECRETKEY -binary | openssl enc -base64 )<br />
# Post Data to API</p>
<p>POSTDATA="--data-urlencode \"action="$ACTION"\" --data-urlencode \"apikey="$APIKEY"\" --data-urlencode \"checktime="$CHECKTIME"\" --data-urlencode \"monitorId="$ID"\" --data-urlencode \"results="$RESULTS"\" --data-urlencode \"timestamp=$TIMESTAMP\" --data-urlencode \"version="$VERSION"\" --data-urlencode \"checksum="$CHECKSUM"\""</p>
<p></code><code>eval "curl ${POSTDATA} $URL"</code></p>
<div>
<p>Save this file to monitis_add_result.sh and make executable.  You can run it with no parameters to get a help menu, that should be self-explanatory.  You can either provide the API Key and Secret Key on the command-line or fill in the script to contain it.  The script will provide you with the monitorId if you forget yours, but you will have to know the tag name you gave to your Custom Monitor when you created it.  Therefore, either your tag or your monitorId is required to run this script.</p>
<h3>Capturing Information on Login</h3>
<p>Now that we have a script to send data to the Custom Monitor, we need to have data to send.  This script could easily be run from .bashrc or /etc/bashrc – and that would work fine, if we knew that no user would be deleting their .bashrc.  Since we cannot guarantee that, we will use PAM (Pluggable Authentication Module) to control how and when we send information to the Custom Monitor.  Since no user without root access will be able to alter PAM, this is a secure way to guarantee login information.  Also since sshd, sftp, ftp, and most other programs utilize PAM for authentication, this will monitor all logins to the server, not just shell logins.</p>
<p>PAM offers many options and modules, we will be utilizing a module called pam_script.  pam_script allows you to execute a script on session open, session close, and/or on auth.  You must download and install pam_script first:</p>
<p><code>wget 'http://freshmeat.net/urls/47ddad89e38001dbe0dc50424e36987b' -O libpam-script.tar.gz<br />
tar -xzvf libpam-script.tar.gz<br />
cd libpam-script-x.x.x #x.x.x is the version that you just download, apparent from tar output<br />
make<br />
sudo cp pam_script.so /lib/security/<br />
sudo chown root:root /lib/security/pam_script.so<br />
sudo chmod 755 /lib/security/pam_script.so </code></p>
<p>pam_script is now installed, but not configured.  There are three files associated with pam_script, /etc/security/onsessionopen /etc/security/onsessionclose /etc/security/onauth  The first two files will work on a session and the last will work for a successful auth.  Since we want to monitor successful auths, we will create the onauth file:</p>
<p><code>#!/bin/sh<br />
# onauth for Monitis Custom Login Monitor<br />
USER=$1<br />
SERVICE=$2<br />
HOST=$PAM_RHOST</code></p>
<p><code>/etc/security/monitis_add_data.sh -m loginMonitor -r "user_login:$USER;host:$HOST;srv:$SERVICE"<br />
</code></p>
<p>This script will require that you move the monitis_add_data.sh script to /etc/security and make it and the onauth script executable by root and owned by root:</p>
<p><code>sudo mv monitis_add_data.sh /etc/security<br />
sudo chmod 700 /etc/security/monitis_add_data.sh<br />
sudo chown root:root /etc/security/monitis_add_data.sh<br />
sudo chmod 700 /etc/security/onauth<br />
sudo chown root:root /etc/security/onauth</code></p>
<p>Now we need to set PAM to utilize the pam_script module.  Depending on your system this will vary, but you need to edit the /etc/pam.d/common-auth file or something similar on your system.  You should add the following line:</p>
<p><code># require the scripts to run at auth<br />
auth required   pam_script.so  runas=root expose=rhost</code></p>
<p>Here we are telling module to run as root and to expose the rhost variable, which will contain the remote host information that we utilize in the above script with the $PAM_RHOST variable</p>
<h3>Testing the Monitor</h3>
<p>Now we have a setup that will log all usernames, remote hosts, and service that they logged in from to our Custom Monitor.  Give <a title="Monitis Free Signup" href="https://www.monitis.com/free_signup.jsp" target="_blank">it a try</a>, ssh to your machine several times.  You will see the values appear in your account&#8217;s Custom Monitor.</p>
</div>
<p>&nbsp;</p>
</div>
</div>
</div>
Share Now:<a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F15%2Fcreate-linux-user-login-monitor-on-monitis%2F&amp;title=Create%20Linux%20User%20Login%20Monitor%20on%20Monitis&amp;notes=%0D%0A%0D%0AMonitis%20provides%20the%20ability%20to%20monitor%20almost%20any%20operation%20on%20your%20server.%20%C2%A0Using%20simple%20Linux%20tools%20and%20scripts%20you%20are%20able%20to%20monitor%20each%20time%20a%20user%20logs%20into%20the%20server%20and%20capture%20various%20information%2C%20including%20username%2C%20host%20address%20an" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F15%2Fcreate-linux-user-login-monitor-on-monitis%2F&amp;title=Create%20Linux%20User%20Login%20Monitor%20on%20Monitis&amp;bodytext=%0D%0A%0D%0AMonitis%20provides%20the%20ability%20to%20monitor%20almost%20any%20operation%20on%20your%20server.%20%C2%A0Using%20simple%20Linux%20tools%20and%20scripts%20you%20are%20able%20to%20monitor%20each%20time%20a%20user%20logs%20into%20the%20server%20and%20capture%20various%20information%2C%20including%20username%2C%20host%20address%20an" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F15%2Fcreate-linux-user-login-monitor-on-monitis%2F&amp;t=Create%20Linux%20User%20Login%20Monitor%20on%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F15%2Fcreate-linux-user-login-monitor-on-monitis%2F&amp;title=Create%20Linux%20User%20Login%20Monitor%20on%20Monitis&amp;source=Uptime+%26amp%3B+Performance+Tips+Tips+for+SysAdmin%2C+Webmaster%2C+Network+Admin&amp;summary=%0D%0A%0D%0AMonitis%20provides%20the%20ability%20to%20monitor%20almost%20any%20operation%20on%20your%20server.%20%C2%A0Using%20simple%20Linux%20tools%20and%20scripts%20you%20are%20able%20to%20monitor%20each%20time%20a%20user%20logs%20into%20the%20server%20and%20capture%20various%20information%2C%20including%20username%2C%20host%20address%20an" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow"   href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F15%2Fcreate-linux-user-login-monitor-on-monitis%2F&amp;Title=Create%20Linux%20User%20Login%20Monitor%20on%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/blinklist.png" class="sociable-img sociable-hovers" title="BlinkList" alt="BlinkList" /></a><a rel="nofollow"   href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F15%2Fcreate-linux-user-login-monitor-on-monitis%2F&amp;title=Create%20Linux%20User%20Login%20Monitor%20on%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/dzone.png" class="sociable-img sociable-hovers" title="DZone" alt="DZone" /></a><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F15%2Fcreate-linux-user-login-monitor-on-monitis%2F&amp;title=Create%20Linux%20User%20Login%20Monitor%20on%20Monitis&amp;annotation=%0D%0A%0D%0AMonitis%20provides%20the%20ability%20to%20monitor%20almost%20any%20operation%20on%20your%20server.%20%C2%A0Using%20simple%20Linux%20tools%20and%20scripts%20you%20are%20able%20to%20monitor%20each%20time%20a%20user%20logs%20into%20the%20server%20and%20capture%20various%20information%2C%20including%20username%2C%20host%20address%20an" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow"   href="http://reddit.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F15%2Fcreate-linux-user-login-monitor-on-monitis%2F&amp;title=Create%20Linux%20User%20Login%20Monitor%20on%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/reddit.png" class="sociable-img sociable-hovers" title="Reddit" alt="Reddit" /></a><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F15%2Fcreate-linux-user-login-monitor-on-monitis%2F&amp;title=Create%20Linux%20User%20Login%20Monitor%20on%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow"   href="http://twitter.com/home?status=Create%20Linux%20User%20Login%20Monitor%20on%20Monitis%20-%20http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F15%2Fcreate-linux-user-login-monitor-on-monitis%2F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow"   href="http://blog.monitis.com/index.php/feed/" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.monitis.com/index.php/2011/06/15/create-linux-user-login-monitor-on-monitis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Monitor Windows Servers with VBScript, WMI and Monitis</title>
		<link>http://blog.monitis.com/index.php/2011/06/14/how-to-monitor-windows-servers-with-vbscript-wmi-and-monitis/</link>
		<comments>http://blog.monitis.com/index.php/2011/06/14/how-to-monitor-windows-servers-with-vbscript-wmi-and-monitis/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 10:56:04 +0000</pubDate>
		<dc:creator>Hovhannes Avoyan</dc:creator>
				<category><![CDATA[101 Reasons To Choose Monitis]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Monitis vs. Other services]]></category>
		<category><![CDATA[Monitoring Scripts]]></category>
		<category><![CDATA[Performance Management]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[Windows Networking]]></category>
		<category><![CDATA[Windows Servers Monitoring]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[wmi]]></category>
		<category><![CDATA[wmi monitoring]]></category>

		<guid isPermaLink="false">http://blog.monitis.com/?p=2254</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/14/how-to-monitor-windows-servers-with-vbscript-wmi-and-monitis/' addthis:title='How to Monitor Windows Servers with VBScript, WMI and Monitis '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Want to track a certain metric on your server which is not available out-of-the-box?  The Monitis monitoring platform provides you with the ability to monitor almost anything you can think of, including any detail on your Windows servers. Using a simple Visual Basic Script (VBS or vbscript) you will be able to read any value [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/14/how-to-monitor-windows-servers-with-vbscript-wmi-and-monitis/' addthis:title='How to Monitor Windows Servers with VBScript, WMI and Monitis '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Want to track a certain metric on your server which is not available out-of-the-box?  The <a href="http://www.monitis.com/">Monitis monitoring platform</a> provides you with the ability to monitor almost anything you can think of, including any detail on your <a href="http://blog.monitis.com/index.php/2011/05/13/mon-itor-us-introduces-worlds-first-free-server-monitoring-as-a-service/">Windows servers</a>. Using a simple <strong>Visual Basic Script </strong>(VBS or <strong>vbscript</strong>) you will be able to read any value from <strong>WMI</strong> (<strong>Windows Management Instrumentation</strong>) and send it to Monitis’s platform for visualization, tracking and alerting &#8212; using our so-called Custom Monitoring feature.</p>
<h3>About WMI Service</h3>
<p>WMI is a core Windows management technology that allows software to monitor and control managed resources throughout a network. WMI gives you a consistent way to access almost any detail of the operating system (OS) such as hardware, devices, services and applications.<span id="more-2254"></span></p>
<p>When it comes to authentication, in order to manage remote computers, WMI is also easy to use. WMI shares authentication mechanism with other Windows Network operations, such as accessing shared folders on networked servers. So if you can access a remote folder you can also access WMI on that computer. If you are monitoring your server in a domain &#8212; you’re probably already done.</p>
<p>Be sure to have Administrator privileges to be able to access all available information.</p>
<p>After ensuring that, if you want to monitor a remote computer just replace the dot in your computer (“.”) with the actual name of the computer to monitor in the scripts below. That’s it!</p>
<p>WMI service offers a wide range of objects where you can find useful information, browse available information and test your queries using WMI Explorer:  Here’s a helpful link: <a href="http://www.ks-soft.net/hostmon.eng/wmi/index.htm">http://www.ks-soft.net/hostmon.eng/wmi/index.htm</a></p>
<p>Learn more about WMI here, too: h<a href="http://msdn.microsoft.com/en-us/library/aa384642%28v=vs.85%29.aspx">ttp://msdn.microsoft.com/en-us/library/aa384642%28v=vs.85%29.aspx</a></p>
<h3>A Monitoring Platform and API</h3>
<p><a href="http://portal.monitis.com/index.php/products/platform-benefits">Monitis’s platform</a> provides an <strong><a href="http://portal.monitis.com/index.php/resources/api">Application Programming Interface</a> </strong>(API) to extend and automatize system management and monitoring tasks. The first thing you will need in order to access Monitis’s platform is the Monitis API Key and Secret Key.</p>
<p>The<strong> API Key </strong>is an alphanumeric code that allows you to access the Monitis API URLs and transmit or receive data about your Monitis services.  The <strong>Secret Key</strong> is an alphanumeric code that allows you to digitally sign your information to ensure that only you can transmit data to your Monitis account.  Your API Key may be disclosed to anyone and it is like your username, but your Secret Key must be maintained private and should not be shared or transmitted (it is like a password).  To obtain your Monitis API Key and Secret Key, log into your account and, from the top menu bar, go to Tools -&gt; API -&gt; API Key.</p>
<p>Both your API Key and your Secret Key will appear on a dialog box.</p>
<h3>Custom Monitoring Script to Monitor Anything on Your Server</h3>
<p>Monitis <strong>custom monitoring</strong> allows you to monitor <em>any metric</em> on a local or remote server, from system-level metrics to application-specific ones. Data from your custom monitor is collected and aggregated just like every other metric within Monitis’s dashboard. You may add alerting (<a href="http://portal.monitis.com/index.php/products/notifications">notifications should your server go down or slow to a crawl</a>) or customize graphical views.</p>
<p>In order to create your script, take the following steps:</p>
<ol>
<li>Connect to <a href="http://portal.monitis.com/index.php/products/open-ai">Monits API</a> and obtain an authorization session token</li>
<li>Create the Custom Monitor tailored to your needs.</li>
</ol>
<p>The following VBScript code does it all for you:</p>
<p><code> apiKey = "3TE4K9JAJWCQDKRANI3IPTBLQK"   'Replace with your API key<br />
secretKey = "5CK8P21E6A21Q9ARDDRGUJSAK" 'Replace with your secret key</code></p>
<p><code> </code></p>
<p><code>'Connecting to WMI, "." is for local computer else specify the computer name<br />
computer = "."<br />
Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + computer<br />
+ "\root\cimv2")</code></p>
<p><code>'Finds current timezone to obtain GMT date<br />
dtGMT = now<br />
Set oRes = oWMI.ExecQuery("Select LocalDateTime from Win32_OperatingSystem")<br />
For each oEntry in oRes<br />
dtGMT = DateAdd("n", -CInt(right(oEntry.LocalDateTime, 4)), dtGMT)<br />
next</code></p>
<p><code>'Initialize HTTP connection object<br />
Set objHTTP = CreateObject("Microsoft.XMLHTTP")</code></p>
<p><code>'Request a token to use in following calls<br />
url = "http://www.monitis.com/api?action=authToken&amp;apikey=" + apiKey +<br />
"&amp;secretkey=" + secretKey<br />
objHTTP.open "GET", url, False<br />
objHTTP.send<br />
resp = objHTTP.responseText<br />
token = DissectStr(resp, "authToken"":""", """")</code></p>
<p><code>'Adds the custom monitor<br />
url = "http://www.monitis.com/customMonitorApi"<br />
monitorParams = "wmi_data:WMI+data:Free+space+on+C+drive:3:false;"<br />
resultParams = "bytes:Bytes:N%2FA:2;"<br />
name = "sample_wmi_monitor"<br />
objHTTP.open "POST", url, False<br />
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"<br />
postData = "apikey=" + apiKey + "&amp;validation=token&amp;authToken=" + token +<br />
"×tamp=" + FmtDate(dtGMT) + "&amp;action=addMonitor&amp;monitorParams=" +<br />
monitorParams + "&amp;resultParams=" + resultParams + "&amp;name=" + name +<br />
"&amp;tag=[wmi+sample]"<br />
objHTTP.send postData<br />
resp = objHTTP.responseText</code></p>
<p><code>Function DissectStr(cString, cStart, cEnd)<br />
dim nStart, nEnd<br />
nStart = InStr(cString, cStart)<br />
if nStart = 0 then<br />
DissectStr = ""<br />
else<br />
nStart = nStart + len(cStart)<br />
if cEnd = "" then<br />
nEnd = len(cString)<br />
else<br />
nEnd = InStr(nStart, cString, cEnd)<br />
if nEnd = 0 then nEnd = nStart else nEnd = nEnd - nStart<br />
end if<br />
DissectStr = mid(cString, nStart, nEnd)<br />
end if<br />
End Function</code></p>
<p><code> </code></p>
<p><code>Function FmtDate(dt)<br />
FmtDate = cstr(Datepart("yyyy", dt)) + "-" + right("0"+cstr(Datepart("m", dt)),2) +<br />
"-" +  right("0"+cstr(Datepart("d", dt)),2) + " " +<br />
right("0"+cstr(Datepart("h", dt)),2) + ":" + right("0"+cstr(Datepart("n", dt)),2) +<br />
":" + right("0" + cstr(Datepart("S", dt)),2)<br />
end function</code></p>
<div>
<p>Save this code to a file with a .vbs extension (such as createCustMon.vbs) and save it, then run it executing the following command from a command prompt:</p>
<p><code>cscript createCustMon.vbs</code></p>
<h3>WMI Monitoring Script</h3>
<p>Once your custom monitor is created, you can start uploading WMI query values into it.</p>
<p>The following steps are needed:</p>
<ol>
<li>Connect to Monits API and obtain an authToken</li>
<li>Get the list of Custom Monitors and locate the ID of the monitor we just created</li>
<li>Execute your WMI query on a local or remote server and get the values to upload</li>
<li>Upload the value to the Custom Monitor using Monitis API</li>
</ol>
</div>
<div>
<p>The following script does exactly that:<br />
<code>apiKey = "3TE4K9JAJWCQDKRANI3IPTBLQK"   'Replace with your API key<br />
secretKey = "5CK8P21E6A21Q9ARDDRGUJSAK" 'Replace with your secret key</code></p>
<p><code>'Connecting to WMI, "." is for local computer else specify the computer name<br />
computer = "."<br />
Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + computer<br />
+ "\root\cimv2")</code></p>
<p><code>'Finds current timezone to obtain GMT date<br />
dtGMT = now<br />
Set oRes = oWMI.ExecQuery("Select LocalDateTime from Win32_OperatingSystem")<br />
For each oEntry in oRes<br />
dtGMT = DateAdd("n", -CInt(right(oEntry.LocalDateTime, 4)), dtGMT)<br />
next</code></p>
<p><code>'Initialize HTTP connection object<br />
Set objHTTP = CreateObject("Microsoft.XMLHTTP")</code></p>
<p><code>'Request a token to use in following calls<br />
url = "http://www.monitis.com/api?action=authToken&amp;apikey=" + apiKey +<br />
"&amp;secretkey=" + secretKey<br />
objHTTP.open "GET", url, False<br />
objHTTP.send<br />
resp = objHTTP.responseText<br />
token = DissectStr(resp, "authToken"":""", """")</code></p>
<p><code>'Requests the monitor list in order to find the MonitorID<br />
tag = "[wmi+sample]"<br />
url = "http://www.monitis.com/customMonitorApi?action=getMonitors&amp;apikey=" + apiKey +<br />
"&amp;tag=" + tag<br />
objHTTP.open "GET", url, False<br />
objHTTP.send<br />
resp = objHTTP.responseText<br />
monitorID = DissectStr(resp, "id"":""", """,""tag")</code></p>
<p><code>'Executes the WMI Query to obtain the data<br />
Set oRes = oWMI.ExecQuery("select FreeSpace from Win32_LogicalDisk where<br />
DeviceID = 'C:'")<br />
For each oEntry in oRes<br />
value = oEntry.FreeSpace<br />
next</code></p>
<p><code>'Posts data<br />
url = "http://www.monitis.com/customMonitorApi"<br />
action = "addResult"<br />
results = "bytes:" &amp; value &amp; ";"<br />
unixDate = CStr(DateDiff("s", "01/01/1970 00:00:00", DateSerial(Year(dtGMT),<br />
Month(dtGMT), Day(dtGMT)) + TimeSerial(Hour(dtGMT), Minute(dtGMT), Second(dtGMT))))<br />
+ "000"<br />
objHTTP.open "POST", url, False<br />
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"<br />
postData = "apikey=" + apiKey + "&amp;validation=token&amp;authToken=" + token +<br />
"×tamp=" + FmtDate(dtGMT) + "&amp;action=" + action + "&amp;monitorId=" + monitorID +<br />
"&amp;checktime=" + unixDate + "&amp;results=" + results<br />
objHTTP.send postData<br />
resp = objHTTP.responseText</code></p>
<p><code>Function DissectStr(cString, cStart, cEnd)<br />
dim nStart, nEnd<br />
nStart = InStr(cString, cStart)<br />
if nStart = 0 then<br />
DissectStr = ""<br />
else<br />
nStart = nStart + len(cStart)<br />
if cEnd = "" then<br />
nEnd = len(cString)<br />
else<br />
nEnd = InStr(nStart, cString, cEnd)<br />
if nEnd = 0 then nEnd = nStart else nEnd = nEnd - nStart<br />
end if<br />
DissectStr = mid(cString, nStart, nEnd)<br />
end if<br />
End Function</code></p>
<p><code> </code><code>Function FmtDate(dt)<br />
FmtDate = cstr(Datepart("yyyy", dt)) + "-" + right("0"+cstr(Datepart("m", dt)),2) +<br />
"-" +  right("0"+cstr(Datepart("d", dt)),2) + " " +<br />
right("0"+cstr(Datepart("h", dt)),2) + ":" + right("0"+cstr(Datepart("n", dt)),2) +<br />
":" + right("0" + cstr(Datepart("S", dt)),2)<br />
end function<br />
</code></p>
</div>
<div>
<p>Affix this code to a file with a .vbs extension (such as pushDataWMI.vbs) and save it. Then run it executing the following command from a command prompt:</p>
<p><code>cscript pushDataWMI.vbs</code></p>
<h3>Testing the Monitor</h3>
<p>Each time you run the second script, a value is uploaded to your Custom Monitor.<br />
You can use Windows Task Scheduler to run the script automatically and as frequently as you need.</p>
<p>Add your Custom Monitor widget to your Monitis account like this:</p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/06/image00.jpg"><img class="alignnone size-full wp-image-2257" title="image00" src="http://blog.monitis.com/wp-content/uploads/2011/06/image00.jpg" alt="" width="486" height="199" /></a></p>
<p>From the Monitors menu, select and click Manage Monitors. Select Create Custom Monitor, then click Add to Window.</p>
</div>
<div>
<p>Refresh the page after adding new data to see them show up inside the <a href="http://portal.monitis.com/index.php/products/widgets">widget</a>.</p>
<p><img class="alignnone" src="http://blog.monitis.com/wp-content/uploads/2011/02/Monitis-Logo-Small-1.png" alt="" width="200" height="81" /></p>
<p>We at Monitis hope this information on monitoring Windows WMI with VBScript will help you see how quickly and easily you can levy ur cloud-located monitoring platform to track your server and then get notified when something is wrong. That’s why we made Monitis in the first place &#8211; to save time and enhance productivity for sysadmins. Want to check your server or site? Then signup now <a href="https://www.monitis.com/free_signup.jsp">free Monitis trial </a>and try these scripts.</p>
</div>
Share Now:<a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F14%2Fhow-to-monitor-windows-servers-with-vbscript-wmi-and-monitis%2F&amp;title=How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis&amp;notes=Want%20to%20track%20a%20certain%20metric%20on%20your%20server%20which%20is%20not%20available%20out-of-the-box%3F%20%C2%A0The%20Monitis%20monitoring%20platform%20provides%20you%20with%20the%20ability%20to%20monitor%20almost%20anything%20you%20can%20think%20of%2C%20including%20any%20detail%20on%20your%20Windows%20servers.%20Using%20a%20si" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F14%2Fhow-to-monitor-windows-servers-with-vbscript-wmi-and-monitis%2F&amp;title=How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis&amp;bodytext=Want%20to%20track%20a%20certain%20metric%20on%20your%20server%20which%20is%20not%20available%20out-of-the-box%3F%20%C2%A0The%20Monitis%20monitoring%20platform%20provides%20you%20with%20the%20ability%20to%20monitor%20almost%20anything%20you%20can%20think%20of%2C%20including%20any%20detail%20on%20your%20Windows%20servers.%20Using%20a%20si" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F14%2Fhow-to-monitor-windows-servers-with-vbscript-wmi-and-monitis%2F&amp;t=How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F14%2Fhow-to-monitor-windows-servers-with-vbscript-wmi-and-monitis%2F&amp;title=How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis&amp;source=Uptime+%26amp%3B+Performance+Tips+Tips+for+SysAdmin%2C+Webmaster%2C+Network+Admin&amp;summary=Want%20to%20track%20a%20certain%20metric%20on%20your%20server%20which%20is%20not%20available%20out-of-the-box%3F%20%C2%A0The%20Monitis%20monitoring%20platform%20provides%20you%20with%20the%20ability%20to%20monitor%20almost%20anything%20you%20can%20think%20of%2C%20including%20any%20detail%20on%20your%20Windows%20servers.%20Using%20a%20si" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow"   href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F14%2Fhow-to-monitor-windows-servers-with-vbscript-wmi-and-monitis%2F&amp;Title=How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/blinklist.png" class="sociable-img sociable-hovers" title="BlinkList" alt="BlinkList" /></a><a rel="nofollow"   href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F14%2Fhow-to-monitor-windows-servers-with-vbscript-wmi-and-monitis%2F&amp;title=How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/dzone.png" class="sociable-img sociable-hovers" title="DZone" alt="DZone" /></a><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F14%2Fhow-to-monitor-windows-servers-with-vbscript-wmi-and-monitis%2F&amp;title=How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis&amp;annotation=Want%20to%20track%20a%20certain%20metric%20on%20your%20server%20which%20is%20not%20available%20out-of-the-box%3F%20%C2%A0The%20Monitis%20monitoring%20platform%20provides%20you%20with%20the%20ability%20to%20monitor%20almost%20anything%20you%20can%20think%20of%2C%20including%20any%20detail%20on%20your%20Windows%20servers.%20Using%20a%20si" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow"   href="http://reddit.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F14%2Fhow-to-monitor-windows-servers-with-vbscript-wmi-and-monitis%2F&amp;title=How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/reddit.png" class="sociable-img sociable-hovers" title="Reddit" alt="Reddit" /></a><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F14%2Fhow-to-monitor-windows-servers-with-vbscript-wmi-and-monitis%2F&amp;title=How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow"   href="http://twitter.com/home?status=How%20to%20Monitor%20Windows%20Servers%20with%20VBScript%2C%20WMI%20and%20Monitis%20-%20http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F14%2Fhow-to-monitor-windows-servers-with-vbscript-wmi-and-monitis%2F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow"   href="http://blog.monitis.com/index.php/feed/" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.monitis.com/index.php/2011/06/14/how-to-monitor-windows-servers-with-vbscript-wmi-and-monitis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Finding Security &amp; Performance in a Server Monitoring Agent</title>
		<link>http://blog.monitis.com/index.php/2011/06/11/finding-security-performance-in-a-server-monitoring-agent/</link>
		<comments>http://blog.monitis.com/index.php/2011/06/11/finding-security-performance-in-a-server-monitoring-agent/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 08:58:20 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[101 Reasons To Choose Monitis]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Monitis vs. Other services]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[agent-based monitoring]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.monitis.com/?p=2222</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/11/finding-security-performance-in-a-server-monitoring-agent/' addthis:title='Finding Security &#38; Performance in a Server Monitoring Agent '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Did you know that you can download monitoring agents from Monitis that check the health of your servers, networks and applications &#8212; regardless of whether your firewall is up and running? In fact, these agents (which work for all operating systems) are such a convenience for so many sysadmins and website masters that Monitis has [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.monitis.com/index.php/2011/06/11/finding-security-performance-in-a-server-monitoring-agent/' addthis:title='Finding Security &amp; Performance in a Server Monitoring Agent '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Did you know that you can download monitoring agents from Monitis that check the health of your servers, networks and applications &#8212; regardless of whether your firewall is up and running? In fact, these agents (which work for all operating systems) are such a convenience for so many sysadmins and website masters that Monitis has just published a new whitepaper &#8212; &#8220;<a href="http://portal.monitis.com/whitepapers/agent_security_performance.pdf">Monitis Internal Monitoring Agent: Security and Performance</a>&#8221; &#8212; to explain the workings behind the technology.</p>
<p>The whitepaper, which can be<a href="http://portal.monitis.com/index.php/resources/documents"> downloaded free</a> from Monitis&#8217;s portal, discusses how these agents deliver the monitoring results in real-time to the Monitis Main Server, to be further displayed via Monitis&#8217;s web-based dashboard. The information &#8212; sometimes not so good, as in, a site is down &#8212; also triggers warnings and critical alerts through a whole menu of notifications, for example, email, mobile phone, SMS, IMs, <a href="http://portal.monitis.com/index.php/products/notifications">Twitter</a> and URL callback.<span id="more-2222"></span></p>
<p>Monitis agents use the <a href="http://portal.monitis.com/index.php/products/open-ai">Monitis API,</a> which is <a href="http://monitis.com/api/api.html">well documented </a>and open.</p>
<p><a href="http://blog.monitis.com/wp-content/uploads/2011/06/servermonitoring.png"><img class="alignnone size-full wp-image-2235" title="servermonitoring" src="http://blog.monitis.com/wp-content/uploads/2011/06/servermonitoring.png" alt="Server Monitoring Diagram" width="365" height="454" /></a></p>
<p>Check out the diagram below to see how Monitis agents work:</p>
<p style="text-align: left;">If you&#8217;re thinking: &#8220;How will these agents affect my site?&#8221; or &#8220;Will Monitis&#8217;s tools slow down my server or network?&#8221; then you need to read this whitepaper &#8212; as it discusses how the Monitis agents perform, as well as how they operate securely (Don&#8217;t we have enough to worry about as far as security goes?).</p>
<p>For example, as far as performance goes, generally, the internal agent uses an Internet connection very economically: it requests the main server for current tests configuration every minute and then sends the accumulated test information every five minutes. And agents operating in both the Linux and Windows OSs use tiny bits of CPU and occupy modest amounts of virtual memory.</p>
<p>Now let&#8217;s talk security. Monitis agents provide standard security with the following features and practices:</p>
<ul>
<li>Encrypted HTTPs protocol (used for the connection with main server)</li>
<li>Client initiated encrypted HTTP &#8212; which eliminates altering firewalls, thus reducing risk for possible attacks</li>
<li>Heartbeat checks performed to ensure that agents are alive and connected with the main server</li>
<li>The tests configuration and necessary parameters are kept on the main server and sent periodically to the client by using an encrypted channel. Current configuration is stored by the client internally in the memory (not in the file);</li>
<li>The internal client does nothing other than testing and therefore cannot cause unpredictable system damage &#8212; that&#8217;s a Monitis guarantee;</li>
<li>Monitis performs daily and weekly backups, including backups to storage outside of the main server’s data center.</li>
</ul>
<p>Check out the new <a href="http://portal.monitis.com/whitepapers/agent_security_performance.pdf">whitepaper </a>for more detailed information on how Monitis agents work! And we&#8217;d love to get your feedback; please share.</p>
Share Now:<a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F11%2Ffinding-security-performance-in-a-server-monitoring-agent%2F&amp;title=Finding%20Security%20%26%20Performance%20in%20a%20Server%20Monitoring%20Agent&amp;notes=Did%20you%20know%20that%20you%20can%20download%20monitoring%20agents%20from%20Monitis%20that%20check%20the%20health%20of%20your%20servers%2C%20networks%20and%20applications%20--%20regardless%20of%20whether%20your%20firewall%20is%20up%20and%20running%3F%20In%20fact%2C%20these%20agents%20%28which%20work%20for%20all%20operating%20systems%29%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F11%2Ffinding-security-performance-in-a-server-monitoring-agent%2F&amp;title=Finding%20Security%20%26%20Performance%20in%20a%20Server%20Monitoring%20Agent&amp;bodytext=Did%20you%20know%20that%20you%20can%20download%20monitoring%20agents%20from%20Monitis%20that%20check%20the%20health%20of%20your%20servers%2C%20networks%20and%20applications%20--%20regardless%20of%20whether%20your%20firewall%20is%20up%20and%20running%3F%20In%20fact%2C%20these%20agents%20%28which%20work%20for%20all%20operating%20systems%29%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F11%2Ffinding-security-performance-in-a-server-monitoring-agent%2F&amp;t=Finding%20Security%20%26%20Performance%20in%20a%20Server%20Monitoring%20Agent" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F11%2Ffinding-security-performance-in-a-server-monitoring-agent%2F&amp;title=Finding%20Security%20%26%20Performance%20in%20a%20Server%20Monitoring%20Agent&amp;source=Uptime+%26amp%3B+Performance+Tips+Tips+for+SysAdmin%2C+Webmaster%2C+Network+Admin&amp;summary=Did%20you%20know%20that%20you%20can%20download%20monitoring%20agents%20from%20Monitis%20that%20check%20the%20health%20of%20your%20servers%2C%20networks%20and%20applications%20--%20regardless%20of%20whether%20your%20firewall%20is%20up%20and%20running%3F%20In%20fact%2C%20these%20agents%20%28which%20work%20for%20all%20operating%20systems%29%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow"   href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F11%2Ffinding-security-performance-in-a-server-monitoring-agent%2F&amp;Title=Finding%20Security%20%26%20Performance%20in%20a%20Server%20Monitoring%20Agent" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/blinklist.png" class="sociable-img sociable-hovers" title="BlinkList" alt="BlinkList" /></a><a rel="nofollow"   href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F11%2Ffinding-security-performance-in-a-server-monitoring-agent%2F&amp;title=Finding%20Security%20%26%20Performance%20in%20a%20Server%20Monitoring%20Agent" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/dzone.png" class="sociable-img sociable-hovers" title="DZone" alt="DZone" /></a><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F11%2Ffinding-security-performance-in-a-server-monitoring-agent%2F&amp;title=Finding%20Security%20%26%20Performance%20in%20a%20Server%20Monitoring%20Agent&amp;annotation=Did%20you%20know%20that%20you%20can%20download%20monitoring%20agents%20from%20Monitis%20that%20check%20the%20health%20of%20your%20servers%2C%20networks%20and%20applications%20--%20regardless%20of%20whether%20your%20firewall%20is%20up%20and%20running%3F%20In%20fact%2C%20these%20agents%20%28which%20work%20for%20all%20operating%20systems%29%20" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow"   href="http://reddit.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F11%2Ffinding-security-performance-in-a-server-monitoring-agent%2F&amp;title=Finding%20Security%20%26%20Performance%20in%20a%20Server%20Monitoring%20Agent" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/reddit.png" class="sociable-img sociable-hovers" title="Reddit" alt="Reddit" /></a><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F11%2Ffinding-security-performance-in-a-server-monitoring-agent%2F&amp;title=Finding%20Security%20%26%20Performance%20in%20a%20Server%20Monitoring%20Agent" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow"   href="http://twitter.com/home?status=Finding%20Security%20%26%20Performance%20in%20a%20Server%20Monitoring%20Agent%20-%20http%3A%2F%2Fblog.monitis.com%2Findex.php%2F2011%2F06%2F11%2Ffinding-security-performance-in-a-server-monitoring-agent%2F" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow"   href="http://blog.monitis.com/index.php/feed/" ><img src="http://blog.monitis.com/wp-content/plugins/sociable-30/pro/images/handycons/32/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.monitis.com/index.php/2011/06/11/finding-security-performance-in-a-server-monitoring-agent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

