source: nscp/trunk/readme.txt @ 079055f

Last change on this file since 079055f was 079055f, checked in by Michael Medin <michael@…>, 8 years ago

Verified NSCLient compatiblity for many commands and some minor tweaks (now most NSClient commands are OK)

  • Property mode set to 100644
File size: 4.4 KB
Line 
1** ROUGH DRAFT **
2** Spelling missate etc... :) **
3
4
5NSClient++ is a windows service that allows performance metrics to be gathered by Nagios
6(and possibly other monitoring tools). It is an attempt to create a NSClient compatible
7but yet extendable performance service for windows.
8
9
10Installation:
11NSClient++ -install
12Will install the NT service
13
14NSClient++ -uninstall
15Will uninstall the service
16
17NSClient++ -start
18Will start the service
19
20NSClient++ -stop
21Will stop the service
22
23NSClient++ -test
24Will start in interactive mode:
25enter exit<return> to exit. ANything else will be interpreted as a command ie: foo&bar<enter> will be interpreted as a command name foo with argument bar.
26It also listens to the port in this mode so it can be used to run the client standalone.
27Notice output is *NOT* piped t othe stdard output unless you enable the console logger module.
28
29
30
31
32
33The API is quite simple:
34The following functions are available for a module to "export": (think DLL)
35
36NSLoadModule
37- Loading of modules (done when the service starts)
38NSGetModuleName
39- Used to get a nice name for the module.
40NSGetModuleVersion
41- Not really used but...
42NSHasCommandHandler
43- Let the "core" know it can handle commands (from nagios)
44NSHasMessageHandler
45- Used to let the "core" know it wants to see all log/debug/error messages that are generated.
46NSHandleMessage
47- Used to digest a log/debug/error message.
48NSHandleCommand
49- Used to (possibly) digest a command.
50When a command is "injected" then command is parsed and then sent along to all plugins (which accept commands) in order (they are listed in NSC.ini) and they are allowed to act on the command. If they do act on the command the "injection" is aborted and the resulting "return string" is returned to the "injecter" (normaly check_nt through a TCP stream. The ordering can thus be used to 1, optimize if things are slow (though I fail to see that unless someone makes some pretty f*cked up modules) and priority if one module overlaps the command of another (though then I would recommend someone to change the plugin command strings :)
51
52NSUnloadModule
53- Used to unload and terminate "stuff" nicely. (Generally this is when the service terminates)
54NSModuleHelperInit
55- Used to send along callbacks to the module (for making calls to the "core". (Ie. To allow the module to inject commands, get versions, names, and settings)
56
57So the API is quite simple and straight forward (I hope :)
58
59To make a simple call graph:
60
61* Service starts:
62* For each plugin
63        - call NSLoadModule
64        - call NSModuleHelperInit
65        - if NSHasCommandHandler
66                . Send to "command plugin" stack
67        - if NSHasMessageHandler
68                . Send to "message plugin" stack
69* Wait for socket data
70        - Parse socket data
71        - For each "command plugin"
72                . call NSHandleCommand
73                . if Command handled abort
74
75<termination signal sent to service>
76* For each plugin
77        - NSUnloadModule
78* Terminate service
79
80<Log/debug/error message generated in a module>
81* On incoming message:
82        - For each "message plugin"
83                . call NSHandleMessage
84
85There are a few more things to this but overall I have tried to keep things simple.
86
87The extensions (to the API) I'm considering as of now (depending on the fallout) is:
88* "SettingsHandler" to allow registry/INI/* settings modules. As the overhead of reg/ini settings system is quite low, perhaps this is overkill. But I don't know: thinking wildly there might be a reason for someone to want to load settings from a central server or whatever :)
89
90* "SocketHandlers" though this will not be a specific handler I have considered to refactor out the code and allow the socket handler (that reads the TCP socket and parses the command) to be a plugin when I do SSL as I assume SSL will come with quite a high overhead and thus I might not need it all the time.
91
92Also as mentioned this might be a good place to do a NRPE socket parser module to allow compatibility with NRPE. But this I assume is a bit in the future as I need to get "NSClient++" before I can get "NRPEClient++"...
93
94As for PassiveChecks that could be implemented as a plugin today as any plugin can inject commands into the "core". Thus a plugin can be loaded, have a background thread that every X minutes calls "core".injectCommand(); and sends the result over to nagios. (This is how I assume that passive checks work)
95
96
97
98
99// Michael Medin - michael <at> medin <dot> name - http://www.medin.name
Note: See TracBrowser for help on using the repository browser.