lunes, 14 de febrero de 2011

Extraer información de una maquina

Esta ves me ha tocado crear un sencillo script que extrae información de una maquina, probadlo a ver que tal va, si tienes algun comentario por favor hacerlo saber.

---------------------------------------------------------------inicio del script---------------------------------------------------------------

#!/bin/bash

# Script desarrollado por Andrey Amado, usted es libre de realizar cualquier modificación sobre el archivo siempre y cuando mencione al autor o autores de dicho script, o en su defecto gastando una pola al creador del script.

if [ `id -u` -ne 0 ]; then

{

echo "El script debe ejecutarse como root"

exit 1

}

fi

if [ -e dump.txt ]; then rm dump.txt ; fi

echo "Bienvenido al script de informe del sistema\n"

pedir_tecla()

{

read -p "presione cualquier tecla" /dev/null

clear

hola

}

opt1_nm()

{

echo "El nombre del host es: " `hostname`

}

opt2_nm()

{

if [ -e /etc/debian_version ] ; then

echo "el sistema es Debian versión: " `cat /etc/debian_version`

else

if [ -e /etc/redhat-release ]

then

echo "el sistema es: " `cat /etc/redhat_version`

fi

fi

}

opt3_nm()

{

echo "El kernel del sistema operativo es: " `uname -r`

}

opt4_nm()

{

echo "El dominio al cual pertenece es: " `hostname -d`

}

opt5_nm()

{

echo "Las ips de la maquina son: "

ip addr show

}

opt6_nm()

{

echo "Las rutas son: "

ip route show

}

opt7_nm()

{

echo "los dns son: "

cat /etc/resolv.conf

}

opt8_nm()

{

echo "los discos conectados al sistema son: "

fdisk -l

}

opt9_nm()

{

echo "las particiones y uso son: "

df -kh

}

opt10_nm()

{

echo "El tamaño y uso de la RAM es: "

free -m

}

opt11_nm()

{

echo "El uso del procesador es: "

vmstat 2 10

}

opt12_nm()

{

echo "El procesador es: "

cat /proc/cpuinfo | grep 'model name'

}

opt13_nm()

{

echo "Los procesos corriendo son: "

ps xa | less

}

opt14_nm()

{

echo "Los puertos abiertos son: "

netstat -toanp | grep 'LISTEN'

}

opt15_nm()

{

echo "Los ultimos accesos son: "

last | tail -10

}

opt16_nm()

{

if [ `cat /proc/sys/net/ipv4/ip_forward` -eq 0 ] ; then

echo "El reenvio de paquetes esta desactivo"

else

echo "El reenvio de paquetes esta activado"

fi

}

opt17_nm()

{

echo "Los usuarios con acceso de root son: "

cat /etc/passwd | grep ':0:'

}

opt18_nm()

{

echo "Los usuarios con acceso al sistema son: "

cat /etc/passwd | grep 'bash'

}

opt19_nm()

{

echo "Actualizaciones: "

if [ -e /etc/debian_version ] ; then

apt-get update

apt-get upgrade -s

else

if [ -e /etc/redhat_version ]

then

yum update

fi

fi

}

opt20_nm()

{

echo "El estado de SELinux es: " `getenforce`

}

opt21_nm()

{

echo "Las reglas de iptables son: "

iptables -nL

iptables -t nat -nL

}

opt22_nm()

{

which chkrootkit

x=$?

if [ $x -eq 1 ] ; then

{

echo "Chkrootkit NO esta instalado en su sistema"

}

else

{

echo "Chkrootkit esta instalado en su sistema"

}

fi

}

opt23_nm()

{

echo "Los dispositivos scsi conectados al sistema son: "

lsscsi

}

opt24_nm()

{

echo "Los dispositivos usb conectados al sistema son: "

lsusb

}

opt25_nm()

{

echo "El archivo en donde se esta guardando la información es dump.txt en el directorio en: " `pwd`

for i in `seq 1 24`;

do

opt`echo $i`_nm >> dump.txt

echo "\n" >> dump.txt

done

}

sel_opcion()

{

read -p "Seleccione una opción: " opc

echo "\n"

case $opc in

1)

opt1_nm

pedir_tecla

;;

2)

opt2_nm

pedir_tecla

;;

3)

opt3_nm

pedir_tecla

;;

4)

opt4_nm

pedir_tecla

;;

5)

opt5_nm

pedir_tecla

;;

6)

opt6_nm

pedir_tecla

;;

7)

opt7_nm

pedir_tecla

;;

8)

opt8_nm

pedir_tecla

;;

9)

opt9_nm

pedir_tecla

;;

10)

opt10_nm

pedir_tecla

;;

11)

opt11_nm

pedir_tecla

;;

12)

