Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Tursiops

#136
General Support / Re: snmp proxy need help
January 30, 2019, 02:50:19 AM
If I understood you correctly, you created an unmanaged node, but you do want to poll it for status, SNMP, etc.
You need the node (i.e. the NAS in your case) to be managed for this to work.

Unmanaged is more for devices that you can't or don't want to monitor but still want to see inside NetXMS.
#137
Hi,

If I understand correctly you want to monitor the state of MSSQL services (e.g. different instances) under Windows?

We use instance discovery for that. Agent List with List name System.Services.
An instance discovery filter script picks up any service that starts with "MSSQL$" in the name (excluding SQLEXPRESS) or is called "MSSQLSERVER" (default instance).
To restart the service if it fails, a threshold is triggered if the service is not running.
That threshold generates an event that in turn executes a Server Action via Event Processing Policies.
That action is a script (inside the NetXMS script library).
The script pulls out the service name from the parameters passed to it and executes a pre-configured action on the agent itself which effectively comes down to running "net start <servicename>".

The restart part can obviously be used for any service, not just MSSQL. :)

Hope that helps get you started.

Cheers
#138
Hm, for all I knowyou can import a script from the script library.
use <scriptname>;
You can then call a function that's been defined in that script, e.g.
return functionName(param1,param2);
We're using that for auto-bind rules (admittedly not for Transformations and Event Processing Filtering, we haven't had a need to try that yet).
#139
Yes, you'll need to upgrade.
I think your version is about four years old, there have been a lot of changes and improvements since then.
#140
Re-reading the original request, the filtering script can probably be even easier, as you really don't care about counting anything up (which the persistent storage would allow you to do).
You should be able to just use FindAlarmByKey to see if a matching alarm already exists, and if it does: return false, thus no new action will be triggered.
You still have to know the Alarm Key you'll be looking for though.
#141
I believe you'll have to create an ExternalParameter for that in your Linux agent configuration.
Something like the following should work (not pretty, I'm sure there's better ways):
ExternalParameter=System.LinuxService(*):service $1 status|grep Active|sed "s/.*Active: \(.*\) (.*/\1/"

Once you add that to your configuration (manually or via Agent Configuration Policy for any system determined to be running Linux and an Agent), you can reference it in your DCIs as System.LinuxService(<servicename>).
#142
Hi spiazza,

Without knowing the details of your setup, this is going to be a bit generic and definitely untested.

<identifier> needs to be something you can:
- take from the event message triggering the problem
- take from the event message showing the problem is resolved
Alternatively, if any device can only ever have one active alarm of this kind, you can simply replace it with something static like "AMCircuitState".
The event message is available as variable "EVENT_TEXT" in the filtering script (as per the hints available in the Filtering Script screen).

