Monitorizando la red: Smokeping

Vuelvo con más novedades, esta vez una herramienta que ayuda a poner gráficas que tanto suelen gustar sobre el estado de la red y la carga que esta tiene. La herramienta se llama smokeping y está disponible en los repositorios de debian testing. Es un pequeño demonio que se ejecuta y está comprobando la latencia mediante el comando fping a los equipos listados. Al mismo tiempo crea una gráficas basadas en RRDtool. La herramienta en sí es muy similar a MRTG, pero sin el componente snmp y por lo tanto mucho más simple de configurar y poner a funcionar.
Un pequeño ejemplo:
shell> apt-get install curl apache2 smokeping
A continuación hay que configurarlo.
shell> vi /etc/smokeping/config.d/General
Y luego agregar la lista de equipos a monitorizar.
shell> cat /etc/smokeping/config.d/Targets
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website
+ Local
menu = Local
title = Red Local
++ LocalMachine
menu = Maquina Local
title = localhost
host = localhost
+ Server
menu = Servidores
title = Servidores
++ Servidor_1
menu = Router
title = Router General
host = 192.168.1.1
++Servidor_2
menu = Mail
title = Servidor de mail
host = 192.168.1.15
Tras su sencilla configuración iniciamos el demonio.
shell> /etc/init.d/smokeping start
Y al rato se podrá ver en la web una gráfica con las latencias...

Más información: oetiker -- smokeping
Leer más

Deshabilitar touchpad mientras escribes

Ya no recuerdo exactamente qué fue lo que estaba buscando, pero acabé en esta web (ubuntuleon.blogspot.com) en la que vi un script bastante interesantes que quiero compartir con vosotros por si os puede resultar interesantes. Para la gente que emplee equipos de sobremesa no creo, pero para aquellos que trabajen con portátiles puede ser especialmente útil deshabilitar el touchpad cuando están escribiendo. A quién no le pasó que está escribiendo y se le mueve el ratón y termina por escribir donde no debe o sin escribir. Aunque muchos de los equipos modernos ya comienzan a incluir esa opción, a los que no, si emplean GNU/Linux, se la pueden poner.

#!/bin/bash

gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_auto-disable true
echo "Generando los scripts"
MANUAL=touchpad-manual
AUTO=touchpad-auto
zenity --question --text="¿Desea activar las notificaciones?\nSe instalara el paquete libnotify-bin\npara lanzar notificaciones a traves de Notify-OSD"
if [ $? = 0 ];then
    gksu echo Instalando
    sudo apt-get install libnotify-bin
    gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_notify true
else
    gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_notify false
fi
echo '#!/bin/bash
gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_auto-disable false
#Si el estado actual es activado, lo desactiva, si no, lo activa
if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled) = true ]; then
    gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_enabled false
    #synclient TouchpadOff=1
    if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_notify) = true ]; then
        notify-send --icon=mouse "Touchpad Deshabilitado"
    fi
else
    gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_enabled true
    #synclient TouchpadOff=0
    if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_notify) = true ]; then
        notify-send --icon=mouse "Touchpad Habilitado"
    fi
fi' | tee $MANUAL

echo '#! /bin/bash
# Depende de libnotify-bin
notify=0    # Deshabilita la notificacion en el arranque
# Sincroniza synclient con gconf
#if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled) = true ]; then
#    synclient TouchpadOff=0
#elif [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled) = false ]; then
#    synclient TouchpadOff=1
#fi
while [ 1 ]
do
    if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_auto-disable) = true ]; then
        if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled) = true ] && [ -e /dev/input/by-id/*event-mouse ]; then # Se enchufa un Ratón
            gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_enabled false
            #synclient TouchpadOff=1
            if [ $notify = 1 ]; then
                notify-send --icon=mouse "Touchpad Deshabilitado" "Se ha detectado un Ratón externo"
            fi

        elif [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled) = false ] && [ ! -e /dev/input/by-id/*event-mouse ]; then # Se desenchufa un Ratón
            gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_enabled true
            #synclient TouchpadOff=0
            if [ $notify = 1 ]; then
                notify-send --icon=mouse "Touchpad Habilitado" "Se ha desconectado el Ratón externo"
            fi
        fi
    fi
    if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_notify) = true ]; then
        notify=1
    fi
    sleep 5  # Periodo de refresco en segundos
done' | tee $AUTO

echo "Instalando los script"
gksu cp $MANUAL /usr/bin/
rm $MANUAL
sudo cp $AUTO /usr/bin/
rm $AUTO
cd /usr/bin/
sudo chmod +rx $MANUAL
sudo chmod +rx $AUTO

echo "Asociando combinacion de teclas Alt+t"
gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_8 "t"
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_8 "$MANUAL"
echo "Asociando combinacion de teclas Alt+a para el modo automático"
gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_7 "a"
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_7 "gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_auto-disable true"

echo "Creando autoarranque"
cd /usr/share/gnome/autostart/
echo '[Desktop Entry]' | sudo tee $AUTO.desktop
echo 'Type=Application' | sudo tee -a $AUTO.desktop
echo 'Name=AutoDeshabilitar Touchpad' | sudo tee -a $AUTO.desktop
echo "Exec=$AUTO" | sudo tee -a $AUTO.desktop
echo 'Icon=mouse' | sudo tee -a $AUTO.desktop
echo 'Comment=Detecta si exixte un raton, y si es asi, deshabilita el touchpad' | sudo tee -a $AUTO.desktop
echo "Listo"

Leer más

Formulario de contacto

Nombre

Correo electrónico *

Mensaje *

Últimos comentarios