<?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>logIt &#187; proprietary</title>
	<atom:link href="https://lakm.us/logit/tag/proprietary/feed/" rel="self" type="application/rss+xml" />
	<link>https://lakm.us/logit</link>
	<description>Log Around The Clock</description>
	<lastBuildDate>Sat, 06 Jun 2015 14:17:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>SNMP: Mistake of Using Tabular OID in Practice</title>
		<link>https://lakm.us/logit/2012/03/snmp-mistake-tabular-oid-practice/</link>
		<comments>https://lakm.us/logit/2012/03/snmp-mistake-tabular-oid-practice/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 07:57:58 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[General Linux]]></category>
		<category><![CDATA[appliance]]></category>
		<category><![CDATA[MIB]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[proprietary]]></category>
		<category><![CDATA[snmp]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=372</guid>
		<description><![CDATA[Recently, I retrieve rectifier-related SNMP data from Eltek&#8217;s Smartpack Controller. This one has the following rear type where we can connect to the ethernet plug (see the purple area). It is presumably in its default configuration and I can snmpwalk through its corporate specific OIDs (under 12148 tree) to find i.e. output voltage, current, battery [...]]]></description>
				<content:encoded><![CDATA[<p>Recently, I retrieve rectifier-related SNMP data from <a href="http://www.eltek.com/wip4/detail_products.epl?k1=25507&#038;close=1&#038;id=1123846" title="Eltek Smartpack Controller" target="_blank">Eltek&#8217;s Smartpack Controller</a>. This one has the following rear type where we can connect to the ethernet plug (see the purple area).</p>
<div class="wp-caption aligncenter" style="width: 460px"><img alt="Eltek Smartpack Controller type with SNMP Support" src="../../../../images/eltek-smartpack-rear-1.jpg" title="Eltek Smartpack Controller type with SNMP Support" width="266" height="103" /><p class="wp-caption-text">Eltek Smartpack Controller rear view (type that comes with SNMP support)</p></div>
<p>It is presumably in its default configuration and I can <code>snmpwalk</code> through its corporate specific OIDs (under 12148 tree) to find i.e. output voltage, current, battery temperature, etc. Doing it without translating against the MIB will retrieve all the values perfectly fine. However, I want to show you a mistake in practice related to how the MIB is written and put to place, which is a version 4 by the name of <a href="http://forums.manageengine.com/viewFile.do?fileId=49000003919231&#038;forumGroupId=49000000002007" title="Manage Engine Forum: ELTEK-DISTRIBUTED-PLANTV4-MIB">ELTEK-DISTRIBUTED-PLANTV4-MIB</a>. It has tabular part as clipped in the following tree (see <a href="./2011/09/write-mib-file-tabular/" title="Write Your Own MIB File (Tabular)" target="_blank">previous post</a> on how to write such part in your own MIB):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">            <span style="color: #000000; font-weight: bold;">|</span>     +--eltek<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">12148</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #000000; font-weight: bold;">|</span>        <span style="color: #000000; font-weight: bold;">|</span>
            <span style="color: #000000; font-weight: bold;">|</span>        +--eltekDistributedPlantV4<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
...
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>     <span style="color: #000000; font-weight: bold;">|</span>
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>     +--rectifierStatusTable<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>        <span style="color: #000000; font-weight: bold;">|</span>
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>        +--rectifierStatusEntry<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>  Index: rectifierStatusID
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>           +-- <span style="color: #660033;">-R--</span> Integer32 rectifierStatusID<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>        Range: 1..100
...
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>           +-- <span style="color: #660033;">-R--</span> Integer32 rectifierStatusOutputVoltage<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>           <span style="color: #000000; font-weight: bold;">|</span>        Range: 0..65535</pre></div></div>

<p>Looking at the above <code>rectifierStatusEntry</code> branch, it marks a tabular entry expected to range from 1 to 100 as defined by <code>rectifierStatusID</code>. Hence, putting 0 as one of the output voltage index will confuse the OID reported by <code>GET</code> as</p>
<ol>
<li>belong to the scalar type (a misconception that is)</li>
<li>belong to the tabular type but out of index range</li>
</ol>
<p><code>GET</code> against the MIB will return the following error</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> snmpget <span style="color: #660033;">-m</span> +ELTEK-DISTRIBUTED-PLANTV4-MIB <span style="color: #660033;">-v</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-c</span> public raddlex ELTEK-DISTRIBUTED-PLANTV4-MIB::rectifierStatusOutputCurrent.0
ELTEK-DISTRIBUTED-PLANTV4-MIB::rectifierStatusOutputCurrent.0: Unknown Object Identifier <span style="color: #7a0874; font-weight: bold;">&#40;</span>Index out of range: <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>rectifierStatusID<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>while the item (output current) actually has value in it as found below</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> snmpget <span style="color: #660033;">-v</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-c</span> public raddlex .1.3.6.1.4.1.12148.9.5.5.2.1.3.0
SNMPv2-SMI::enterprises.12148.9.5.5.2.1.3.0 = INTEGER: <span style="color: #000000;">1</span></pre></div></div>

<p>By this time the MIB is already the latest to be used with firmware version 4.3.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2012/03/snmp-mistake-tabular-oid-practice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