opt12_nm

pedir_tecla

;;

13)

opt13_nm

pedir_tecla

;;

14)

opt14_nm

pedir_tecla

;;

15)

opt15_nm

pedir_tecla

;;

16)

opt16_nm

pedir_tecla

;;

17)

opt17_nm

pedir_tecla

;;

18)

opt18_nm

pedir_tecla

;;

19)

opt19_nm

pedir_tecla

;;

20)

opt20_nm

pedir_tecla

;;

21)

opt21_nm

pedir_tecla

;;

22)

opt22_nm

pedir_tecla

;;

23)

opt23_nm

pedir_tecla

;;

24)

opt24_nm

pedir_tecla

;;

25)

opt25_nm

pedir_tecla

;;

default)

exit 0

;;

esac

}

hola()

{

echo "---------------------Menu principal------------------\nPresione el numero de la opción que desea ver\n"

echo "1. Nombre del sistema"

echo "2. Version del sistema operativo"

echo "3. Version del kernel"

echo "4. Nombre del dominio"

echo "5. Ips de la maquina"

echo "6. Primeras 10 rutas de la maquina"

echo "7. Dns de la maquina"

echo "8. Discos del sistema"

echo "9. Particiones del disco duro y uso"

echo "10. Tamaño y uso de ram"

echo "11. Uso de procesador"

echo "12. Tipo de procesador"

echo "13. Procesos corriendo"

echo "14. Puertos abiertos"

echo "15. Ultimos accesos"

echo "16. Reenvio de paquetes"

echo "17. Usuarios root en el sistema"

echo "18. Usuarios con acceso al sistema"

echo "19. Tiene actualizaciones?"

echo "20. SELinux activado?"

echo "21. Reglas de iptables"

echo "22. Tiene chkrootkit?"

echo "23. Dispositivos scsi"

echo "24. Dispositivos usb"

echo "25. Si usted quiere realizar todas operaciones de testo y guardarlas en un archivo"

echo "Presione cualquier otra tecla para salir\n"

sel_opcion

}

hola

------------------------------------------------------------------------------------------fin del script-----------------------------------------------------------------

jueves, 14 de octubre de 2010

FTP no funciona con Iptables?

Esta ves el problema es con iptables y con ftp.

el caso concreto es que permite conexiones a través de telnet pero cuando se utiliza un cliente ftp este arroja error, el problema radica en que iptables cuando hace NAT no soporta nativamente muy bien a FTP por lo que hay que activar el siguiente modulo:

modprobe ip_nat_ftp

aqui la fuente original del asunto:
http://tldp.org/HOWTO/IP-Masquerade-HOWTO/forwarders.html

miércoles, 25 de agosto de 2010

Samba "smbd interrumpido pero existe un archivo pid"

Al ataque con debian y samba como PDC, muy bonito y todo, en los afanes de configurar una maquina con samba y en el tema de enganchar el samba al ldap se instaló todo de una ves sin iniciar el samba.. se configuró todo y pomba se revienta el samba al iniciarlo y esto por: (NPI)?

En el log nos muestra lo siguiente:

[2010/08/25 17:00:20, 3] smbd/uid.c:push_conn_ctx(358)

push_conn_ctx(0) : conn_ctx_stack_ndx = 0

[2010/08/25 17:00:20, 3] smbd/sec_ctx.c:set_sec_ctx(241)

setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1

[2010/08/25 17:00:20, 3] smbd/sec_ctx.c:pop_sec_ctx(356)

pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0

[2010/08/25 17:00:20, 3] lib/util_seaccess.c:se_access_check(250)

[2010/08/25 17:00:20, 3] lib/util_seaccess.c:se_access_check(251)

se_access_check: user sid is S-1-1-0

se_access_check: also S-1-5-2

se_access_check: also S-1-5-7

[2010/08/25 17:00:20, 0] services/services_db.c:svcctl_init_keys(420)

svcctl_init_keys: key lookup failed! (WERR_ACCESS_DENIED)

[2010/08/25 17:00:20, 3] smbd/sec_ctx.c:push_sec_ctx(208)

push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 1

[2010/08/25 17:00:20, 3] smbd/uid.c:push_conn_ctx(358)

push_conn_ctx(0) : conn_ctx_stack_ndx = 0

[2010/08/25 17:00:20, 3] smbd/sec_ctx.c:set_sec_ctx(241)

setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1

[2010/08/25 17:00:20, 3] smbd/sec_ctx.c:pop_sec_ctx(356)

pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0

A primera vista se ve un (WERR_ACCESS_DENIED) esto se debe a que sencillamente no se había inicializado el samba con las bd locales.

lo que se debe hacer es: en el archivo de configuración del samba colocar o cambiar a:

