<?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[Logwatch function]]></title><description><![CDATA[<p dir="auto">I have 1 server on witch netxms is watching ~20 log files. I get event about every matched entry. But i want get only one notification independent of issues are 1 or 3 or 30. What and how i need configure in netxms node to get only one notification.</p>
<p dir="auto">A</p>
]]></description><link>https://forum.netxms.org/topic/1025/logwatch-function</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 09:26:33 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/1025.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 10 Nov 2010 12:57:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Logwatch function on Mon, 03 Jan 2011 20:27:11 GMT]]></title><description><![CDATA[<p dir="auto">Yes, that means that you are running 1.0.8. I'll check this.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/4943</link><guid isPermaLink="true">https://forum.netxms.org/post/4943</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 03 Jan 2011 20:27:11 GMT</pubDate></item><item><title><![CDATA[Reply to Logwatch function on Tue, 28 Dec 2010 15:37:27 GMT]]></title><description><![CDATA[<p dir="auto">Hi Victor!</p>
<p dir="auto">I'm not 100% sure how to get the version info, but when I go to the Server Console it comes up as "NetXMS Server Remote Console V1.0.8 Ready"</p>
<p dir="auto">Not that it would probably matter, but the Logwatch agent is also 1.0.8 as is the console.</p>
<p dir="auto">The only time I noticed an issue with the pointer notation was in the filtering script.</p>
<p dir="auto">Thanks!</p>
<p dir="auto">Torry</p>
]]></description><link>https://forum.netxms.org/post/4936</link><guid isPermaLink="true">https://forum.netxms.org/post/4936</guid><dc:creator><![CDATA[twillia1]]></dc:creator><pubDate>Tue, 28 Dec 2010 15:37:27 GMT</pubDate></item><item><title><![CDATA[Reply to Logwatch function on Mon, 27 Dec 2010 21:05:20 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">What version of NetXMS server you are using? There was a bug with accessing situation attributes using -&gt; operator, but it was fixed in 1.0.8.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/4935</link><guid isPermaLink="true">https://forum.netxms.org/post/4935</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 27 Dec 2010 21:05:20 GMT</pubDate></item><item><title><![CDATA[Reply to Logwatch function on Wed, 29 Dec 2010 00:47:53 GMT]]></title><description><![CDATA[<p dir="auto">Hi Victor,</p>
<p dir="auto">Thanks for your reply! Everything worked the way you said except for one thing: Using the pointer notation inside the filtering scripts does not appear to work. For example, this works:</p>
<p dir="auto">CUSTOM_MESSAGE = GetSituationAttribute(s, "FaxCount") + 1;</p>
<p dir="auto">but this does not:</p>
<p dir="auto">CUSTOM_MESSAGE = (s-&gt;FaxCount) + 1;</p>
<p dir="auto">It could be that I don't have the syntax right, but throughout my testing, the GetSituationAttribute always worked.</p>
<p dir="auto">So for people that may want to do this in the future, I'll post this in more detail.</p>
<ol>
<li>Go into Events and define custom event(s) that you want to look for. In my case, I also set up an event to reset the error counter to zero (a "normal" event). An EventID will automatically be assigned.</li>
<li>On the monitored server, set up the event log agent to generate the events in #1. Don't forget the event to reset the error counter to zero from #1.</li>
<li>Define a situation.</li>
<li>Add an event processing rule for the "normal" event in #2. In the Situation column, have it set a counter attribute (for the applicable instance) to zero.</li>
<li>Add event processing rules for the "exception"-type events from #2. In the script column, do the following:</li>
</ol>
<pre><code>sub main() {
  s = FindSituation("MySituation", "MyInstance");
  if (s != NULL) {
    CUSTOM_MESSAGE = GetSituationAttribute(s, "MyCounter") + 1; }
  else {
    CUSTOM_MESSAGE = 1;
  }
  return true;
}
</code></pre>
<p dir="auto">For each "exception" event, in the Situation column, set the MyCounter attribute to "%M" (no quotes)<br />
6) Add an event processing rule with the following script:</p>
<pre><code>sub main() {
   s = FindSituation("MySituation", "MyInstance");
   if (int32(GetSituationAttribute(s, "MyCounter"))==5) {
     return true; }
   else {
     return false;
   }
}
</code></pre>
<p dir="auto">On this same line, set up a custom email or text message action to advise you when the situation has occurred.</p>
<p dir="auto">NOTE that the test for the counter uses the equals operator rather than "greater than." If you use "greater than" you will still get tons of emails/messages.</p>
<p dir="auto">Once the "normal" even described in #1 occurs, it will set the counter back to zero.</p>
]]></description><link>https://forum.netxms.org/post/4934</link><guid isPermaLink="true">https://forum.netxms.org/post/4934</guid><dc:creator><![CDATA[twillia1]]></dc:creator><pubDate>Wed, 29 Dec 2010 00:47:53 GMT</pubDate></item><item><title><![CDATA[Reply to Logwatch function on Fri, 24 Dec 2010 11:29:52 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">There are two different problems. One is a bug in console - it does not show attributes under instances even if they exist. But your main problem is that situation attributes are read only, i.e. you cannot do s-&gt;counter = s-&gt;counter+1; in your script. I will do something to simplify that, but currently you have only two relatively complicated workarounds:</p>
<ol>
<li>In matching script in the rule, set variable CUSTOM_MESSAGE to new counter value, and in "Situation" column, set attribute counter to value "%M" (without quotes).</li>
<li>Set counter's value to %{your_script}, and create script in the library which will increase the counter. For example, you can use %{IncreaseFaxCounter} and create script named <strong>IncreaseFaxCounter</strong> in script library like this:</li>
</ol>
<pre><code>s = FindSituation("Multiple FAXes printed", "FaxFinder");
if (s != NULL)
    return int32(s-&gt;counter) + 1;
