https://github.com/lausser/check_db2_health
A plugin (monitoring-plugin, not nagios-plugin, see also http://is.gd/PP1330) which checks various parameters of DB2 database servers. This plugin is also part of OMD, go to https://labs.consol.de/repo/, install OMD and there you have check_db2_health.
https://github.com/lausser/check_db2_health
db2 icinga monitoring naemon nagios nagios-plugins
Last synced: 9 months ago
JSON representation
A plugin (monitoring-plugin, not nagios-plugin, see also http://is.gd/PP1330) which checks various parameters of DB2 database servers. This plugin is also part of OMD, go to https://labs.consol.de/repo/, install OMD and there you have check_db2_health.
- Host: GitHub
- URL: https://github.com/lausser/check_db2_health
- Owner: lausser
- License: gpl-2.0
- Created: 2010-02-16T17:10:24.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2021-07-09T12:21:45.000Z (almost 5 years ago)
- Last Synced: 2024-04-17T00:19:08.504Z (about 2 years ago)
- Topics: db2, icinga, monitoring, naemon, nagios, nagios-plugins
- Language: Perl
- Homepage: https://omd.consol.de/docs/plugins/check_db2_health
- Size: 205 KB
- Stars: 8
- Watchers: 7
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README
- Changelog: ChangeLog
- License: COPYING
Awesome Lists containing this project
- awesome-monitoring - check_db2_health.pl - For db2. (Nagios Monitoring / Nagios Monitoring Plugins)
README
check_db2_health Nagios Plugin README
---------------------
This plugin is used to monitor a variety of db2 database metrics.
* For instructions on installing this plugin for use with Nagios,
see below. In addition, generic instructions for the GNU toolchain
can be found in the INSTALL file.
* For major changes between releases, read the CHANGES file.
* For information on detailed changes that have been made,
read the Changelog file.
* This plugin is self documenting. All plugins that comply with
the basic guidelines for development will provide detailed help when
invoked with the '-h' or '--help' options.
You can check for the latest plugin at:
http://www.consol.com/opensource/nagios/check-db2-health
The documentation in this README covers only the most common features.
To view the full documentation and examples, go to
http://www.consol.com/opensource/nagios/check-db2-health or
http://www.consol.de/opensource/nagios/check-db2-health
Send mail to gerhard.lausser@consol.de for assistance.
Please include the OS type/version and the Perl DBI/DBD version
that you are using.
Also, run the plugin with the '-vvv' option and provide the resulting
version information. Of course, there may be additional diagnostic information
required as well. Use good judgment.
For patch submissions and bug reports, please send me a mail. You can also find
me at http://www.nagios-portal.de
How to "compile" the check_db2_health script.
--------------------------------------------------------
1) Run the configure script to initialize variables and create a Makefile, etc.
./configure --prefix=BASEDIRECTORY --with-nagios-user=SOMEUSER --with-nagios-group=SOMEGROUP --with-perl=PATH_TO_PERL --with-statefiles-dir=STATE_PATH
a) Replace BASEDIRECTORY with the path of the directory under which Nagios
is installed (default is '/usr/local/nagios')
b) Replace SOMEUSER with the name of a user on your system that will be
assigned permissions to the installed plugins (default is 'nagios')
c) Replace SOMEGRP with the name of a group on your system that will be
assigned permissions to the installed plugins (default is 'nagios')
d) Replace PATH_TO_PERL with the path where a perl binary can be found.
Besides the system wide perl you might have installed a private perl
just for the nagios plugins (default is the perl in your path).
e) Replace STATE_PATH with the directory where you want the script to
write state files which transport information from one run to the next.
(default is /tmp)
Simply running ./configure will be sufficient to create a check_db2_health
script which you can customize later.
2) "Compile" the plugin with the following command:
make
This will produce a "check_db2_health" script. You will also find
a "check_db2_health.pl" which you better ignore. It is the base for
the compilation filled with placeholders. These will be replaced during
the make process.
3) Install the compiled plugin script with the following command:
make install
The installation procedure will attempt to place the plugin in a
'libexec/' subdirectory in the base directory you specified with
the --prefix argument to the configure script.
4) Verify that your configuration files for Nagios contains
the correct paths to the new plugin.
Command line parameters
-----------------------
--connect=
This is what you would also use with tnsping and sqlplus.
--user=
This is the user which reads the system tables.
--password=
This is the user's password.
--mode=
This parameter tells the plugin what it should check.
The list of known modes may grow frequently. Please look at
http://www.consol.com/opensource/nagios/check-db2-health for a list
of features.
--tablespace=
Tablespace-related modes check all tablespaces in one run by default.
If only a single tablespace should be checked, use this parameter.
--warning=
If the metric is out of this range, the plugin returns a warning.
--critical=
If the metric is out of this range, the plugin returns a critical.
How to prepare the database for monitoring
--------------------------------------
Database user:
[root@dbsrv12 ~]# groupadd nagios
[root@dbsrv12 ~]# useradd -g nagios -s /bin/false nagios
[root@dbsrv12 ~]# passwd nagios
Grant sysmon authority:
db2inst1$ db2 update dbm cfg using sysmon_group nagios
db2inst1$ db2 grant select,update on table SYSTOOLS.STMG_DBSIZE_INFO to nagios
Switch on the performance counters:
db2 update dbm cfg using dft_mon_bufpool on
db2 update dbm cfg using dft_mon_lock on
db2 update dbm cfg using dft_mon_timestamp on
--------------------------------------
That's it. If you have any problems or questions, feel free to send mail
to gerhard.lausser@consol.de