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 ??
Configure nagios remote for DB2
Re: Configure nagios remote for DB2
Set these:
DB2 Server:
/etc/sudoers:
nrpe.cfg:
Now test from the Nagios server:
DB2 Server:
/etc/sudoers:
Code: Select all
nrpe ALL = (db2inst1) NOPASSWD: /home/nagios/scripts/check_instance_up *
Code: Select all
command[check_instance_up]=sudo -u db2inst1 /home/nagios/scripts/check_instance_up -i '$ARG1$'
Code: Select all
/usr/lib64/nagios/plugins/check_nrpe -H DB2_IP -c check_instance_up -a '/home/db2inst1'
Re: Configure nagios remote for DB2
Thnx ssax.
It works! Only, it is not shown in nagios console....
In the services.cfg i have this:
define service {
use generic-service
host_name on7p0021.ont.belastingdienst.nl
check_interval 30
service_description Instance status
check_command check_instance_up!/home/db2inst1
}
Is this correct? Any idea why it is not shown in the nagios console?
Thx allready!
It works! Only, it is not shown in nagios console....
In the services.cfg i have this:
define service {
use generic-service
host_name on7p0021.ont.belastingdienst.nl
check_interval 30
service_description Instance status
check_command check_instance_up!/home/db2inst1
}
Is this correct? Any idea why it is not shown in the nagios console?
Thx allready!
Re: Configure nagios remote for DB2
In Nagios i get the message "no matching services"
Re: Configure nagios remote for DB2
Solved it! Problem with the late comment was that i did the adjustment for the config on one nagios server.... There are two nagios servers..
Load balancing didn't work fine..
So after putting the configuration on both servers, it worked!
Thnx for the support.
Load balancing didn't work fine..
So after putting the configuration on both servers, it worked!
Thnx for the support.
Re: Configure nagios remote for DB2
Another question: the service gives a "Flap Detection" status.
From the nagios.log:
[1552398096] SERVICE FLAPPING ALERT: on7p0021.ont.belastingdienst.nl;Instance status;STOPPED; Service appears to have stopped flapping (3.9% change < 5.0% threshold)
[1552398096] SERVICE NOTIFICATION: nagiosadmin;on7p0021.ont.belastingdienst.nl;Instance status;CRITICAL;notify-service-by-email;PID: 8975. Problem retrieving port number.
[1552398156] SERVICE NOTIFICATION: nagiosadmin;on7p0021.ont.belastingdienst.nl;Instance status;CRITICAL;notify-service-by-email;PID: 8975. Problem retrieving port number.
From the nagios.log:
[1552398096] SERVICE FLAPPING ALERT: on7p0021.ont.belastingdienst.nl;Instance status;STOPPED; Service appears to have stopped flapping (3.9% change < 5.0% threshold)
[1552398096] SERVICE NOTIFICATION: nagiosadmin;on7p0021.ont.belastingdienst.nl;Instance status;CRITICAL;notify-service-by-email;PID: 8975. Problem retrieving port number.
[1552398156] SERVICE NOTIFICATION: nagiosadmin;on7p0021.ont.belastingdienst.nl;Instance status;CRITICAL;notify-service-by-email;PID: 8975. Problem retrieving port number.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Configure nagios remote for DB2
Services will go into flapping if they change states between OK and non-OK rapidly
https://assets.nagios.com/downloads/nag ... pping.html
https://assets.nagios.com/downloads/nag ... pping.html
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Configure nagios remote for DB2
I split your most recent question off to a new topic here
https://support.nagios.com/forum/viewto ... =7&t=52977
Please create a new thread for each different topic
Locking this thread as resolved
https://support.nagios.com/forum/viewto ... =7&t=52977
Please create a new thread for each different topic
Locking this thread as resolved