Filter script for Event Processing Policy when AM Circuit down is triggered:
CUSTOM_MESSAGE=sha1(<identifier>);
if ( #("node_".$node->id."_".CUSTOM_MESSAGE) != "" ) return false;
("node_".$node->id."_".CUSTOM_MESSAGE)=1;
return true;


More detailed explanation:
CUSTOM_MESSAGE=sha1(<identifier>);
Create a hash from your identifier. This will be used to create a unique alarm as well as a unique persistent storage variable.

if ( #("node_".$node->id."_".CUSTOM_MESSAGE) != "" ) return false;
If the persistent storage variable node_NODEID_CUSTOM_MESSAGE exists, return false. That means processing ends here (unless there is some other event processing policy that catches it). The variable should only exist if an alarm was triggered already. Also note: These persistent storage variables return an empty string, not null if they don't exist.

("node_".$node->id."_".CUSTOM_MESSAGE)=1;
If the variable doesn't exist we move on to this step, which sets it to 1. So next time the event triggers, it will run into the previous line and processing will end without triggering additional emails/actions.

return true;
Returning true, so the event triggers the configured actions.

Filter script for Event Processing Policy when AM Circuit up is triggered:
CUSTOM_MESSAGE=sha1(<identifier>);
if ( #("node_".$node->id."_".CUSTOM_MESSAGE) != "" ) ("node_".$node->id."_".CUSTOM_MESSAGE)=null;
return true;


Similar to the first script. This one will set the persistent storage variable to null (which removes it) and returns true, so you can trigger your actions to close the matching alert (and maybe send an email saying "all good, problem solved").

As actions you'd want:
1. Your email action
2. Generate an alarm with a key like "AMCircuitDown_%M". %M will be replaced with whatever is stored in "CUSTOM_MESSAGE" in your filter script.


Btw, if your event is triggered by a DCI, you can make your life a lot simpler by simply setting the "Repeat event" to "Never" in your DCI's threshold configuration.
I originally made the assumption your event is triggered by an SNMP Trap or Syslog message and may have sent you onto a more complicated track than necessary. :)

Cheers
#143
You are trying to import a binary file, not the actual dbinit file.
For Postgres, the file you need to import is named dbinit_pgsql.sql.
The documentation (https://www.netxms.org/documentation/adminguide/installation.html) gives the following sample command (your actual paths will likely differ):
/usr/local/bin/nxdbmgr init /usr/local/share/netxms/sql/dbinit_pgsql.sql
#144
I may be wrong in interpreting your screenshots, but it looks like you are expecting the "Count" column from the alert is passed on to the event processing policy.
However, the event processing policy processes events and can create/update alerts from those events. Not the other way around.
The count you are seeing is not the event, but the alert count (i.e. alert has been triggered that many times).
EPP would not be aware of that figure.

We're doing something somewhat similar for backup monitoring using increments on a persistent storage variable.
An alert is only triggered when that variable has reached a certain increment.
When the problem goes away, we receive the alert cancellation event and wipe the persistent storage variable again.
In our case it's a combination of DCI threshold script and event processing policy filter script (we're not using the actual "Persistent Storage" section in the event processing policy), in your case it would probably all be inside the event processing filter script.
#145
We're doing similar things and I agree that this would be a great feature in such scenarios: a "live" transform as data is read from the database, not before it is written to it. An alternative could be to have a way to show the comment part in/on the graph so you can see which value represents what.

Either way, for all I know right now that's not possible without doubling up on DCIs, i.e. creating a second DCI based on the first one. The first one is integer only, the second transforms the value into a string. That way you have both: string and integer history.
#146
General Support / Re: Main window completely missing?
December 20, 2018, 11:09:16 PM
The UI layout is not really dependent on the server.
But if you are using the WebUI and redeployed it, that probably would've fixed it (I'm not using it, so can't confirm).
Either way, it is possible to close the Object Details section. Happened to me more than once by accident. If it happens to you again, the mentioned steps should bring it it back from within the GUI without the need for upgrades or redeployments. :)
#147
General Support / Re: Main window completely missing?
December 19, 2018, 11:10:04 PM
You can probably get it back by clicking on View -> Object Details.
If that fails, right-click on the "Management" perspective button (by default in the top right corner) and select "Reset". That will reset all windows to the defaults.
#148
General Support / Re: SNMP - MIBs Walk Result is Blank
December 19, 2018, 10:59:45 PM
Hi,

Just to confirm:
- SNMP on the device itself is working, accessible from the NetXMS server (or the Proxy if you are using one) and the community is setup ok?
  If your device is not showing the SNMP sysName, Object ID, sysLocation, sysContact on the Overview tab, chance is something is wrong here.
- Does the device you are polling actually use that OID/MIB (I believe the HH3C MIB belongs to old HP products)?
  What brand/model is it?

Cheers
#149
General Support / Re: Script for synology NAS
December 19, 2018, 10:48:39 PM
This is not directly related, but if I understand your requirements correctly it may be simpler to use the DCI itself to generate the events, rather than running another script over it.
For example, add a transformation script to the DCI similar to this (that's taken from our matching Synology DCI):
switch ( $1 )
{
case "1": return "Healthy";
case "2": return "Repairing";
case "3": return "Migrating";
case "4": return "Expanding";
case "5": return "Deleting";
case "6": return "Creating";
case "7": return "Syncing";
case "8": return "Parity Checking";
case "9": return "Assembling";
case "10": return "Cancelling";
case "11": return "Degraded";
case "12": return "Crashed";
default: return "INVALID DATA (". $1 .")";
}

Then use Thresholds to trigger events based on the above. The data collected is passed on to the event.
You could also configure the thresholds to then automatically close any alerts (i.e. trigger a "normal/reset" style event and configure it to close matching alarms in the event processing policy) if the threshold goes back to normal.
All within the DCI without the need for calling an external script to read the DCI value.
#150
Hi,

In the bottom left you should see a few buttons (for any topics started by you): Remove Topic, Lock Topic and Topic Solved.

Cheers