Using NSClient++
Here is a collection of guides for using NSClient++ (regardless of monitoring solution).
This is a work in progress so at the moment there is not so much here but hopefully it will expand. This page has a quick overview and is ment to be read first and help you digest the importance of the "sub guides". but for quick reference they are all listed here.
- guide Debug Symbols can be used to figure out where and why NSClient++ crashes.
Debugging NSClient++ commands and configurations
First off when you have truble always run NSClient++ in /test mode like so:
NSClient++ /stop NSClient++ /test ... ... exit NSClient++ /start
Debugging External Scripts
There are several ways you can debug your commands and external scripts with NSClient++:
- From Windows command line:
myscript.bat foo bar
- From NSClient++
nsclient++ /stop nsclient++ /test ... my_command foo bar ... exit nsclient++ /start
- From NSClient++ command line
NSClient++ -c my_command foo bar
- From NSClient++ via NRPE
NSClient++ -noboot NRPEClient -H 127.0.0.1 -c my_command -a foo bar
- From "nagios" via command line
check_nrpe ... -c my_command -a foo bar
Crashing
If for some unknown reason, and thankfully it happens less and less, NSClient++ will crash it can be good to figure out why. And since the primary location of NSClient++ is "production" it is often hard to get access to fully diagnose the error and install tools to help you. So thew first step is usually to try to reproduce the error in a development environment and/or perhaps even your local workstation.
The first step is to enable debug log and see if there is a patter to the crashes. When debug logging is enabled you can extract a lot of information from what is going on in NSClient++. it is important though to understand that logging happens "after a crash" so some times it is the command "after" the one logged that is causing the problem.
Another help when debugging is to install the debugging kit from Microsoft and use the debug symbols to find where the crash occurred. For details here refer to the debugging guide.