passdb backend = tdbsam

se para el samba y luego se inicia, ahora si ya se puede cambiar el parámetro para que busque el ldap:

passdb backend = ldapsam:ldap://127.0.0.1

y eso es todo.. ajustado este pequeño inconveniente y una ves mas demostrado que del afan no queda si no el cansancio. :p

domingo, 30 de mayo de 2010

Herramientas de comunicación sincrona y Asincrona

Introducción

La necesidad de comunicarse entre seres humanos a sido una de las grandes motivaciones para que se desarrolle tecnología, llámese tecnología a cualquier elemento innovador construido por el hombre, esta construcción de tecnología nos a hecho llegar hasta al era digital, pasando por tecnologías como el teléfono u el correo convencional, señales sonoras...etc.En la era digital se han encontrado multitud de formas para comunicarnos a través del mismo medio, he aqui la ubicación de tiempo en donde se abordara algunas de las herramientas para comunicarse en su mayoría a través de internet o internet2 (llámese redes metropolitanas privadas).




En los vídeos veremos algunos aportes mas detallados para el proceso de creación y surgimiento de estas herramientas.

Herramientas asincronas:


Correo Electrónico: La forma digital de comunicación mas popularizada en la sociedad de hoy en día, la cual consiste en enviar un mensaje a un buzón digital y esperar a que el destinatario lo lea.

Foro y variantes: Básicamente consiste en una pagina en donde después de haberse registrado se le permite generar discusiones las cuales son controladas en la mayoría de los casos por un moderador.

Redes sociales: Este tipo de comunidad es la evolución de los foros en donde se alimenta a un ritmo exponencial de información en donde su mayoría es contenido sin peso intelectual, solo pocas redes sociales se excluyen de esta clasificación y son aquellas que se dedican a un tema en especifico y no el ocio en general.




Blog: Quiza un derivación de un foro con la diferencia radica en que el contenido rico en contenido visual en la mayoría de los casos es administrado por el dueño del blog a su ves los visitantes pueden aportar en menor medida que en un foro a través de los comentarios.

Microbloogin: Como su nombre lo indica es un blog en versión miniatura, desaparece la abundancia de contenido visual y se centra en la información especifica que se quiere transmitir.

Herramientas sincronas:

Mensajería Instantánea (Chat, IRC): Es un servicio en su mayoría popularizado por MSN Messenger, Yahoo Messenger, estos no hubiesen sido posibles sin el IRC el cual fue el primera forma digital de comunicarse de forma caso instantánea con otra persona conectada a una terminal que fuese miembro de la misma red, hoy en día los servicios de mensajería instantánea incluyen otros métodos de comunicación sincrona como lo es, vídeo chat, vídeo conferencia, callVoIP (llamadas a través de Internet), transferencia de archivos y Compartir juegos.

Telefonía IP: Lejos de ser algo desconocido por la mayoría de los internautas servicios como Skype marcan el inicio de la no dependencia de la telefonía análoga y permitiéndonos llamar a celulares, teléfonos fijos, otros números de skype, números de internet, con todas las características que nos ofrece la telefonía y mas; en skype también encontramos servicios de chat, transferencias de archivos y sus fuertes que son las llamadas VoIp y Tele-conferencia.



Espero que esto sea de la mínima utilidad y utilidad intelectual posible.

Gracias.

lunes, 17 de mayo de 2010

Tap click en debian squeeze/sid

Otra ves a la carga con debian y el touch mouse, esta vez he migrado mi debian de una plataforma intel a una amd y tras no vastar con todo e trasteo de drivers y ya que las configuraciones las toma de una, me ha asaltado de nuevo el problema del tap click en el touch mouse, busque por un buen rato y no encontré nada bueno casi nada jjeje lo que si encontré fue este hermoso comando "synclient" el cual palabras mas palabras menos es la interfaz de linea de comandos del driver synaptics.

Una ves he hecho las mil vueltas le doy "synclient -l" y me arroja:

Parameter settings:

LeftEdge = 1752

RightEdge = 5192

TopEdge = 1620

BottomEdge = 4236

FingerLow = 24

FingerHigh = 36

FingerPress = 255

MaxTapTime = 180

MaxTapMove = 221

MaxDoubleTapTime = 180

SingleTapTimeout = 180

ClickTime = 100

FastTaps = 1

EmulateMidButtonTime = 75

EmulateTwoFingerMinZ = 280

EmulateTwoFingerMinW = 7

VertScrollDelta = 100

HorizScrollDelta = 100

VertEdgeScroll = 1

HorizEdgeScroll = 1

CornerCoasting = 0

VertTwoFingerScroll = 0

HorizTwoFingerScroll = 0

MinSpeed = 0.4

MaxSpeed = 0.7

