angoca / monitor-db2-with-nagios

Set of plugins / scripts to monitor DB2 from Nagios.
Apache License 2.0
20 stars 8 forks source link

check_instance_memory: Database connection errors overwritten in loop #50

Closed UberPinguin closed 6 years ago

UberPinguin commented 7 years ago

In the loop that checks for SELECT and CONNECT errors, the LONG_OUTPUT variable is overwritten on each pass. This means that if more than one database has errors, only the last database's errors are captured.

https://github.com/angoca/monitor-db2-with-nagios/blob/master/check_instance_memory#L392-L421

angoca commented 6 years ago

Thanks for the feedback, the code was modified according to your comments. The variable is concatenated in each loop, thus error messages are not lost.