Descargar los archivos mibs del fabricante
Copiar las mibs (.txt) en el directorio /usr/share/snmp/mibs
ls -lh /usr/share/snmp/mibs | tail -n 10
-rw-r--r-- 1 root root 8,7K dic 21 2011 STONESOFT-FIREWALL-MIB.txt
-rw-r--r-- 1 root root 1,7K dic 21 2011 STONESOFT-SMI-MIB.txt
-rw-r--r--. 1 root root 28K ago 6 2013 TCP-MIB.txt
-rw-r--r--. 1 root root 17K ago 6 2013 TRANSPORT-ADDRESS-MIB.txt
-rw-r--r--. 1 root root 2,2K ago 6 2013 UCD-DEMO-MIB.txt
-rw-r--r--. 1 root root 4,3K ago 6 2013 UCD-DISKIO-MIB.txt
-rw-r--r--. 1 root root 3,0K ago 6 2013 UCD-DLMOD-MIB.txt
-rw-r--r--. 1 root root 8,0K ago 6 2013 UCD-IPFWACC-MIB.txt
-rw-r--r--. 1 root root 46K ago 6 2013 UCD-SNMP-MIB.txt
-rw-r--r--. 1 root root 21K ago 6 2013 UDP-MIB.txt
Para probar las mibs de stonesoft que hemos añadido
snmpwalk -v1 -cpublic 192.168.1.1 STONESOFT-FIREWALL-MIB::fwSoftwareVersion
STONESOFT-FIREWALL-MIB::fwSoftwareVersion.0 = STRING: Stonesoft Security Engine version 1.1.1.1111
Cajón desastre para administradores de redes y sistemas informáticos. Este blog es para encontrar aquellas cosas que haces una vez y luego te cuesta repetirlas.
Mostrando entradas con la etiqueta RHEL. Mostrar todas las entradas
Mostrando entradas con la etiqueta RHEL. Mostrar todas las entradas
viernes, 23 de enero de 2015
Añadir MIBs al cliente snmp en Red Hat o CentOS
Ubicación:
San Sebastián, Guipúzcoa, España
miércoles, 26 de marzo de 2014
Como modificar iptables en TrendMicro IMSVA 8.5 para dar acceso a Nagios
Revisar las reglas actuales de Firewall
iptables -L
Editar el script de reglas de firewall (En negrita lo que he añadido)
vi /etc/init.d/rcFirewall
set_snmp_access_rules()
{
# set snmpaccess permission
iptables -A INPUT -p udp -s IP_NAGIOS -d IP_SERVIDOR_IMSS--dport 161 -j ACCEPT
}
start()
{
echo -n "Applying firewall rules..."
get_network_info
set_basic_rules
set_exposed_fix_port_rules
set_web_access_rules
set_ssh_access_rules
set_postfix_access_rules
set_internal_access_rules
set_changeable_port_rules
set_snmp_access_rules
echo_success
echo
}
Volver a cargar las reglas de Firewall
/etc/init.d/rcFirewall restart
Mostrar las reglas actuales de Firewall
iptables -L
iptables -L
Editar el script de reglas de firewall (En negrita lo que he añadido)
vi /etc/init.d/rcFirewall
set_snmp_access_rules()
{
# set snmpaccess permission
iptables -A INPUT -p udp -s IP_NAGIOS -d IP_SERVIDOR_IMSS--dport 161 -j ACCEPT
}
start()
{
echo -n "Applying firewall rules..."
get_network_info
set_basic_rules
set_exposed_fix_port_rules
set_web_access_rules
set_ssh_access_rules
set_postfix_access_rules
set_internal_access_rules
set_changeable_port_rules
set_snmp_access_rules
echo_success
echo
}
Volver a cargar las reglas de Firewall
/etc/init.d/rcFirewall restart
Mostrar las reglas actuales de Firewall
iptables -L
Ubicación:
San Sebastián, Guipúzcoa, España
jueves, 7 de noviembre de 2013
Nagios - not could be due to Performed to fork () error 'Resource temporarily unavailable'
El otro día me paso que hice una instalación desde cero de Nagios en RHEL 6.4 y al principio no me dí cuenta pero luego me fije que todos los servicios que usaban check_snmp fallaban dando el siguiente error:
Could not open pipe
Revisando el log de Nagios (nagios.log) se veía lo siguiente:
Warning: The check of service 'uptime' on host 'router1' not could be due to Performed to fork () error 'Resource temporarily unavailable'. The check will be rescheduled.
Buscando un poquito en google encontré en la web comercial de Nagios.
http://support.nagios.com/wiki/index.php/Nagios_XI:FAQs leí que estos errores suelen ser debidos a límites impuestos al usuario en /etc/security/limits.conf.
Para verificar los limites actuales podemos ejecutar:
ulimit -a En la web de Nagios nos recomiendan poner los siguientes valores:
Para mejorar aún más el rendimiento de nuestro Nagios podemos deshabilitar el interprete perl embebido, configurando estas 2 variables en nuestro archivo de configuración nagios.cfg.
Could not open pipe
Revisando el log de Nagios (nagios.log) se veía lo siguiente:
Warning: The check of service 'uptime' on host 'router1' not could be due to Performed to fork () error 'Resource temporarily unavailable'. The check will be rescheduled.
Buscando un poquito en google encontré en la web comercial de Nagios.
http://support.nagios.com/wiki/index.php/Nagios_XI:FAQs leí que estos errores suelen ser debidos a límites impuestos al usuario en /etc/security/limits.conf.
Para verificar los limites actuales podemos ejecutar:
ulimit -a En la web de Nagios nos recomiendan poner los siguientes valores:
* hard memlock 128 #locked memory
* soft memlock 128
* soft nofile 4096 #open files
* hard nofile 4096
* hard nproc 4096 #max user processes
* soft nproc 4096
* hard stack 20480 #stack size
* soft stack 20480
para aplicar los cambios tendremos que reiniciar.
Para verificar los límites después de reiniciar ejecutar:
ulimit -aPara mejorar aún más el rendimiento de nuestro Nagios podemos deshabilitar el interprete perl embebido, configurando estas 2 variables en nuestro archivo de configuración nagios.cfg.
enable_embedded_perl=0
use_embedded_perl_implicitly=0
Bibligrafía
http://support.nagios.com/wiki/index.php/Nagios_XI:FAQs
Ubicación:
Donostia-San Sebastián, Guipúzcoa, España
jueves, 19 de enero de 2012
Configurar VNC en RHEL 6 sin vino
Primero hay que instalar el servidor vncserver
yum install vnc-server
o descargar el rpm
wget ftp://ftp.sunet.se/pub/Linux/distributions/scientific/53/x86_64/SL/vnc-server-4.1.2-14.el5_3.1.x86_64.rpm
instalar el rpm
rpm -ivh vnc-server-4.1.2-14.el5_3.1.x86_64.rpm
configurar el servicio encendido en el arranque
chkconfig vnc-server on
Editar /root/.vnc/xstartup y poner lo siguiente
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
eval `dbus-launch --sh-syntax –exit-with-session`
echo "D-BUS per-session daemon address is: \
$DBUS_SESSION_BUS_ADDRESS"
fi
exec gnome-session
En el archivo /etc/sysconfig/vncservers ponemos
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768 -nolisten tcp -nohttpd"
y reiniciamos
service vncserver restart
yum install vnc-server
o descargar el rpm
wget ftp://ftp.sunet.se/pub/Linux/distributions/scientific/53/x86_64/SL/vnc-server-4.1.2-14.el5_3.1.x86_64.rpm
instalar el rpm
rpm -ivh vnc-server-4.1.2-14.el5_3.1.x86_64.rpm
configurar el servicio encendido en el arranque
chkconfig vnc-server on
Editar /root/.vnc/xstartup y poner lo siguiente
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
eval `dbus-launch --sh-syntax –exit-with-session`
echo "D-BUS per-session daemon address is: \
$DBUS_SESSION_BUS_ADDRESS"
fi
exec gnome-session
En el archivo /etc/sysconfig/vncservers ponemos
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768 -nolisten tcp -nohttpd"
y reiniciamos
service vncserver restart
Ubicación:
Donostia-San Sebastián, España
Suscribirse a:
Entradas (Atom)