Undestanding of module structure

Started by BrandStorm, June 04, 2012, 06:08:31 PM

Previous topic - Next topic

BrandStorm

Hi.
Does manual for module creation exist?
I'm confused about right understanding how to create module for netxms.
typedef struct
{
   DWORD dwSize;           // Size of structure in bytes
   TCHAR szName[MAX_OBJECT_NAME];
   void (* pfMain)(void);  // Pointer to module's main()
   int (* pfCommandHandler)(DWORD dwCommand, CSCPMessage *pMsg, ClientSession *pSession);
   BOOL (* pfTrapHandler)(SNMP_PDU *pdu, Node *pNode);
   BOOL (* pfEventHandler)(Event *event);
   HMODULE hModule;
} NXMODULE;


"pfMain" is used to create a new thread with module code, but is it possible to use NetXMS scheduler for managing actions from this module. For instance, if module gather some additional info from nodes (IPMI, iLO etc) how to inform the core to use this module as backend for such operations? As I understand currently I need to create own scheduler in my own module instead of use netxms one.

Victor Kirhenshtein

Hi!

Unfortunately there are no manual for that. In fact, currently only one module exist - for ATM video surveillance. There are no way to use module for DCI data gathering. What kind of module do you want to create? I can adjust module API or recommend better way.

Best regards,
Victor

BrandStorm

Hi Victor.
This could be usefull for agentless monitoring or 3-rd party service integration.
A couple of examples:
1. HW counters via IPMI/iLO/etc monitoring. This, of cource, can be done via subagent, but in that case we have no way to monitor HW only, when server is shutted down.
2. Remote monitoring via ssh/telnet. Some hardware provide ssh/telnet only interface (like storages, special controllers etc.) so we could simply create plugin and transform data to NetXMS native format
3. Some services can provide XML/JSON/Plain text/etc data and module can transform such structure to DCIs.


From my perspective a best way for that is to use modules which can offload such task. Also this maybe helpfull for server-server cooperation when master server asks DCIs for an object and module could request such information from remote server.

BrandStorm

Also a good idea to have AuthHandler to driver system's authentication. This is usefull when NetXMS became a back-end and current implementation is a bit complicated.