AccelFactor = 0.00995223

TrackstickSpeed = 40

EdgeMotionMinZ = 29

EdgeMotionMaxZ = 159

EdgeMotionMinSpeed = 1

EdgeMotionMaxSpeed = 401

EdgeMotionUseAlways = 0

UpDownScrolling = 1

LeftRightScrolling = 1

UpDownScrollRepeat = 1

LeftRightScrollRepeat = 1

ScrollButtonRepeat = 100

TouchpadOff = 0

GuestMouseOff = 0

LockedDrags = 1

LockedDragTimeout = 5000

RTCornerButton = 0

RBCornerButton = 0

LTCornerButton = 0

LBCornerButton = 0

TapButton1 = 1

TapButton2 = 0

TapButton3 = 0

ClickFinger1 = 1

ClickFinger2 = 1

ClickFinger3 = 1

CircularScrolling = 0

CircScrollDelta = 30

CircScrollTrigger = 0

CircularPad = 0

PalmDetect = 1

PalmMinWidth = 10

PalmMinZ = 199

CoastingSpeed = 0

PressureMotionMinZ = 29

PressureMotionMaxZ = 159

PressureMotionMinFactor = 1

PressureMotionMaxFactor = 1

GrabEventDevice = 1

TapAndDragGesture = 1

AreaLeftEdge = 0

AreaRightEdge = 0

AreaTopEdge = 0

AreaBottomEdge = 0

En el cual me doy cuenta que:

TapButton1 = 0

la solución fue tan facil como: synclient TapButton1=1

y listo eso fue todo por esta ves ;)

domingo, 27 de diciembre de 2009

zte mfe626 (modem comcel colombia) en linux

Feliz navidad a todos (yo que soy el único que me leo :p) recientemente me traslade a la capital colombiana y deje muchas cosas atrás (sniffff sniff) pero también muchas cosas nuevas dentro de ellas la forma de conectar mi debian a internet, joder lo primero que llego y me encuentro es que no hay linea telefónica y nada por el estilo solo un modem el cual viene preparado para trabajar bajo windows (incluye programita y todo el cuento), investigando por la inet hay muchos modulos de como montar modem 3g en otros países pero no en Colombia, entonces cacharreando (viendo las conf del windows) un poco encontré la solución, requisitos y herramientas utilizadas en este caso.

Requisitos (lo que tengo instalado en este momento)

kernel: Linux w-andrey 2.6.30-2-686 #1 SMP i686 GNU/Linux
programa wvdial (apt-get install wvdial)

En este caso el kernel ya esta en capacidad de detectar los modems 3G pero con el inconveniente que mi entorno kde4 me monta una unidad de cd (Si!! un dispositivo usb lo detecta como cd), en fin es cuestión de desmontarlo para que el kernel ejecute el modulo usbserial.

Entonces cuando se conecta el modem tenemos lo siguiente en el log /var/log/messages

Dec 27 10:22:00 De-andrey kernel: [ 61.164067] usb 1-3: new high speed USB device using ehci_hcd and address 4
Dec 27 10:22:00 De-andrey kernel: [ 61.308775] usb 1-3: New USB device found, idVendor=19d2, idProduct=2000
Dec 27 10:22:00 De-andrey kernel: [ 61.308780] usb 1-3: New USB device strings: Mfr=2, Product=1, SerialNumber=0
Dec 27 10:22:00 De-andrey kernel: [ 61.308783] usb 1-3: Product: ZTE CDMA Technologies MSM
Dec 27 10:22:00 De-andrey kernel: [ 61.308786] usb 1-3: Manufacturer: ZTE, Incorporated
Dec 27 10:22:00 De-andrey kernel: [ 61.308891] usb 1-3: configuration #1 chosen from 1 choice
Dec 27 10:22:00 De-andrey kernel: [ 61.313242] scsi3 : SCSI emulation for USB Mass Storage devices
Dec 27 10:22:00 De-andrey kernel: [ 61.515387] usbcore: registered new interface driver usbserial
Dec 27 10:22:00 De-andrey kernel: [ 61.515402] USB Serial support registered for generic
Dec 27 10:22:00 De-andrey kernel: [ 61.515422] usbcore: registered new interface driver usbserial_generic
Dec 27 10:22:00 De-andrey kernel: [ 61.515424] usbserial: USB Serial Driver core
Dec 27 10:22:00 De-andrey kernel: [ 61.598073] USB Serial support registered for GSM modem (1-port)
Dec 27 10:22:00 De-andrey kernel: [ 61.598115] usbcore: registered new interface driver option
Dec 27 10:22:00 De-andrey kernel: [ 61.598117] option: v0.7.2:USB Driver for GSM modems
Dec 27 10:22:05 De-andrey kernel: [ 66.315316] scsi 3:0:0:0: CD-ROM ZTE USB SCSI CD-ROM 2.31 PQ: 0 ANSI: 0

