Monitorizar servicio Syslog (nrpe y procs)

Ejemplo de monitorización del servicio syslog mediante check_nrpe y check_procs.

Servidores nagios:

213.190.0.6
213.190.0.226

Servidor syslog:

213.190.0.17

.6 y .226

apt-get update
apt-get install gcc g++ libssl-dev make build-essential xinetd libcurl4-openssl-dev

cd /usr/local/src
wget http://www.monitoringexchange.org/attachment/download/Utilities/AddOn-Projects/Communication/NRPE/NRPE/nrpe-2.0.tar.gz
tar xvzf nrpe-2.0.tar.gz
cd nrpe-2.0/

./configure
make all

vi /etc/xinetd.d/nrpe

# default: on
# description: NRPE
service nrpe
{
flags = REUSE
socket_type = stream
wait = no
user = nagios
group = nagios
server = /usr/lib/nagios/bin/nrpe
server_args = -c /etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 127.0.0.1
}

mkdir -p /usr/lib/nagios/bin

cp src/check_nrpe /usr/lib/nagios/plugins/
cp src/nrpe /usr/lib/nagios/bin/
cp nrpe.cfg /etc/

vi /etc/nrpe.cfg

<- dont_blame_nrpe=0
-> dont_blame_nrpe=1

vi /etc/services

nrpe            5666/tcp                        # NRPE

cd /etc/nagios3/conf.d/
vi services.cfg

#######################################################################################
#########################       Chequeo de syslog         #############################
#######################################################################################

# check that syslog services are running
define service{
  host_name             go-martin
  service_description   Syslog
  use                   generic-service
  check_command         check_nrpe!check_procs_syslog
}

/ect/init.d/nagios3 restart
/etc/init.d/xinetd restart

netstat -at | grep nrpe

cd /usr/lib/nagios/plugins
./check_nrpe -H 213.190.0.17 # Si muestra la versión se comunica correctamente

scp -i /home/ldiaz/.ssh/id_rsa -P 2222 /usr/lib/nagios/plugins/check_procs -P 2222 ldiaz@213.190.0.17:~

.242

apt-get update
apt-get install gcc g++ libssl-dev make build-essential xinetd libcurl4-openssl-dev

cd /usr/local/src
wget http://www.monitoringexchange.org/attachment/download/Utilities/AddOn-Projects/Communication/NRPE/NRPE/nrpe-2.0.tar.gz
tar xvzf nrpe-2.0.tar.gz
cd nrpe-2.0/

./configure
make all

vi /etc/shorewall/rules

#
# Accept nagios-nrpe
#
ACCEPT  eth0:213.190.0.6/32     $FW     tcp     5666
ACCEPT  eth0:213.190.0.226/32   $FW     tcp     5666

/etc/init.d/shorewall restart

vi /etc/xinetd.d/nrpe

# default: on
# description: NRPE
service nrpe
{
flags = REUSE
socket_type = stream
wait = no
user = nagios
group = nagios
server = /usr/lib/nagios/bin/nrpe
server_args = -c /etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 127.0.0.1 213.190.0.6 213.190.0.226
}

mkdir -p /usr/lib/nagios/plugins
mkdir -p /usr/lib/nagios/bin

cp src/check_nrpe /usr/lib/nagios/plugins/
cp src/nrpe /usr/lib/nagios/bin/
cp nrpe.cfg /etc/

mv /home/ldiaz/check_procs /usr/lib/nagios/plugins/

adduser --no-create-home nagios

vi /etc/nrpe.cfg

<- dont_blame_nrpe=0
-> dont_blame_nrpe=1

command[check_procs_syslog]=/usr/lib/nagios/plugins/check_procs -c 1: -a /usr/sbin/syslog-ng -u root

vi /etc/services

nrpe            5666/tcp                        # NRPE

/etc/init.d/xinetd restart

netstat -at | grep nrpe

cd /usr/lib/nagios/plugins
./check_nrpe -H localhost # Si muestra la versión está corriendo correctamente

« Linux | Nagios 3

Si no se indica lo contrario, el contenido de esta página se ofrece bajo Creative Commons Attribution-ShareAlike 3.0 License