<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[deleteRow issues]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I have some SNMP tables I would like to delete rows from. Looks like I should use the deleteRow function for that.<br />
Unfortunately I can't get it to work.<br />
I have attached a CSV with actual data from one of the tables. The script I am using is below:</p>
<pre><code>sub main()
{
	idxStatus = $1-&gt;getColumnIndex("Status");
	for (i = 0; i &lt; $1-&gt;rowCount; i++)
	{
		trace(0,$1-&gt;get(i,idxStatus));
		if ( $1-&gt;get(i,idxStatus) == "Unavailable" )
		{
			trace(0,"Deleting Row");
			$1-&gt;deleteRow(i);
		}
	}
}
</code></pre>
<p dir="auto">As you can see, I added some debugging output already.<br />
Here's the result from the logs. Based on that I would have expected the "Unavailable" rows to disappear from the table:</p>
<pre><code>[29-Jan-2016 21:21:27.892] [INFO ] Healthy
[29-Jan-2016 21:21:27.892] [INFO ] Healthy
[29-Jan-2016 21:21:27.892] [INFO ] Healthy
[29-Jan-2016 21:21:27.892] [INFO ] Healthy
[29-Jan-2016 21:21:27.892] [INFO ] Healthy
[29-Jan-2016 21:21:27.892] [INFO ] Healthy
[29-Jan-2016 21:21:27.892] [INFO ] Healthy
[29-Jan-2016 21:21:27.892] [INFO ] Healthy
[29-Jan-2016 21:21:27.892] [INFO ] Healthy
[29-Jan-2016 21:21:27.893] [INFO ] Healthy
[29-Jan-2016 21:21:27.893] [INFO ] Healthy
[29-Jan-2016 21:21:27.893] [INFO ] Healthy
[29-Jan-2016 21:21:27.893] [INFO ] Healthy
[29-Jan-2016 21:21:27.893] [INFO ] Healthy
[29-Jan-2016 21:21:27.893] [INFO ] Unavailable
[29-Jan-2016 21:21:27.893] [INFO ] Deleting Row
[29-Jan-2016 21:21:27.893] [INFO ] Unavailable
[29-Jan-2016 21:21:27.893] [INFO ] Deleting Row
</code></pre>
<p dir="auto">Yet, they are not deleted. Am I using the deleteRow function incorrectly?</p>
<p dir="auto">I also found some other oddity in that sometimes the logs return rather strange results:</p>
<pre><code>[29-Jan-2016 21:51:44.313] [INFO ] ??althy
[29-Jan-2016 21:51:44.313] [INFO ] ??althy
[29-Jan-2016 21:51:44.313] [INFO ] w?althy
[29-Jan-2016 21:51:44.313] [INFO ] ??available
[29-Jan-2016 21:51:44.313] [INFO ] V?available
</code></pre>
<p dir="auto">Is that an indication of the SNMP packets coming back with corrupt data?</p>
<hr />
<p dir="auto"><a href="/assets/uploads/files/smf/0000000002803-results.csv">results.csv</a></p>
]]></description><link>https://forum.netxms.org/topic/4262/deleterow-issues</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 13:19:36 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/4262.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Jan 2016 11:23:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to deleteRow issues on Thu, 18 Feb 2016 02:49:30 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Answering my own question here, as it turned out to be a rather obvious bug in my script.<br />
Deleting a row changes the row count, so whenever I delete a row, I also have to decrease "i" again, i.e. run an i--.</p>
<p dir="auto">The other issue appears to indeed just be some broken SNMP agent producing rubbish data for that particular set that I was testing my code with. Even without any transformation applied, that particular DCI still produces nonsense more often than not - while all other DCIs on the same system work perfectly fine. Unlucky coincidence. <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f610.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--neutral_face" style="height:1.4em;width:auto;vertical-align:middle" title=":|" alt="😐" /></p>
<p dir="auto">Anyway, works as expected now.</p>
]]></description><link>https://forum.netxms.org/post/19269</link><guid isPermaLink="true">https://forum.netxms.org/post/19269</guid><dc:creator><![CDATA[Tursiops]]></dc:creator><pubDate>Thu, 18 Feb 2016 02:49:30 GMT</pubDate></item></channel></rss>