return 1;
</code></pre>
<p dir="auto">It will return either increased counter value or 1 if counter was not set before.</p>
<p dir="auto">In any case you will have two rules - one for updating counter and second to match required counter value and perform required actions. You will also need to reset counter somewhere.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/4930</link><guid isPermaLink="true">https://forum.netxms.org/post/4930</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Fri, 24 Dec 2010 11:29:52 GMT</pubDate></item><item><title><![CDATA[Reply to Logwatch function on Thu, 23 Dec 2010 14:22:43 GMT]]></title><description><![CDATA[<p dir="auto">I'll add to this question...</p>
<p dir="auto">I want to get notified via text message if a certain critical error occurs in a process on a monitored server. However, this critical error could happen 300 times before I can get in and fix it. I do not want to get 300 text messages!  <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f62e.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--open_mouth" style="height:1.4em;width:auto;vertical-align:middle" title=":o" alt="😮" />  So I'd like to create a situation that states "if this event occurs x number of times, continue processing the event and send the email."</p>
<p dir="auto">I created a situation and instance with an attribute "counter"</p>
<p dir="auto">There is an event that runs first that sets the attribute "counter" to zero. That event processing is running; however, when I look in "View Situations" I can't see the "counter" attribute value. I have another event script that as follows:</p>
<p dir="auto">sub main() {<br />
  s = FindSituation("Multiple FAXes printed", "FaxFinder");<br />
  if (s != NULL) {<br />
    s-&gt;counter = s-&gt;counter+1;<br />
    if (s-&gt;counter &gt; 5) {<br />
      return true; }<br />
    else {<br />
      return false;<br />
    }<br />
  }<br />
}</p>
<p dir="auto">It seems like if I could get the counter attribute to work this might work, but I can't even see the counter attribute. I still get the email every time, so the script is not processing. Not sure if I'm doing this correctly or not?</p>
]]></description><link>https://forum.netxms.org/post/4926</link><guid isPermaLink="true">https://forum.netxms.org/post/4926</guid><dc:creator><![CDATA[twillia1]]></dc:creator><pubDate>Thu, 23 Dec 2010 14:22:43 GMT</pubDate></item><item><title><![CDATA[Reply to Logwatch function on Thu, 11 Nov 2010 15:28:22 GMT]]></title><description><![CDATA[<p dir="auto">Hi there</p>
<p dir="auto">I have a similiar situation. Every time an event is raised in the Windows Eventlog Logwatch creates an event. For some situations I would prefere to be noticed only once (after numerous events) or likely in the DCI configuration just raise an event if  there are more than one consecutive samples.</p>
<p dir="auto">Does someone know a solution here? Are there any plan to implement that.</p>
<p dir="auto">Thank you</p>
<p dir="auto">Joël</p>
<p dir="auto">Btw: This Monitoring Software is genious.</p>
]]></description><link>https://forum.netxms.org/post/4654</link><guid isPermaLink="true">https://forum.netxms.org/post/4654</guid><dc:creator><![CDATA[joel4321]]></dc:creator><pubDate>Thu, 11 Nov 2010 15:28:22 GMT</pubDate></item></channel></rss>