angoca / monitor-db2-with-nagios

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

Monitor DB2 database size with Icinga2 #58

Open savicacc-gnl opened 6 years ago

savicacc-gnl commented 6 years ago

Hi,

We are currently testing some custom scripts with icinga2, and I am currently testing the check_db2_size. We already made nagios custom scripts work in icinga2, but I am having difficulties with this one.

So far, in commands.conf I wrote the below:

_object CheckCommand "check_db2_size" { import "plugin-check-command" command = [PluginDir + "/check_db2size" ] }

And in services.conf:

_apply Service "DB2 Size" { import "generic-service" check_command = "check_db2_size" check_interval = 30 retry_interval = 30 command_endpoint = host.vars.clientendpoint assign where match("bdb", host.name) }

I also installed the plugin on the client in /usr/lib64/nagios/plugins. When I try to run it manually, it ouputs:

_Usage: check_db2size { -i instanceHomeDirectory -d databaseName [-c][-p][-r][-K] | -h | -V } [-T][-v] Note: The test was not executed.|

Any ideas please?

P.S I already went through the plugin documentation but only nagios documentation exists.

_define command { command_name check_database_size command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -l nagios -t 20 -C "scripts/check_database_size -i '$ARG1$' -d '$ARG2$' -r 720" } define service{ host_name db2sever service_description Database size check_command check_databasesize!/home/db2inst1!sample use generic-service }

Do you think its possible to convert the above?

Thanks