What's Changed
Lua
The biggest new change here is the re-added Lua support.
The Lua support has been changed a bit so it might not be 100% compatible with old scripts.
As there is not much documentation for Lua scripting, I plan to add that soon.
And doing that I will highlight the main differences.
One thing still missing in Lua is protocol buffer support
This means you can only create "simple function" is returning code, string and performance data. But given the nature of Lua I think this is acceptable for the time being.
But in general "optional parameters" to functions are no longer optional.
So for instance:
local reg = Registry()
reg:simple_function('lua_test', test_func_query)
local settings = Settings()
str = settings:get_string('/settings/lua/scripts', 'testar')
local core = Core()
code, msg, perf = core:simple_query('lua_test')
Will now require to be written as:
local reg = Registry()
reg:simple_function('lua_test', test_func_query, '')
local settings = Settings()
str = settings:get_string('/settings/lua/scripts', 'testar', '')
local core = Core()
code, msg, perf = core:simple_query('lua_test', {})
The other change is that construction object is now generally done with new
where before it was done with various functions like Core()
here however I have retained backwards compatibility so both should be possible.
But in general the quality of error handling and such is much better and I will as I said expand the documentation and add some more examples and such.
check_mk
As a side note experimental check_mk
support was also added back.
This is experimental in so far as I have only verified it with NSClient++ not actual check_mk
so will need to look into that next.
Also note that check_mk
is experimental currently it only provides the version and agent name.
If there is genuin interest this could easily be extended so please do let me know...
The way check_mk
works is that the module only provides the communication layer and the data provided is provided by a Lua script (hence requiring Lua support).
So the current script looks like so:
function server_process(packet)
s = section.new()
s:set_title("check_mk")
s:add_line("Version: 0.0.1")
s:add_line("Agent: nsclient++")
s:add_line("AgentOS: Windows")
packet:add_section(s)
end
reg = mk.new()
reg:server_callback(server_process)
So here we need to extend the packet to include more data and other sections for proper check_mk
support.
Other Changes
- Fix typo in documentation by @Napsty in #903
- Marked Dotnet and modules as deprecated in documentation.
- Reformatted all code by @mickem in #917
Status
With this change most features should now be back (apart from dotnet which is deprecated) the only things remaining are:
- Protocol buffer support for Lua.
- CheckPowerShell: A module adding native power-shell support to NSClient++ (this will likely be re-implemented in the future with Rust)
- CheckDocker: This needs to be looked into (not sure of the status)
That said there are some dependencies which needs to be updated and managed a bit better still but that will happen in parallell while adding support for modern Windows.
Dependencies
- Python: 3.11
- Open ssl: 1.1.1w
- Protocol buffers: 21.12
- Boost: 1.82.0
- CryptoPP: 8.8.0
- Lua: 5.4.7
- Mongoose: ?
- json-spirit: ? (Will be replaced by native support in boost)
- miniz: ?
- tinyxml: ?
New Contributors
Full Changelog: 0.6.11...0.6.12