NSClient++ in the new millenium! (re)discovering NSClient++ Project: NSClient++ Web: http://nsclient.org
No disclaimer this time Still your fault though!
dev not ops Michael Medin worked in ops a long time ago by misstake work with soa not, C/C++, nagios, neteye,
No agenda either
C++ linux and windows <0.4.0 About Since 2003? NSClient++ (the program) Open source not open core 0.4.0: 2012-05-xx modular (pluggable) 0.4.1: 2012-10-xx 0.4.1 is stable! 0.4.2: 2013-08-xx?
one-man-band About NSClient++ (the project) no company, no commercial version, no payed time but Please sponsoring! don t be angry! Some donations! times =$? No, I am feedback busy support?
Update the wiki! Fork me on github NSClient++ (What can I do?) Respond in the forums Submit patches Submit bug reports Come with ideas Tell me what you need!
* Fixed two include files issues * Fixed Wix 3.7 and added wix to dependencies * Added nsclient-full.ini with "all" (non advanced) avalible options. * Fix for reloading settings from file from script: core:reload('settings') will not work. Notice it still will onlya reload the settings not the modules so modules have to be reloaded manually. * Fixed return code issue in nsclient-ini full generator. * Added support for delayed reloading * Fixed crash when collector thread is not started. * Fixed message dialog when loading PythonScript module without python installed. * (re)add check_fiulesize which was accidentally removed. * Fix for http settings * fix for --version command line option * Reverted default NRPE encoding to "system" (not UTF-8). * Added new option to configure NRPE encoding: [/settings/nrpe/server] encoding = utf8 Valid values are currently system and utf8 (and strangely enough utf7). If you need something else let me know. * Added option scan-range to CheckEventLog. This new option reduces the entries scanned a *lot* and can help solve memory, time and CPU issues. The idea is that is negative we start scanning from the end and once we hit something outsiden the range we stop scanning. There is a chanse that entries reported are "outside" the range so set range bigger then generate/written date/times (to reduce this risk). CheckEventLog file=application file=system MaxWarn=1 MaxCrit=1 "filter=generated gt -1h AND level eq 'info'" truncate=800 unique descriptions "syntax=%severity%: %source%: %message% (%count%)" Executes in 7 seconds adding scan-range=-5h executes in 0 seconds (yields the same result). * Added error message when overriding a commad (ie. when alias check_cpu overrides the new command check_cpu). Wont work (for technical reasons) for duplicate aliases ie.- alias x=foo and x=bar * Fixed path issues in the installer * Fixed shortcuts in the installer * Fixed so clients can understand no prefixed arguments ie.... -c nrpe_query -a command=check_ok host=129.168.0.1 * Added option to disable new alias check_cpu and only register old ones CheckCPU NSClient++ (What s new 0.4.1) [/settings/default] modern commands=false * Improved exception handling in server threads * Fixed crash in NRPE server when payload was to large (#585 #582) * Fixed issue with lua unit test * Added payload length simulation in lua unit tests (so it returns various payload sizes) * Added nscp.sleep to Lua scripts (but dont use as I will implement coroutines in 0.4.2) * Fixed registry settings bug * Fixed issue with parsin performance data with leading spaces * Fixed issue with rendering filters * Created nscpnobp.exe which is a version without break pad for older machines (windows 2000 and nt4). This can only be foundin the zip file (not the msi) * Added some missing file to zip * Removed counters.defs since it is not used anymore * CheckEventLog: Added debug message lisgin all loaded filters to make it simpler to detect missing once * SimpleCache: Added keywords not-found-msg and not-found-code option to configure the outcome of "item not found". check_cache index=foobar "not-found-code=doch! item was not found" not-found-code=critical * CheckProcess is no longer case sensetive * CheckServiceState: added support for pending states * CheckDriveSize now supports regular expressiion filtering: CheckDriveSize ShowAll MaxWarn=1M MaxCrit=2M CheckAll=volumes matching=.*[cd].* * CheckFiles filter is now optional (not specifying a filter will find all files matching) * CheckFiles no longer matching. and.. * Added perf-unit to allow for stable performance data units (if not specified it will guess which is the current solution). checkmem type=paged MaxWarn=80% perf-unit=m => 'paged bytes %'=34%;80;0 'paged bytes'=8454.04m;19629.84;0;0;24537.3 checkmem type=paged MaxWarn=80% perf-unit=k => 'paged bytes %'=34%;80;0 'paged bytes'=8655200k;20100963.19;0;0;25126204 checkmem type=paged MaxWarn=80% perf-unit=b => 'paged bytes %'=34%;80;0 'paged bytes'=8872108032b;20583386316;0;0;25729232896 checkmem type=paged MaxWarn=80% => 'paged bytes %'=34%;80;0 'paged bytes'=8.25g;19.1;0;0;23.96 * Fixed threadding issue related to servers (ie. check_nt causing a crash) Dont know what I was thinking when I designed that, pretty stupid bug :( * Fixed issue with loading performance counters (check_cpu) * Fixed default service name (nscp) * CheckWMI: Added support for lists of integers * Fixed installer in preparation of 0.4.1 * Added support for lists in targets/destination (passive checks/channels) * Added new --remove-defaults option when generating settings files. nscp settings --remove-defaults --generate * Added new module Sim plefilewriter for writing passive check results to files. * Much improved CheckLogFile with warn/crit/filter concepts (currentl no real-time support) check_logfile "file=c:\\test.txt" "filter=column1 eq '123'" "warn=column3 like 'foo'" "crit=column1 eq '123'"
Thank you!
More then a 1000 words?
but it runs on linux time for a new logo? for windows Probably!
apt-get install git clone git://github.com/mickem/nscp.git mkdir build ; cd build cmake../nscp make
Manually install visual studio, python and cmake Download and unpack nscp source python nscp\build\python\fetchdeps.py --target x64 --cmake-config dist cmake../nscp msbuild /p:configuration=relwithdebinfo NSCP.sln
Please help with packages! if you I will like give linux? you free* beer! *Free as in your free to buy it your self!
More then a 1000 words?
let me work let nagios/icinga/neteye rest daemon passive monitoring? NO! real-time monitoring? event based monitoring? A better way to do monitoring? simplified monitoring? preventive monitoring?
More then a 1000 words?
check_nt: No Encryption! encryption! Authentication! Secure monitoring check_nrpe: No Encryption! authentication, Authentication! no encryption? check_nsca: No Encryption! (strong) Authentication! authentication! check_mk: No Encryption! authentication, Authentication! no encryption! check_nrdp: No ecryption encryption (Yet!) (in nsclient++) check_nscp: Encryption! Authentication!
Strong encryption Ssl (standard) Security Certificates Certificate based authentication Client AND(or) server Secure? I hope so But you never know
Time to get real
General usage nscp --help nscp -- --help --help,... --host,--help,... nscp Display all available contexts nscp --help core Get help NRPEClient nscp <context or alias> CheckWMI [options] PythonScript [-- [module options]]... General usage syntax
Contexts (non modules) help client service settings test unit Get help Act as a client. (think check_nrpe) Usually simpler to use aliases (un)install windows service Work with configuration Debug errors and problems Run unit test scripts
Aliases (for modules) lua Run lua scripts python Run python scripts nrpe check_nrpe nsca send_nsca sys Nice pdh front-end (more to come) wmi WMI front end eventlog Add event log messages
Settings (Configuration) nscp settings --help nscp settings --add-missing --generate [--load-all] Will update your configuration with ALL keys nscp settings --add-missing --activate-module <module> Great way to "enable a new module nscp settings --remove-defaults --generate Will remove all default keys/sections nscp settings --validate Show problems with the settings file
check_nrpe nscp nrpe -- --help The extra -- is important nscp nrpe -- -H 127.0.0.1 -c foo -a foo bar Execute nrpe query from nsclient++ 0.4.2 will introduce: nrpe_client -H 127.0.0.1 -c foo -a foo bar nsca_client _client
Time to get real
Active monitoring! check_cpu check_mem check_uptime check_eventlog check_updates...... Monitoring Server (Nagios) Monitored Server (Windows)
Passive monitoring! check_cpu check_mem check_uptime check_eventlog check_updates...... Monitoring Server (Nagios) Monitored Server (Windows)
Real-time monitoring! Error detected in eventlog Everything is ok Monitoring Server (Nagios) Monitored Server (Windows)
How does it work? Linux Kernel [/modules] CheckLogFile = enabled NSCAClient = enabled SimpleFileWriter = enabled NSClient++ Core No cpu overhead [/settings/logfile/real-time/checks/my_check] destination = FILE,NSCA NSCAClient Notified instantly Powerfull CheckLogFile file filtering = test.txt warning = column1 like warn FILE SimpleFileWriter critical = column2 like crit [/settings/nsca/client/targets/default] address = 10.11.12.13 encryption = aes password = secreter File
but I use NRPE Linux Kernel [/modules] CheckLogFile = enabled SimpleCache = enabled NRPEServer = enabled NSClient++ Core NSCA NSCAClient [/settings/logfile/real-time/checks/my_check] CheckLogFile FILE destination = CACHE file = test.txt warning = column1 like warn critical = column2 like crit CACHE [/settings/nrpe/server] allowed hosts = 10.11.12.13 NRPEServer allow arguments = true SimpleFileWriter SimpleCache
Summary Very cheap (CPU) event log and log file checks Get notified when there is an error Easy to configure Can create very cool composite checks! But remember! Nagios is horribly antiquated and ill suited for this
Time to get real
Timeline and Versions 0.4.1 Bugfix release 0.4.2 Major version 0.4.3 Minor updates and bugfixes for 0.4.2
0.4.1 Build 90 (2013-02-04) nsclient-full.ini Reload from script (re)added check_filesize (ie. Check_nt v FILESIZE) Encoding support for NRPE New option: scan-range for CheckEventLog Various minor bug fixes Build 9? (2013-04-xx) Reverted external script quoting issues (re)added check_fileage (ie. Check_nt v FILEAGE) Added support for binding to both ipv6 and ipv4 Various minor bug fixes
0.4.2 Updated Plugin API (full protocol buffer support) NSCP protocol Performance improvements: pure utf8 not utf8/utf16 mixed Compiled with visual studio 2012 (no nt4/windows 2000 support) 0.4.1 still available for nt4 and windows 2000 0.4.3 might partially support nt4/2000 New built-in help option for all checks Modern eventlog support Real-time system checks Attachable test mode Please add your request here!
0.4.3 REST support Linux checks Bundled scripts Firewall friendly NSCP protocol (ie. REST based) Please add your request here!
Photo by Olga Berrios
Thank You! Michael Medin Information about NSClient++ http://nsclient.org facebook.com/nsclient Slides, and examples http://nsclient.org/nscp/conferances/ossmc/2013/