Nagios – Using custom scripts with NSClient++ (with arguments)

Thursday, August 3, 2017

If you are using Nagios to monitor your environments probably at some point you will want to write your custom scripts in order to monitor more complex or specific things. Next we will review how to do it using the check_nrpe command for scripts with arguments (for scripts without arguments see my another post here)   1) Write the Script • Throw the exit code using a $LASTEXITCODE variable following this convention: 0 –> OK 1 –> Warning 2 –> Critical 3 –> Unknown   • The arguments must be passed to the script using the following syntax: $variable = $args   • The messages printed...
no comments

Nagios – Using custom scripts with NSClient++ (no arguments)

Tuesday, August 1, 2017

If you are using Nagios to monitor your environments probably at some point you will want to write your custom scripts in order to monitor more complex or specific things. Next we will review how to do it using the check_nrpe command for scripts that don't need arguments (for scripts with arguments see my another post here)   1) Write the Script • Throw the exit code using a $LASTEXITCODE variable following this convention: 0 –> OK 1 –> Warning 2 –> Critical 3 –> Unknown   • The messages printed in the console will be shown in Nagios   2) Add the script to the...
no comments