En este punto tenemos un dispositivo en /dev llamado sr1 entonces tenemos que desmontarlo.

eject /dev/sr1

Una ves echo esto el kernel detecta el modem:

Dec 27 10:24:20 De-andrey kernel: [ 201.420097] usb 1-3: new high speed USB device using ehci_hcd and address 5
Dec 27 10:24:20 De-andrey kernel: [ 201.556666] usb 1-3: New USB device found, idVendor=19d2, idProduct=0031
Dec 27 10:24:20 De-andrey kernel: [ 201.556670] usb 1-3: New USB device strings: Mfr=2, Product=1, SerialNumber=3
Dec 27 10:24:20 De-andrey kernel: [ 201.556673] usb 1-3: Product: ZTE CDMA Technologies MSM
Dec 27 10:24:20 De-andrey kernel: [ 201.556675] usb 1-3: Manufacturer: ZTE, Incorporated
Dec 27 10:24:20 De-andrey kernel: [ 201.556678] usb 1-3: SerialNumber: 1234567890ABCDEF
Dec 27 10:24:20 De-andrey kernel: [ 201.556779] usb 1-3: configuration #1 chosen from 1 choice
Dec 27 10:24:20 De-andrey kernel: [ 201.559925] option 1-3:1.0: GSM modem (1-port) converter detected
Dec 27 10:24:20 De-andrey kernel: [ 201.560039] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB0
Dec 27 10:24:20 De-andrey kernel: [ 201.560160] option 1-3:1.1: GSM modem (1-port) converter detected
Dec 27 10:24:20 De-andrey kernel: [ 201.560218] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB1
Dec 27 10:24:20 De-andrey kernel: [ 201.560713] scsi4 : SCSI emulation for USB Mass Storage devices
Dec 27 10:24:20 De-andrey kernel: [ 201.560968] option 1-3:1.3: GSM modem (1-port) converter detected
Dec 27 10:24:20 De-andrey kernel: [ 201.561079] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB2
Dec 27 10:24:25 De-andrey kernel: [ 206.561936] scsi 4:0:0:0: Direct-Access ZTE MMC Storage 2.31 PQ: 0 ANSI: 2
Dec 27 10:24:25 De-andrey kernel: [ 206.562435] sd 4:0:0:0: Attached scsi generic sg3 type 0
Dec 27 10:24:25 De-andrey kernel: [ 206.565442] sd 4:0:0:0: [sdc] Attached SCSI removable disk


Ahora tenemos tres nuevos dispositivos en /dev, como podemos ver en el log estos dispositivos son: ttyUSB0, ttyUSB1,ttyUSB2.

Muy bien el kernel ya detecta correctamente el modem ahora lo que tenemos que hacer es configurar el wvdial, editamos o creamos el fichero que se encuentra en /etc/wvdial.conf el cual queda de la siguiente forma:

[Dialer Defaults]
#Created by wvdialconf:
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init1 = ATZ
Modem = /dev/ttyUSB2
Phone = *99#
Idle Seconds = 300
Modem Type = USB Modem
Stupid Mode = 1
Compuserve = 0
Baud = 460800
Auto DNS = 1
Dial Command = ATDT
Ask Password = 0
ISDN = 0
Username = COMCELWEB
Password = COMCELWEB
New PPPD = yes

Como podemos ver el único dispositivo útil en este caso es el /dev/ttyUSB2.

Ahora solo nos queda ejecutar wvdial pelado y nos conectara a la red comcel:

De-andrey:/home/xxxxx# wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Idle Seconds = 300, disabling automatic reconnect.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sun Dec 27 10:24:33 2009
--> Pid of pppd: 3495
--> Using interface ppp0
--> pppd: �������[08][18]t�[08][01]
--> pppd: �������[08][18]t�[08][01]
--> pppd: �������[08][18]t�[08][01]
--> pppd: �������[08][18]t�[08][01]
--> pppd: �������[08][18]t�[08][01]
--> pppd: �������[08][18]t�[08][01]
--> local IP address 190.125.100.145
--> pppd: �������[08][18]t�[08][01]
--> remote IP address 10.64.64.64
--> pppd: �������[08][18]t�[08][01]
--> primary DNS address 10.11.12.13
--> pppd: �������[08][18]t�[08][01]
--> secondary DNS address 10.11.12.14
--> pppd: �������[08][18]t�[08][01]

Y listo.

tips:
Comcel tiene un defecto con la asignación dns, y es que me he dado cuenta que estos dns no funcionan muy bn:

