Configure nagios remote for DB2
Posted: Sat Mar 09, 2019 10:50 am
Hello,
i have a linux redhat server, configured for Nagios. Running fine, all kind of standard monitoring does work on a remote linux-server, containing DB2-servers.
I work with nrpe.
But i can't get the configuration right for the plugin to monitor the databases...
I use these plugin:
"monitor-db2-with-nagios-master".
Which contains al lot of checks, for instance "check_instance_up".
Below some of my configuration. The problem is the nrpe user has to switch to the instance user of the databases.
I think i have to use sudo(on the remote linux-server only?) to make this work.
And the command.. i can't get it right...
Something like this?
nrpe ALL=(root) NOPASSWD: /usr/bin/su - db2inst1
nrpe ALL=NOPASSWD: /usr/lib64/nagios/plugins/check_instance_up -i /home/db2inst1
Please help this newbee...
Regards.
# check_instance_up
define command {
command_name check_instance_up
command_line /usr/lib64/nagios/plugins/check_instance_up -H $HOSTADDRESS$ -l nagios -C "/home/nagios/scripts/check_instance_up -i '$ARG1$' -d '$ARG2$'"
on the DB2-server:
command[check_instance_up]=/home/nagios/scripts/check_instance_up -i /home/db2inst1 ??
i have a linux redhat server, configured for Nagios. Running fine, all kind of standard monitoring does work on a remote linux-server, containing DB2-servers.
I work with nrpe.
But i can't get the configuration right for the plugin to monitor the databases...
I use these plugin:
"monitor-db2-with-nagios-master".
Which contains al lot of checks, for instance "check_instance_up".
Below some of my configuration. The problem is the nrpe user has to switch to the instance user of the databases.
I think i have to use sudo(on the remote linux-server only?) to make this work.
And the command.. i can't get it right...
Something like this?
nrpe ALL=(root) NOPASSWD: /usr/bin/su - db2inst1
nrpe ALL=NOPASSWD: /usr/lib64/nagios/plugins/check_instance_up -i /home/db2inst1
Please help this newbee...
Regards.
# check_instance_up
define command {
command_name check_instance_up
command_line /usr/lib64/nagios/plugins/check_instance_up -H $HOSTADDRESS$ -l nagios -C "/home/nagios/scripts/check_instance_up -i '$ARG1$' -d '$ARG2$'"
on the DB2-server:
command[check_instance_up]=/home/nagios/scripts/check_instance_up -i /home/db2inst1 ??