Nagios+SNMP
Descripción
Como monitoriar servicios a traves de SNMP
Prerequistos
En principio solo necesita el plugin de nagios para snmp nagios-plugins-snmp que provee el comando check_snmp
Instalación
Configuración
1. Comandos
define command{
command_name snmp_ups_stat
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1
.2.1.33.1.2.1.0 -w 3 -c 4 -l 'Main Battery Status'
}
define command{
command_name snmp_ups_envtemp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1
.4.1.476.1.42.3.4.1.3.3.1.3.1 -l 'environment Temperature' -u 'degree celsius' -
w 25 -c 40
}
define command{
command_name snmp_ups_capa
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1
.4.1.476.1.42.3.5.1.19.0 'Adv. Battery Capacity' -u '%'
}
define command{
command_name snmp_ups_current
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1
.2.1.33.1.4.4.1.3.1 -l 'Output Current' -u 'Ampere 3~' -w 30 -c 45
}
define command{
command_name snmp_ups_volt
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1
.2.1.33.1.5.3.1.2.1 -l 'Output Voltage' -u 'Volt 3~' -c 225 -w 230
}
define command{
command_name snmp_ups_freq
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1
.2.1.33.1.5.1.0 -l 'Output Frequency' -u 'Herz' -w 5 -c 50
}
2. Servicios
define service{
use generic-service
host_name Liebert-UPS
service_description Environment-Temperature
check_command snmp_ups_envtemp!public
contact_groups admins
}
define service{
use generic-service
host_name Liebert-UPS
service_description Battery-Status
check_command snmp_ups_stat!public
contact_groups admins
}
define service{
use generic-service
host_name Liebert-UPS
service_description Battery-Capacity
check_command snmp_ups_capa!public
contact_groups admins
}
define service{
use generic-service
host_name Liebert-UPS
service_description Battery-Output-Freq
check_command snmp_ups_freq!public
contact_groups admins
}
define service{
use generic-service
host_name Liebert-UPS
service_description Battery-Output-Voltage
check_command snmp_ups_volt!public
contact_groups admins
}
define service{
use generic-service
host_name Liebert-UPS
service_description Battery-Output-Current
check_command snmp_ups_current!public
contact_groups admins
}
define service{
use generic-service
host_name Liebert-UPS
service_description Liebert-UPS-TRAP
is_volatile 1
check_command check-host-alive
max_check_attempts 1
normal_check_interval 1
retry_check_interval 1
active_checks_enabled 0
passive_checks_enabled 1
check_period 24×7
notification_interval 63072000
notification_period 24×7
notification_options w,u,c
notifications_enabled 1
contact_groups
}
Trucos
Problemas
1. Si el instale_mrtg.sh no le funciona
-
Referencias
- http://wiki.nagios.org/index.php/Howtos:snmp -
- http://wiki.nagios.org/index.php/Howtos:snmp-apc-smart-ups – (Esto es lo que se hizo en Davivienda)
FIN
15-Marzo-2006 J.E.Gomez v1.0 Primera version
Advertencia
Este documento es privado y es de u so exclusivo de sus autores y de SKINA TECH. Cualquier uso sin una autorización escrita es contra la ley de derechos de autor y de propiedad intelectual, y será motivo de una acción legal.