Changing Event Source

Started by jdl, November 08, 2010, 05:57:29 PM

Previous topic - Next topic

jdl

Hi,


Is there a way to change the event source?
Here is the purpose of this request...

Let's assume a server for a particular service piles up information on different entities in some log file. You are only able to install NetXMS agent on this server, not on other entities. But through the log file you can identify some status information for each entity. Now I want to parse this log file, extract the alarms and depending on the entity identified through the parsed text, I want to generate an alarm for that particular entity. So if alarm is critical, the event shall popo up in the entity alarm list and not in the server (where the log file is located) event/alarm list.

also in the event log, the node name/address shall be the one of the entity and not the one of the server.

Is there an $event->source attribute or sth similar?

BTW.: I would appreciate if you could post the list of attributes for event and node if it has changed since last time. Any other objects that event and node? What attribute?

Many thanks in advance
Best regards,

Jdamien

Victor Kirhenshtein

Hi!

It's not possible now to change event source directly - only by resending event via external commands on behalf of different node. I'll think about built-in functionality for changing event source or easy event resending.

Best regards,
Victor

jdl

If I may select one or the other... I would prefer a generic series of built-in fonctions to manage and produce event from within scripts.
A kind of SendEvent enabling triggering events from within NXSL scripts with all possible arguments configurable by user. And especially the source of the event  ;)

BTW: a similar command line would be powerful as well to integrate in external PERL (and Co) scripts.

Best regards,

Jdamien

Victor Kirhenshtein

Command line tool for integration already exist - it's called nxevent. It's available on WIndows in server and management console packages, and if you need to build it on UNIX, you must use --with-client option for configure. This tool uses client library for communication with server, and therefore requires login and password. User used for sending event must have "Send events" right on object given as source for event.

Best regards,
Victor

jdl

This sounds great...

I tried it on Linux (I have compiled server with --with-client option). Here is the error I get:

/usr/local/netxms/bin/nxevent -u <user> -P <passwd> -o 12 <server_ipAddr> 1000009
Unable to send event: Invalid or unknown event code

Could you, please, describe a bit more the differnet parameters required. Only options are describedd in the "help" page.

Best regards,
Jdamien

Victor Kirhenshtein

Most likely you have one extra 0 in your event code. Automatically assigned codes starts with 100000, so 100009 could be correct.

Parameters after event code are event-specific data, accessible on server via %1, %2, etc. macros and appropriate variables in NXSL scripts.

Best regards,
Victor

jdl

Correct - one '0' too much.
Sorry for that.

It works
Br,

Jdamien