elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Trabajando con las ramas de git (tercera parte)


+  Foro de elhacker.net
|-+  Comunicaciones
| |-+  Redes
| | |-+  Error al intentar insertar en mi servidor mrtg en linux
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Error al intentar insertar en mi servidor mrtg en linux  (Leído 7,497 veces)
fuenteRea


Desconectado Desconectado

Mensajes: 2.709


Volver a ser un niño


Ver Perfil
Error al intentar insertar en mi servidor mrtg en linux
« en: 19 Abril 2011, 00:59 am »

Hola amigos,

estoy siguiendo un manual (http://debianhelp.co.uk/mrtg) para poner mrtg en mi servidor web, pero llevo todo el día intentando a ver por qué puede ser y no lo consigo.

Vamos por partes. Pasos iniciales hechos correctamente

Paso siguiente
Now we need to assign the snmp community name in snmp configration file /etc/snmp/snmpd.conf
Citar
# sec.name source community
# com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private

--> Aquí lo que he hecho ha sido añadir esas líneas al final del fichero .conf

Reinicio el servicio. A continuación

The configuration file creating using

#cfgmaker public@localhost > /etc/mrtg.cfg  --> Esto lo hace bien

Creating a configuration file for a device using

#cfgmaker public@192.168.0.1 >> /etc/mrtg.cfg --> He sustituido esta ip por la ip de mi pc en mi red local, no sé si eso es correcto. He probado también con esa dirección y con la puerta de enlace, pero todas me tiran este error:

Citar
root@debianserver:/home/debian# cfgmaker public@192.168.1.11 >> /etc/mrtg.cfg
SNMP Error:
no response received
SNMPv1_Session (remote host: "192.168.1.11" [192.168.1.11].161)
                  community: "public"
                 request ID: 1574989891
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/share/perl5/SNMP_util.pm line 629
SNMPWALK Problem for 1.3.6.1.2.1.1 on public@192.168.1.11::::::v4only
 at /usr/bin/cfgmaker line 961
WARNING: Skipping public@192.168.1.11: as no info could be retrieved

y ya no puedo seguir.

No obstante continué con el paso siguiente

With the configuration file created correctly there's only one other thing you have to do and that's to use the indexmaker utility to create the summary home page. Since you have to re-run this command every time you make certain changes to the /etc/mrtg.cfg configuration file,

Creating index file for the webserver using

#indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html

Pero me tira este error
Use of uninitialized value $first in hash element at /usr/bin/indexmaker line 353.


un saludo. siento ser tan pesado. muchas gracias.


EDITO: Se me ha olvidado decir que el puerto 161 lo tengo abierto. Protocolo UDP a través de la configuración de nat


« Última modificación: 19 Abril 2011, 11:34 am por thedoctor77 » En línea

Una rosa es una rosa...
EvilGoblin


Desconectado Desconectado

Mensajes: 2.323


YO NO LA VOTE!


Ver Perfil
Re: Error al intentar insertar en mi servidor mrtg en linux
« Respuesta #1 en: 19 Abril 2011, 17:59 pm »

por lo que se lee aca

Código:
SNMP Error:
no response received

El Deamon no esta corriendo. y deberias segurarte si realmente cfgmaker esta haciendo lo que deberia. que es crear un archivo de configuracion.

revisa el archivo /etc/mrtg.cfg

tambien busca en googles palabras que te orienten a uno donde funciona.

yo buscaria frases como SNMPv1_Session (remote host: en google

y tmb cfgmaker SNMP Error: no response received

para ver si gente tuvo el mismo error.


Pero para mi es problema de los deamons que no estan corriendo.


En línea

Experimental Serial Lain [Linux User]
fuenteRea


Desconectado Desconectado

Mensajes: 2.709


Volver a ser un niño


Ver Perfil
Re: Error al intentar insertar en mi servidor mrtg en linux
« Respuesta #2 en: 19 Abril 2011, 18:17 pm »

Hola

muchas gracias, el archivo mrtg.cfg en princio está vacío, ya que lo crea con el comando

mira esto es lo que me pone:

Citar
# Global Settings

RunAsDaemon: yes
EnableIPv6: no
WorkDir: /var/www/mrtg
Options[_]: bits,growright
WriteExpires: Yes

Title[^]: Traffic Analysis for

You will find a crontab running every 5 minutes as user root

# cat /etc/cron.d/mrtg
0-55/5 * * * * root if [ -x /usr/bin/mrtg ] && [ -r /etc/mrtg.cfg ]; then env LANG=C /usr/bin/mrtg /etc/mrtg.cfg >> /var/log/mrtg/mrtg.log 2>&1; fi

el fichero: /etc/snmp/snmpd.conf contiene

Citar
###############################################################################
#
# EXAMPLE.conf:
#   An example configuration file for configuring the Net-SNMP agent ('snmpd')
#   See the 'snmpd.conf(5)' man page for details
#
#  Some entries are deliberately commented out, and will need to be explicitly activated
#
###############################################################################
#
#  AGENT BEHAVIOUR
#

#  Listen for connections from the local system only
agentAddress  udp:127.0.0.1:161
#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
#agentAddress udp:161,udp6:[::1]:161



###############################################################################
#
#  SNMPv3 AUTHENTICATION
#
#  Note that these particular settings don't actually belong here.
#  They should be copied to the file /var/lib/snmp/snmpd.conf
#     and the passwords changed, before being uncommented in that file *only*.
#  Then restart the agent

#  createUser authOnlyUser  MD5 "remember to change this password"
#  createUser authPrivUser  SHA "remember to change this one too"  DES
#  createUser internalUser  MD5 "this is only ever used internally, but still change the password"

#  If you also change the usernames (which might be sensible),
#  then remember to update the other occurances in this example config file to match.



###############################################################################
#
#  ACCESS CONTROL
#

                                                 #  system + hrSystem groups only
view   systemonly  included   .1.3.6.1.2.1.1
view   systemonly  included   .1.3.6.1.2.1.25.1

                                                 #  Full access from the local host
#rocommunity public  localhost
                                                 #  Default access to basic system info
 rocommunity public  default    -V systemonly

                                                 #  Full access from an example network
                                                 #     Adjust this network address to match your local
                                                 #     settings, change the community string,
                                                 #     and check the 'agentAddress' setting above
#rocommunity secret  10.0.0.0/16

                                                 #  Full read-only access for SNMPv3
 rouser   authOnlyUser
                                                 #  Full write access for encrypted requests
                                                 #     Remember to activate the 'createUser' lines above
#rwuser   authPrivUser   priv

#  It's no longer typically necessary to use the full 'com2sec/group/access' configuration
#  r[ou]user and r[ow]community, together with suitable views, should cover most requirements



###############################################################################
#
#  SYSTEM INFORMATION
#

#  Note that setting these values here, results in the corresponding MIB objects being 'read-only'
#  See snmpd.conf(5) for more details
sysLocation    Sitting on the Dock of the Bay
sysContact     Me <me@example.org>
                                                 # Application + End-to-End layers
sysServices    72


#
#  Process Monitoring
#
                               # At least one  'mountd' process
proc  mountd
                               # No more than 4 'ntalkd' processes - 0 is OK
proc  ntalkd    4
                               # At least one 'sendmail' process, but no more than 10
proc  sendmail 10 1

#  Walk the UCD-SNMP-MIB::prTable to see the resulting output
#  Note that this table will be empty if there are no "proc" entries in the snmpd.conf file


#
#  Disk Monitoring
#
                               # 10MBs required on root disk, 5% free on /var, 10% free on all other disks
disk       /     10000
disk       /var  5%
includeAllDisks  10%

#  Walk the UCD-SNMP-MIB::dskTable to see the resulting output
#  Note that this table will be empty if there are no "disk" entries in the snmpd.conf file


#
#  System Load
#
                               # Unacceptable 1-, 5-, and 15-minute load averages
load   12 10 5

#  Walk the UCD-SNMP-MIB::laTable to see the resulting output
#  Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file



###############################################################################
#
#  ACTIVE MONITORING
#

                                    #   send SNMPv1  traps
 trapsink     localhost public
                                    #   send SNMPv2c traps
#trap2sink    localhost public
                                    #   send SNMPv2c INFORMs
#informsink   localhost public

#  Note that you typically only want *one* of these three lines
#  Uncommenting two (or all three) will result in multiple copies of each notification.


#
#  Event MIB - automatically generate alerts
#
                                   # Remember to activate the 'createUser' lines above
iquerySecName   internalUser      
rouser          internalUser
                                   # generate traps on UCD error conditions
defaultMonitors          yes
                                   # generate traps on linkUp/Down
linkUpDownNotifications  yes



###############################################################################
#
#  EXTENDING THE AGENT
#

#
#  Arbitrary extension commands
#
 extend    test1   /bin/echo  Hello, world!
 extend-sh test2   echo Hello, world! ; echo Hi there ; exit 35
#extend-sh test3   /bin/sh /tmp/shtest

#  Note that this last entry requires the script '/tmp/shtest' to be created first,
#    containing the same three shell commands, before the line is uncommented

#  Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table
#     and nsExtendOutput2Table) to see the resulting output

#  Note that the "extend" directive supercedes the previous "exec" and "sh" directives
#  However, walking the UCD-SNMP-MIB::extTable should still returns the same output,
#     as well as the fuller results in the above tables.


#
#  "Pass-through" MIB extension command
#
#pass .1.3.6.1.4.1.8072.2.255  /bin/sh       PREFIX/local/passtest
#pass .1.3.6.1.4.1.8072.2.255  /usr/bin/perl PREFIX/local/passtest.pl

# Note that this requires one of the two 'passtest' scripts to be installed first,
#    before the appropriate line is uncommented.
# These scripts can be found in the 'local' directory of the source distribution,
#     and are not installed automatically.

#  Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output


#
#  AgentX Sub-agents
#
                                           #  Run as an AgentX master agent
 master          agentx
                                           #  Listen for network connections (from localhost)
                                           #    rather than the default named socket /var/agentx/master
#agentXSocket    tcp:localhost:705

# sec.name source community
# com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private


a continuación ejecuto el comando

Citar
cfgmaker public@localhost > /etc/mrtg.cfg

aunque me parece un poco extraño y he probado con este, ya que este concatena y el otro sobreescribe
Citar
cfgmaker public@localhost >> /etc/mrtg.cfg

aqui funciona perfectamente y añade al fichero esto:

Citar
# Created by
# /usr/bin/cfgmaker public@localhost


### Global Config Options

#  for UNIX
# WorkDir: /home/http/mrtg

#  for Debian
WorkDir: /var/www/mrtg

#  or for NT
# WorkDir: c:\mrtgdata

### Global Defaults

#  to get bits instead of bytes and graphs growing to the right
# Options[_]: growright, bits

EnableIPv6: no

######################################################################
# System: debianserver
# Description: Linux debianserver 2.6.32-5-amd64 #1 SMP Mon Mar 7 21:35:22 UTC 2011 x86_64
# Contact: Me <me@example.org>
# Location: Sitting on the Dock of the Bay
######################################################################


a continuación ejecuto el comando conflictivo:
Citar
cfgmaker public@192.168.1.11 >> /etc/mrtg.cfg

a lo cual me da el error anteriormente dicho y me añade esto al fichero:
Citar
# Created by
# /usr/bin/cfgmaker public@192.168.1.11


### Global Config Options

#  for UNIX
# WorkDir: /home/http/mrtg

#  for Debian
WorkDir: /var/www/mrtg

#  or for NT
# WorkDir: c:\mrtgdata

### Global Defaults

#  to get bits instead of bytes and graphs growing to the right
# Options[_]: growright, bits

EnableIPv6: no

######################################################################
# System:
# Description:
# Contact:
# Location:
######################################################################


finalmete decir que en el error que las líneas de los errores:

at /usr/share/perl5/SNMP_util.pm line 629
SNMPWALK Problem for 1.3.6.1.2.1.1 on public@192.168.1.11::::::v4only

Citar
 while(($SNMP_util::Version ne '1' and $session->{'use_getbulk'})

at /usr/bin/cfgmaker line 961
WARNING: Skipping public@192.168.1.11: as no info could be retrieved
Citar
   my @variables = snmpwalk(v4onlyifnecessary($router, $ipv4only),$v3opt,'1.3.6.1.2.1.1'); # walk system



un saludo y muchas gracias

PD:EvilGoblin, te prometo que he buscado un montón y no he encontrado algo que me solucione el problema.
« Última modificación: 19 Abril 2011, 18:21 pm por thedoctor77 » En línea

Una rosa es una rosa...
EvilGoblin


Desconectado Desconectado

Mensajes: 2.323


YO NO LA VOTE!


Ver Perfil
Re: Error al intentar insertar en mi servidor mrtg en linux
« Respuesta #3 en: 19 Abril 2011, 18:29 pm »

Bueno como dice ahi, en la IP 192.168.1.11  no hay ningun servidor.

Revisa bien, que el error esta en eso

hace un telnet 192.168.1.11 161

ahi o no existe el servidor, o esta bloqueado o no da la respuesta correcta que espera el programa
En línea

Experimental Serial Lain [Linux User]
fuenteRea


Desconectado Desconectado

Mensajes: 2.709


Volver a ser un niño


Ver Perfil
Re: Error al intentar insertar en mi servidor mrtg en linux
« Respuesta #4 en: 19 Abril 2011, 19:26 pm »

Hola EvilGoblin, muchas gracias,

he hecho telnet tal y como dices:

Citar
root@debianserver:/home/router# telnet 192.168.1.11 161
Trying 192.168.1.11...
telnet: Unable to connect to remote host: Connection refused


Efectivamente no conecta. No comprendo el motivo. El server tiene:

->desde mi ordenador
127.0.0.1 -> pagina principal de apache2
127.0.0.1/Joomla -> Una pagina web en joomla

192.168.1.11 es mi dirección de red detro de mi red local, de ahí que yo pusiera eso, ¿debo poner otra cosa?

un saludo.


PD: Acabo de hacer telnet a mi servidor ftp 127.0.0.1 al puerto 21 y conecta y también al 127.0.0.1 al puerto 80 y apache también funciona. Sin embargo hago telnet 127.0.0.1 161 y no va.
Tengo el puerto 161 abierto con protocolo UDP
« Última modificación: 19 Abril 2011, 19:33 pm por thedoctor77 » En línea

Una rosa es una rosa...
EvilGoblin


Desconectado Desconectado

Mensajes: 2.323


YO NO LA VOTE!


Ver Perfil
Re: Error al intentar insertar en mi servidor mrtg en linux
« Respuesta #5 en: 19 Abril 2011, 19:57 pm »

AAhh cierto, UDP

entonces prueba con

nc -v -v -t 192.168.1.11 -u 161

o tambien snmpset

a ver si tienes algun problema con tu servidor
En línea

Experimental Serial Lain [Linux User]
fuenteRea


Desconectado Desconectado

Mensajes: 2.709


Volver a ser un niño


Ver Perfil
Re: Error al intentar insertar en mi servidor mrtg en linux
« Respuesta #6 en: 19 Abril 2011, 20:03 pm »

hola EvilGoblin, muy amable por tu ayuda, te posteo los resultados

root@debianserver:/home/router# nc -v -v 192.168.1.11 -u 161
debianserver.local [192.168.1.11] 161 (snmp) open
s
 sent 2, rcvd 0
root@debianserver:/home/router# snmpset
bash: snmpset: no se encontró la orden
En línea

Una rosa es una rosa...
EvilGoblin


Desconectado Desconectado

Mensajes: 2.323


YO NO LA VOTE!


Ver Perfil
Re: Error al intentar insertar en mi servidor mrtg en linux
« Respuesta #7 en: 19 Abril 2011, 21:16 pm »

Funciona como localhost y como tu Ip te cierra la sesion..

tenes algun firewall?
tienes tcp wrappers activo?

no puede funcionar solo con @localhost ?

y podrias probar algo asi?
cfgmaker --output=/etc/mrtg/localhost.cfg -ifref=ip --global "workdir: /var/www/html/mrtg/stats" public@192.168.1.11



y aca tenian el mismo problema que vos.
http://webcache.googleusercontent.com/search?q=cache:Mm-brtwmp7MJ:www.groupsrv.com/computers/about571771.html+SNMPWALK+Problem+for+1.3.6.1.2.1.1+on+public%40+::::::v4only&cd=9&hl=es&ct=clnk&client=firefox-a&source=www.google.com
En línea

Experimental Serial Lain [Linux User]
fuenteRea


Desconectado Desconectado

Mensajes: 2.709


Volver a ser un niño


Ver Perfil
Re: Error al intentar insertar en mi servidor mrtg en linux
« Respuesta #8 en: 19 Abril 2011, 21:58 pm »

Funciona como localhost y como tu Ip te cierra la sesion..

tenes algun firewall?

no
tienes tcp wrappers activo?
no sé que es eso, así que imagino que no.

no puede funcionar solo con @localhost ?
pues no sé porque no se como funciona, sé que es un "witget" que permite sacar estadísticas. Sigo las instrucciones que dije antes (no sé demasiado inglés, la verdad)

y podrias probar algo asi?
cfgmaker --output=/etc/mrtg/localhost.cfg -ifref=ip --global "workdir: /var/www/html/mrtg/stats" public@192.168.1.11
si, lo acabo de probar. Me da el mismo error.

el comando snmpwalk no me lo reconoce, no obstante creo que por ahí no van los tiros.



Por si sirve de algo la dirección 192.168.1.11 la estoy poniendo porque según las instrucciones uno de los pasos dice que ponga 192.168.0.1 y he imaginado que eso es mi dirección ip dentro de mi red local.

un saludo y muchas gracias por tu ayuda.

EDITO: Creo y digo creo que ya he conseguido solucionarlo. Postearé la solución si es cierto, voy a esperar un rato a ver que pasa
« Última modificación: 19 Abril 2011, 23:09 pm por thedoctor77 » En línea

Una rosa es una rosa...
fuenteRea


Desconectado Desconectado

Mensajes: 2.709


Volver a ser un niño


Ver Perfil
Re: Error al intentar insertar en mi servidor mrtg en linux
« Respuesta #9 en: 20 Abril 2011, 02:40 am »

NO está solucionado.

he conseguido que me cree los archivos index. Pero las gráficas de mrtg no se mueven ni hacen nada, está todo a cero! esto es lo que he añadido para que me registre la cpu y nada de nada

Citar
Target[localhost.cpu]:ssCpuRawUser.0&ssCpuRawUser.0:public@127.0.0.1+ ssCpuRawSystem.0&ssCpuRawSystem.0:public@127.0.0.1+ ssCpuRawNice.0&ssCpuRawNice.0:public@127.0.0.1
RouterUptime[localhost.cpu]: public@127.0.0.1
MaxBytes[localhost.cpu]: 100
Title[localhost.cpu]: CPU Load
PageTop[localhost.cpu]: <H1>Active CPU Load %</H1>
#Unscaled[localhost.cpu]: ymwd
ShortLegend[localhost.cpu]: %
YLegend[localhost.cpu]: CPU Utilization
Legend1[localhost.cpu]: Active CPU in % (Load)
Legend2[localhost.cpu]:
Legend3[localhost.cpu]:
Legend4[localhost.cpu]:
LegendI[localhost.cpu]: Active
LegendO[localhost.cpu]:
Options[localhost.cpu]: growright,nopercent

estoy completamente desesperado. ¿A alguien le funciona mrtg?

un saludo!!
En línea

Una rosa es una rosa...
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Error al intentar grabar
Software
YeKTa 4 2,622 Último mensaje 28 Abril 2004, 10:06 am
por YeKTa
Me da este error al intentar reproducir
Multimedia
g-unit 8 2,449 Último mensaje 23 Noviembre 2005, 23:52 pm
por Sourraund
Error al intentar compilar.. Ayuda!
Programación Visual Basic
3nr1qu3 4 1,890 Último mensaje 31 Mayo 2007, 02:46 am
por [M]orfina
Error al intentar hacer Ping a servidor externo en consola Windows 10
Dudas Generales
aprendiendohacking2020 3 2,122 Último mensaje 1 Octubre 2019, 02:15 am
por engel lex
Error 500 al intentar subir archivo al servidor
PHP
UsuarioZ 4 2,598 Último mensaje 2 Agosto 2023, 12:11 pm
por mchojrin
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines