Search All Sites
Nagios Live WebinarsLet our experts show you how Nagios can help your organization.
Don't miss your chance to attend the 2014 Nagios World Conference, Oct 13-16th. Informative Sessions, Networking, Food and Cocktails! Visit go.nagios.com/conference/ for more information or to register.
- Nagios 3.x
Requires root permissions, so I added db2.check.c that is a wrapper.
This script is helping me track db2 instances and dbs, further functionality will come with further problems, so I hope that further functionality comes from other community members ;-)
This script is intended to be used with some nice graphing software (like nagiosgraph) and be executed by nrpe.
File 1 (check_db2) is the script that runs all the functionality, it will require:
* root permission
* some space on /tmp
* some spaces on /var
As i know is MAD to execute nrpe with root permissions, I attached File 2 (db2.check.c). This file must be owned by root, must be readable and executable by the nrpe/nagios/whatever user and have the suid flat (+s) this will overcome the need of the shell to be executed by the root user.
You can change the path of the script (on db2.check.c) but check_db2 is intended to be on /usr/local/nagios.
Compiling db2.check.c is as easy as:
gcc db2.check.c -o db2.check
However, it uses root in order to be executed, and it is not always possible. DB2 relies in OS security, and there can be other ways to get the information. No need to do 'su - instUser'
Very interesting queries, however, you need at least DB2 9.7 FP 6