--> primary DNS address 10.11.12.13
--> pppd: �������[08][18]t�[08][01]
--> secondary DNS address 10.11.12.14

Por lo cual coloco el siguiente dns primario en /etc/resolv.conf

nameserver 4.2.2.3

y con esto se resuelve.

Adicionalmente les dejo el archivo de configuración para conectarse a movistar (no recuerdo el modem)

[Dialer Defaults]
Phone = *99***1#
Username = movistar
Password = movistar
Stupid Mode = 1
Dial Command = ATDT

[Dialer reset]
Modem = /dev/ttyUSB0
Init1 = AT

[Dialer movistar]
Phone = *99#
Modem = /dev/ttyUSB0
Baud = 460800
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem
Init5 =AT+CGDCONT=1,"IP","internet.movistar.com.co";

Espero que os sirva en algo o a alguien jeje..


sábado, 17 de octubre de 2009

Akonadi Server Self-Test Report - (Chorrada de errores iniciando akonadi)

Sigo con las experiencias el debian (me resisto a cambiarme de SO :p) esta ves el problema fue una actualizacion del servidor de akonadi en las cuales algunas cosas salieron mal, dentro de las cuales estan que los registros de mysql se reventaron (no me pregunteis
detalles que no tengo idea del detalle), como tambien que el servidor como tal de akonadi se corrompio, solucion: cargarse las conf si no tienes nada importante y esto me da pie para otra cosa haced backups de vuetros datos cada ves que hagas actualizaciones y ya no quiero decir si estas en un sistema inestable:

los errores que me salen en el reporte son los siguientes:

Akonadi Server Self-Test Report
===============================

Test 1: SUCCESS
--------

Database driver found.
Details: The QtSQL driver 'QMYSQL' is required by your current Akonadi server configuration.
The following drivers are installed: QSQLITE, QMYSQL3, QMYSQL.
Make sure the required driver is installed.

File content of '/home/andrey/.config/akonadi/akonadiserverrc':
[%General]
Driver=QMYSQL
SizeThreshold=4096
ExternalPayload=false

[QMYSQL]
Name=akonadi
User=
Password=
Options="UNIX_SOCKET=/home/andrey/.local/share/akonadi/db_misc/mysql.socket"
ServerPath=/usr/sbin/mysqld
StartServer=true

[Debug]
Tracer=null


Test 2: SUCCESS
--------

MySQL server found.
Details: You currently have configured Akonadi to use the MySQL server '/usr/sbin/mysqld'.
Make sure you have the MySQL server installed, set the correct path and ensure you have the necessary read and execution rights on the server executable. The server executable is typically called 'mysqld', its locations varies depending on the distribution.

Test 3: SUCCESS
--------

MySQL server is executable.
Details: MySQL server found: /usr/sbin/mysqld Ver 5.1.37-2 for debian-linux-gnu on i486 ((Debian))


Test 4: ERROR
--------

MySQL server log contains errors.
Details: The MySQL server error log file '/home/andrey/.local/share/akonadi/db_data/mysql.err' contains errors.

File content of '/home/andrey/.local/share/akonadi/db_data/mysql.err':
091017 14:41:34 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
091017 14:41:34 InnoDB: Retrying to lock the first data file
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.


Test 5: SUCCESS
--------

MySQL server default configuration found.
Details: The default configuration for the MySQL server was found and is readable at /etc/akonadi/mysql-global.conf.

File content of '/etc/akonadi/mysql-global.conf':
#
# Global Akonadi MySQL server settings,
# These settings can be adjusted using $HOME/.config/akonadi/mysql-local.conf
#
# Based on advice by Kris Köhntopp
#
[mysqld]
skip_grant_tables
skip_networking

# strict query parsing/interpretation
# TODO: make Akonadi work with those settings enabled
#sql_mode=strict_trans_tables,strict_all_tables,strict_error_for_division_by_zero,no_auto_create_user,no_auto_value_on_zero,no_engine_substitution,no_zero_date,no_zero_in_date,only_full_group_by,pipes_as_concat
#sql_mode=strict_trans_tables

# use InnoDB for transactions and better crash recovery
default_storage_engine=innodb
# case-insensitive table names, avoids trouble on windows
lower_case_table_names=1
character_set_server=latin1
collation_server=latin1_general_ci
table_cache=200
thread_cache_size=3
log_bin=mysql-bin
expire_logs_days=3
#sync_bin_log=0
# error log file name, relative to datadir
log_error=mysql.err
log_warnings=2
# log all queries, useful for debugging but generates an enormous amount of data
#log=mysql.full
# log queries slower than n seconds, log file name relative to datadir
log_slow_queries=mysql.slow
long_query_time=1
# log queries not using indices, debug only, disable for production use
log_queries_not_using_indexes=1
# maximum blob size
max_allowed_packet=32M
max_connections=256
# makes sense when having the same query multiple times
# makes no sense with prepared statements and/or transactions
query_cache_type=0
query_cache_size=0

