<?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[Endit a .bat file so XMS can alert]]></title><description><![CDATA[<p dir="auto">We currently run a batch file to warn of impending doom (ok when a system is down).<br />
Is there a way to get NetXMS to run this (or an internal version), but put the message in the highlighted section, so it would say 'Server %m is down'</p>
<p dir="auto">I'm no programmer, so simple is best <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--wink" style="height:1.4em;width:auto;vertical-align:middle" title=";-)" alt="😉" /></p>
<p dir="auto"><em>@echo off</em></p>
<p dir="auto"><em>c:\Rcmd \\exchange1 osql -S exchange1 -U sa -P ourpassword -Q "insert into VGSMDB..loglog (destination, content) values ('Majors','Server is back up and running.')"</em></p>
<p dir="auto"><em>pause</em></p>
<p dir="auto">Thanks.</p>
<p dir="auto">Stu</p>
]]></description><link>https://forum.netxms.org/topic/986/endit-a-.bat-file-so-xms-can-alert</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 21:03:44 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/986.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Sep 2010 14:36:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Endit a .bat file so XMS can alert on Tue, 28 Sep 2010 08:19:06 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">You have two options:</p>
<ol>
<li>Create an action of type "execute command on management server", entering your command in "command" field like following:</li>
</ol>
<pre><code>c:\\Rcmd \\\\exchange1 osql -S exchange1 -U sa -P ourpassword -Q "insert into VGSMDB..loglog (destination, content) values ('Majors','Server %n is down')"
</code></pre>
<p dir="auto">Note that all backslashes are doubled, because backslash is an escape character in action command definition, and you have to use \\ to get single backslash in command.</p>
<ol start="2">
<li>Modify you .bat file to accept server name as argument:</li>
</ol>
<pre><code>@echo off

c:\Rcmd \\exchange1 osql -S exchange1 -U sa -P ourpassword -Q "insert into VGSMDB..loglog (destination, content) values ('Majors','Server %1 is down')"

pause
</code></pre>
<p dir="auto">and define action to call it, with "command" field set to</p>
<pre><code>my_script.bat %n
</code></pre>
<p dir="auto">In both cases, just add this new action to appropriate rule in event processing policy.</p>
<p dir="auto">Hope this helps!</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/4482</link><guid isPermaLink="true">https://forum.netxms.org/post/4482</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 28 Sep 2010 08:19:06 GMT</pubDate></item></channel></rss>