<?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[ExternalParameterShellExec error]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I've bene using NetXMS for a long time, but I recently moved to a new set of servers and rain into some strange problems.<br />
I have the following script:<br />
#! /bin/bash<br />
LOG_FILE="/var/log/rating_engine.log"<br />
STATE=`/etc/init.d/vrrpd show_state`;<br />
if [[ ! -f "/tmp/ccup_running.lock" ]]; then<br />
  if [ "$STATE" = "State is master." ]; then<br />
          LAST_RUN=`tac $LOG_FILE | grep -m 1 "Billing ended" | tr -s ' ' | cut -d ' ' -f 1,2`<br />
          LAST_RUN_DATE=$(date -ud "$LAST_RUN" +'%s')<br />
          CURRENT_DATE=`date +%s`<br />
          TIME_DIFF=$((CURRENT_DATE-LAST_RUN_DATE))</p>
<p dir="auto">          if [ $TIME_DIFF -gt 180 ];then<br />
                  echo "1"<br />
          else<br />
                  echo "0"<br />
          fi<br />
  else<br />
          echo "0"<br />
  fi<br />
else<br />
  echo "0"<br />
fi<br />
The script returns 0 or 1, as needed, but on the NetXMS server I only have 0s</p>
<p dir="auto">In all older versions it has been working fine. On the new ones (NetXMS Core Agent Version 4.1.333 Build 4.1-333-gf37ab67d18 (UNICODE) in this case), the server always sees 0.<br />
When I try nxget from the server, I get:</p>
<p dir="auto">tac: write error: Broken pipe</p>
<p dir="auto">Also I noticed the when I try to add this as a new parameter for that node, I see the data type as "string" I am returning 0 or 1, and used to set these as Integer. How can I change the data type from the agent?</p>
]]></description><link>https://forum.netxms.org/topic/7478/externalparametershellexec-error</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 13:10:33 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7478.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 25 Jul 2022 13:02:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ExternalParameterShellExec error on Thu, 28 Jul 2022 17:40:38 GMT]]></title><description><![CDATA[<p dir="auto">At some point external parameters started to capture STDERR in addition to STDOUT. Most probably your script produces some sort of textual error that is being captured. Then NetXMS tries to interpret it as integer and this way it becomes 0.</p>
<p dir="auto">You can check with nxget</p>
<pre><code>nxget IP_ADDRESS_OF_AGENT name_of_the_parameter
</code></pre>
]]></description><link>https://forum.netxms.org/post/31696</link><guid isPermaLink="true">https://forum.netxms.org/post/31696</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Thu, 28 Jul 2022 17:40:38 GMT</pubDate></item></channel></rss>