innodb_file_per_table=1
innodb_log_buffer_size=1M
innodb_additional_mem_pool_size=1M
# messure database size and adjust
# SELECT sum(data_length) as bla, sum(index_length) as blub FROM information_schema.tables WHERE table_schema not in ("mysql", "information_schema");
innodb_buffer_pool_size=80M
# size of average write burst, keep Innob_log_waits small, keep Innodb_buffer_pool_wait_free small (see show global status like "inno%", show global variables)
innodb_log_file_size=64M
innodb_flush_log_at_trx_commit=2



Test 6: SUCCESS
--------

MySQL server custom configuration found.
Details: The custom configuration for the MySQL server was found and is readable at /home/andrey/.config/akonadi/mysql-local.conf

File content of '/home/andrey/.config/akonadi/mysql-local.conf':
user=andrey


Test 7: SUCCESS
--------

MySQL server configuration is usable.
Details: The MySQL server configuration was found at /home/andrey/.local/share/akonadi/mysql.conf and is readable.

File content of '/home/andrey/.local/share/akonadi/mysql.conf':
#
# Global Akonadi MySQL server settings,
# These settings can be adjusted using $HOME/.config/akonadi/mysql-local.conf
#
# Based on advice by Kris Köhntopp
#
[mysqld]
skip_grant_tables
skip_networking

# strict query parsing/interpretation
# TODO: make Akonadi work with those settings enabled
#sql_mode=strict_trans_tables,strict_all_tables,strict_error_for_division_by_zero,no_auto_create_user,no_auto_value_on_zero,no_engine_substitution,no_zero_date,no_zero_in_date,only_full_group_by,pipes_as_concat
#sql_mode=strict_trans_tables

# use InnoDB for transactions and better crash recovery
default_storage_engine=innodb
# case-insensitive table names, avoids trouble on windows
lower_case_table_names=1
character_set_server=latin1
collation_server=latin1_general_ci
table_cache=200
thread_cache_size=3
log_bin=mysql-bin
expire_logs_days=3
#sync_bin_log=0
# error log file name, relative to datadir
log_error=mysql.err
log_warnings=2
# log all queries, useful for debugging but generates an enormous amount of data
#log=mysql.full
# log queries slower than n seconds, log file name relative to datadir
log_slow_queries=mysql.slow
long_query_time=1
# log queries not using indices, debug only, disable for production use
log_queries_not_using_indexes=1
# maximum blob size
max_allowed_packet=32M
max_connections=256
# makes sense when having the same query multiple times
# makes no sense with prepared statements and/or transactions
query_cache_type=0
query_cache_size=0

innodb_file_per_table=1
innodb_log_buffer_size=1M
innodb_additional_mem_pool_size=1M
# messure database size and adjust
# SELECT sum(data_length) as bla, sum(index_length) as blub FROM information_schema.tables WHERE table_schema not in ("mysql", "information_schema");
innodb_buffer_pool_size=80M
# size of average write burst, keep Innob_log_waits small, keep Innodb_buffer_pool_wait_free small (see show global status like "inno%", show global variables)
innodb_log_file_size=64M
innodb_flush_log_at_trx_commit=2

user=andrey


Test 8: SUCCESS
--------

akonadictl found and usable
Details: The program '/usr/bin/akonadictl' to control the Akonadi server was found and could be executed successfully.
Result:
Akonadi 1.2.1


Test 9: ERROR
--------

Akonadi control process not registered at D-Bus.
Details: The Akonadi control process is not registered at D-Bus which typically means it was not started or encountered a fatal error during startup.

Test 10: ERROR
--------

Akonadi server process not registered at D-Bus.
Details: The Akonadi server process is not registered at D-Bus which typically means it was not started or encountered a fatal error during startup.

Test 11: SKIP
--------

Protocol version check not possible.
Details: Without a connection to the server it is not possible to check if the protocol version meets the requirements.

Test 12: ERROR
--------

No resource agents found.
Details: No resource agents have been found, Akonadi is not usable without at least one. This usually means that no resource agents are installed or that there is a setup problem. The following paths have been searched: '/usr/share/akonadi/agents /usr/share/akonadi/agents'. The XDG_DATA_DIRS environment variable is set to '/usr/share:/usr/share:/usr/local/share', make sure this includes all paths where Akonadi agents are installed to.

