<?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[Dumb question - is it me or is Object Tools not playing correctly?]]></title><description><![CDATA[<p dir="auto">Wondering if anybody else has hit this problem - I am pretty sure I am not the first - and was wondering what I am missing.</p>
<p dir="auto">Trying to add to my expanding collection of Object tools / Alarm tools - but having some bad luck with Alarms. I want an Alarm Tool to create a Help Desk ticket via PowerShell but NetXMS is not acting as expected.</p>
<p dir="auto">I do not think it is the extremely limited documentation - I think it is an inconsistency in parameter availability.</p>
<p dir="auto">The command below is designed to get the Alarm message either in its entirety, a specific variable, or even the Event Message, the severity and the time the alarm occurred.</p>
<p dir="auto">The only documentation that half helped is this - <a href="https://netxms.readthedocs.io/projects/admin/en/latest/event-processing.html?highlight=message#event-processing-macros" rel="nofollow ugc">https://netxms.readthedocs.io/projects/admin/en/latest/event-processing.html?highlight=message#event-processing-macros</a><br />
as well as section 23.2.1 of the 2.2.11 admin guide (which lists in a table the fields available - but are for Event Processing Policy only??)</p>
<p dir="auto">The problem is as follows:</p>
<ol>
<li>Time of the alarm is not passed. %t is empty</li>
<li>%m passes the first word only.</li>
<li>NetXMS passes the rest of the message as variables (no idea what name) using a blank as the separator. I have added additional variables just to pick up them up.</li>
<li>Fortunately, using PowerShell names variables, the input variable is passed successfully, even if PowerShell has it last in its list.</li>
<li>I can export the Alarm as CSV and Message field and Created Time are correct and complete - exactly what I want - but seemingly impossible to achieve.</li>
<li>An alarm that has special characters such as / % , etc. cause NetXMS to hang the execution - either never finishes or terminates with blank output.</li>
<li>It would appear %A would do it - but that is empty - tried that as well.<br />
 <br />
This can be reproduced by anyone as per below. I changed %t to %c as %t caused the script to hang - using %c allows me to see that the -c Code  variables is working.</li>
</ol>
<p dir="auto">My Object tool command (local script): It has one input - variable name  is pass. The command does produce output 9tick the box)</p>
<pre><code>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe c:\scripts\create-inc-from-alarm.ps1 -device  %n  -sev %s -tyme %c -pd %(pass) -msg %m
</code></pre>
<p dir="auto">My PowerShell is as follows:</p>
<pre><code>Param(
[string]$device,
[string]$msg,
[string]$tyme,
[string]$sev,
[string]$m1,
[string]$m2,
[string]$m3,
[string]$m4,
[string]$m5,
[string]$m6,
[string]$m7,
[string]$m8,
[string]$m9,
[string]$m10,
[string]$m11,
[string]$pd)


write-host  " Alarm on $device with msg $msg $m1 $m2 $m3 $m4 $m5 $m6 $m7 $m8 $m9 $m10 $m11 that occured at $tyme with severity $sev using pass $pd "
</code></pre>
]]></description><link>https://forum.netxms.org/topic/6049/dumb-question-is-it-me-or-is-object-tools-not-playing-correctly</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 20:48:23 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/6049.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Jul 2019 13:04:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dumb question - is it me or is Object Tools not playing correctly? on Mon, 15 Jul 2019 14:29:54 GMT]]></title><description><![CDATA[<p dir="auto">Hi Victor - thanks for that - except that you are not correct - but you were close enough!!</p>
<p dir="auto">I thought I had tried your suggestion and failed - but tried it again - and failed again. <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--disappointed" style="height:1.4em;width:auto;vertical-align:middle" title=":(" alt="😞" /></p>
<p dir="auto">Tried double double quotes - no good. <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--disappointed" style="height:1.4em;width:auto;vertical-align:middle" title=":(" alt="😞" /> <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--disappointed" style="height:1.4em;width:auto;vertical-align:middle" title=":(" alt="😞" /></p>
<p dir="auto">Tried triple double quotes - and it worked!!   <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /> <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" />  ;D</p>
<p dir="auto">Other than %t being empty, I got the whole message in %m . </p>
<p dir="auto">This works:<br />
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe c:\scripts\create-inc-from-alarm.ps1 -device  "%n" -sev "%s" -tyme """%t""" -pd "%(pass)" -msg """%m"""</p>
<p dir="auto">The only two questions that remain are a follows:</p>
<ol>
<li>Is time Alarm Created available? - %t is empty</li>
<li>Can I get the Event message? I would like this so I can create the ticket with Event Message which I create as a summary of the alarm.</li>
</ol>
]]></description><link>https://forum.netxms.org/post/26125</link><guid isPermaLink="true">https://forum.netxms.org/post/26125</guid><dc:creator><![CDATA[paul]]></dc:creator><pubDate>Mon, 15 Jul 2019 14:29:54 GMT</pubDate></item><item><title><![CDATA[Reply to Dumb question - is it me or is Object Tools not playing correctly? on Mon, 15 Jul 2019 13:20:15 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">you have to wrap message (and anything that can have space in it) into double quotes, like this:</p>
<p dir="auto">C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe c:\scripts\create-inc-from-alarm.ps1 -device  "%n" -sev %s -tyme %c -pd "%(pass)" -msg "%m"</p>
<p dir="auto">then you should have full message text in msg.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/26122</link><guid isPermaLink="true">https://forum.netxms.org/post/26122</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 15 Jul 2019 13:20:15 GMT</pubDate></item></channel></rss>