370 likes | 549 Views
NSClient++ in the new millenium!. Name : Michael Medin (@ mickem ) Email: michael@medin.name Blog : http :// blog.medin.name Project: NSClient ++ Web: http :// nsclient.org. ( re )Discovering NSClient++. •. ∘. No disclaimer this year…. Still your fault though!. Michael Medin. d ev.
E N D
NSClient++ in the new millenium! Name: Michael Medin (@mickem) Email: michael@medin.name Blog: http://blog.medin.name Project: NSClient++ Web: http://nsclient.org (re)Discovering NSClient++ • ∘
No disclaimer this year… Still your fault though!
Michael Medin dev not ops a long time ago worked in ops by misstake work with “soa” not, C/C++, nagios, icinga, …
About NSClient++ (the program) C++ <0.4.0 linuxand windows Since 2003? not open core Open source Open source modular (pluggable) 0.4.0: 2012-05-xx 0.4.1: 2012-10-xx 0.4.2: 2013-02-xx?
About NSClient++ (the project) one-man-band , no commercial version no company , nopayed time Please don’t be angry! but… sponsoring! = feedback donations! support?
NSClient++ (What can I do?) Fork me on github Update the wiki! Respond in the forums… Submit patches Submit bug reports Come with ideas Tell me what you need! • ∘
NSClient++ (What’s new) Sockets: ipv6, ssl (true) Protocols: NRPE, NSCA, NRDP, check_mk, check_nt, Graphite, syslog, smtp Real-time checks (eventlog, logfiles) Command line syntax • ∘
…time for a new logo? but it runs on linux …for windows… Probably! • ∘ By ~Nac-Mac-Feegle
Building on Linux apt-get install … git clone git://github.com/mickem/nscp.git mkdir build ; cd build cmake ../nscp make • ∘
Building on windows… Get visual studio (express), python and cmake Download unpack nscp source python nscp\build\python\fetchdeps.py --target x64 --cmake-configdist cmake ../nscp msbuild /p:Configuration=RelWithDebInfoNSCP.sln • ∘
let me work …daemon let nagios/icinga/* rest passive monitoring? NO! event based monitoring? real-time monitoring? The right way to do monitoring? simplified monitoring? preventive monitoring? Tobias Leeger • ∘
Secure monitoring no encryption! Check_nt: no authentication, encryption? Check_nrpe: no (strong) authentication! Check_nsca: no authentication, no encryption! Check_mk: No ecryption (in nsclient++) Check_nrdp: Encryption! Authentication! Check_nscp: • ∘
Secure monitoring Check_nt: Encryption! Authentication! Check_nrpe: Encryption! Authentication! Check_nsca: Encryption! Authentication! Check_mk: Encryption! Authentication! Check_nrdp: No ecryption (Yet!) Encryption! Authentication! Check_nscp: • ∘
Security Strong encryption Ssl (standard) Certificates Certificate based authentication Client AND(or) server Secure? I hope so… • ∘
Secure? I hope so… But you never know… • ∘
Time to get real… DEMO: Using NSClient++ • ∘
General usage nscpDisplay all(?) available context nscp --helpGet help (can be used in many places) nscp<context or alias> [options] [-- [module options]] General usage syntax
Contexts help Get help client Act as a client. (think check_nrpe) Usually aliases we can use instead. service (un)Install and display windows service settings Work with configuration test Find errors and problems unit Run unit test scripts
Aliases luaRun lua scripts python Run python scripts nrpeThink check_nrpe nscaThink send_nsca sys Nice pdhfront-end (more to come) wmiWMI front end eventlogAdd event log message from command line
Settings (Configuration) nscp settings --help nscp settings --add-missing --generate [--load-all] Will update your configuration with ALL keys nscpsettings --add-missing --activate-module <module> Great way to "enable a new module“ nscp settings --remove-defaults --generate Will remove all default keys/sections nscpsettings --validate Show problems with the settings file
check_nrpe nscpnrpe -- --help The -- is important nscpnrpe -- -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… DEMO: real-time log file monitoring • ∘
Modules CheckLogFile Subscribes to filechanges SimpleFileWriter Write notifications to file NSCAClient Submit NSCA messages NSCP NSCAClient NSCA CheckLogFile SimpleFileWriter FILE
Resulting config from DEMO [/modules] CheckLogFile = enabled SimpleFileWriter= enabled [/settings/logfile/real-time/checks/sample] critical = column2 like 'crit' destination = FILE file = ./test.txt filter = column1 like 'hello' warning = column2 like 'warn' [/settings/logfile/real-time] enabled = true
Resulting config from DEMO [/settings/logfile/real-time] enabled = true [/settings/NSCA/client/targets/default] address = 127.0.0.1 encryption = xor password = secret [/modules] CheckLogFile = enabled NSCAClient = enabled SimpleFileWriter = enabled [/settings/logfile/real-time/checks/sample] critical = column2 like 'crit' destination = FILE,NSCA file = ./test.txt filter = column1 like 'hello' warning = column2 like 'warn'
Run the following ./nscp test tail –f ./output.txt echo –e “hello\tworld” echo –e “hello\twarn” echo –e “hello\tcrit”
Time to get real… DEMO: real-time log file monitoring… …via NRPE? • ∘
Modules CheckLogFile Subscribes to filechanges SimpleCache Store our result NRPEClient Accept remote checks (if there is time) NRPEServer NSCP CheckLogFile CACHE SimpleCache
Resulting config from DEMO [/settings/logfile/real-time] enabled = true [/settings/NSCA/client/targets/default] address = 127.0.0.1 encryption = xor password = secret [/modules] CheckLogFile = enabled NSCAClient = enabled SimpleFileWriter = enabled SimleCache = enabled [/settings/logfile/real-time/checks/sample] critical = column2 like 'crit' destination = FILE,NSCA,CACHE file = ./test.txt filter = column1 like 'hello' warning = column2 like 'warn'
Run the following ./nscp test echo –e “hello\tworld” echo –e “hello\twarn” echo –e “hello\tcrit” In nsclient console execute: check_cache index=sample
Q&A Photo by Olga Berrios
Thank You! Michael Medin michael@medin.name http://www..com/in/mickem http://blog.medin.name/ Information about NSClient++ http://nsclient.org facebook.com/nsclient Slides, and examples http://nsclient.org/nscp/conferances/osmc/2012/