Directory listing of '/usr/share/akonadi/agents':
birthdaysresource.desktop
distlistresource.desktop
icalresource.desktop
imapresource.desktop
kabcresource.desktop
kcalresource.desktop
knutresource.desktop
kolabproxyresource.desktop
localbookmarksresource.desktop
maildirresource.desktop
microblog.desktop
nepomukcontactfeeder.desktop
nepomukemailfeeder.desktop
nepomuktagresource.desktop
nntpresource.desktop
notesresource.desktop
strigifeeder.desktop
vcarddirresource.desktop
vcardresource.desktop
Directory listing of '/usr/share/akonadi/agents':
birthdaysresource.desktop
distlistresource.desktop
icalresource.desktop
imapresource.desktop
kabcresource.desktop
kcalresource.desktop
knutresource.desktop
kolabproxyresource.desktop
localbookmarksresource.desktop
maildirresource.desktop
microblog.desktop
nepomukcontactfeeder.desktop
nepomukemailfeeder.desktop
nepomuktagresource.desktop
nntpresource.desktop
notesresource.desktop
strigifeeder.desktop
vcarddirresource.desktop
vcardresource.desktop

Environment variable XDG_DATA_DIRS is set to '/usr/share:/usr/share:/usr/local/share'

Test 13: ERROR
--------

Current Akonadi server error log found.
Details: The Akonadi server did report error during startup into /home/andrey/.local/share/akonadi/akonadiserver.error.

File content of '/home/andrey/.local/share/akonadi/akonadiserver.error':
"Unable to add column 'id' to table 'CollectionTable'.
Query error: 'Table 'akonadi.collectiontable' doesn't exist QMYSQL3: Unable to execute statement'"
Unable to initialize database.
"[
0: akonadiserver(_Z11akBacktracev+0x35) [0x8051e25]
1: akonadiserver [0x80522d6]
2: [0xb8038400]
3: [0xb8038424]
4: /lib/i686/cmov/libc.so.6(gsignal+0x50) [0xb79613d0]
5: /lib/i686/cmov/libc.so.6(abort+0x185) [0xb7964a85]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x8d) [0xb7cd042d]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x8052f54]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x9e) [0xb7d62cbe]
9: /usr/lib/libQtCore.so.4 [0xb7d6fc05]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x68) [0xb7d6ff28]
11: akonadiserver(_ZN6QDebugD1Ev+0x44) [0x804dc34]
12: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x641) [0xb7f20f91]
13: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x56) [0xb7f21cd6]
14: akonadiserver(main+0x398) [0x804d038]
15: /lib/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb794c7a5]
16: akonadiserver [0x804cbd1]
]
"


Test 14: ERROR
--------

Previous Akonadi server error log found.
Details: The Akonadi server did report error during its previous startup into /home/andrey/.local/share/akonadi/akonadiserver.error.old.

File content of '/home/andrey/.local/share/akonadi/akonadiserver.error.old':
"Unable to add column 'id' to table 'CollectionTable'.
Query error: 'Table 'akonadi.collectiontable' doesn't exist QMYSQL3: Unable to execute statement'"
Unable to initialize database.
"[
0: akonadiserver(_Z11akBacktracev+0x35) [0x8051e25]
1: akonadiserver [0x80522d6]
2: [0xb7fef400]
3: [0xb7fef424]
4: /lib/i686/cmov/libc.so.6(gsignal+0x50) [0xb79183d0]
5: /lib/i686/cmov/libc.so.6(abort+0x185) [0xb791ba85]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x8d) [0xb7c8742d]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x8052f54]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x9e) [0xb7d19cbe]
9: /usr/lib/libQtCore.so.4 [0xb7d26c05]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x68) [0xb7d26f28]
11: akonadiserver(_ZN6QDebugD1Ev+0x44) [0x804dc34]
12: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x641) [0xb7ed7f91]
13: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x56) [0xb7ed8cd6]
14: akonadiserver(main+0x398) [0x804d038]
15: /lib/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb79037a5]
16: akonadiserver [0x804cbd1]
]
"


Test 15: SUCCESS
--------

No current Akonadi control error log found.
Details: The Akonadi control process did not report any errors during its current startup.

Test 16: SUCCESS
--------

No previous Akonadi control error log found.
Details: The Akonadi control process did not report any errors during its previous startup.




bueno aqui el comando magico que lo encontre en :

http://forum.kde.org/viewtopic.php?f=18&t=29061

killall mysqld & killall akonadictl & killall akonadi_control & killall akonadiserver & rm -rf ~/.config/akonadi/ & rm -rf ~/.local/share/akonadi

la exlicacion rapida es: cargate todos los servicios relacionados con mysql y akonadi, despues de esto hacele palos a los directorios de configuracion del akonadi, y listo reinicas por ejemplo el kontact y mola como comienza a migrar las cosillas que hay pendientes por ahi.

salutes para mi mismo que soy quien me escribo jajjajaj..