[opensuse-es] MRTG inside of NAGIOS
Distro: Opensuse 11.0 Ok ya tengo MRTG y Nagios configurados, estuve leyendo que Nagios tiene su propio plugin para trabajar con nagios, mas sin embargo aun no logro que desde nagios se me muestren las estadisticas que mrtg me ha estado arrojando. El MRTG lo tengo creado de la siguiente manera. # cd /srv/www/htdocs/mrtg/pub_html # cfgmaker --global 'WorkDir: /srv/virtual/mrtg' --show-op-down --output /srv/www/htdocs/mrtg/cfg/mrtg.cfg comunity@xxx.xxx.xxx.xxx # mrtg ../cfg/mrtg.cfg ; indexmaker --title=Outbound_Inbound_Traffic --subtitle=MRTG_Stats --pagetop=Esta\ pagina\ es\ un\ Beta\! --output=index.html ../cfg/mrtg.cfg De esta forma puedo ver en mi servidor web la pagina mostrada por mrtg. Ya tengo Nagios, y tengo configurado el monitoreo a dos hosts, uno a windows y otro a linux, existen documentacion pero para switch y segun esta pagina http://nagios.linuxbaja.org/node/35 deberia de ser asi el fichero para que mande a buscar el log del mrtg define service{ use generic-service ; Inherit values from a template host_name myhostname service_description Description check_command check_local_mrtgtraf!/srv/www/htdocs/mrtg/pub_html/192.168.1.1_1.log!AVG!1000000,2000000!5000000,5000000!10 } pero el nagios no se ejecuta y lo unico que muestra es que verifique el error pero este no indica nada solo lo siguiente sin darme ninguna pista. Solo se que algo estoy haciendo mal o que mrtg y nagios son incompatibles. Ambos paquetes los he instalado de los repositorios, asi que no se que anda mal. ***> One or more problems was encountered while processing the config files... Check your configuration file(s) to ensure that they contain valid directives and data defintions. If you are upgrading from a previous version of Nagios, you should be aware that some variables/definitions may have been removed or modified in this version. Make sure to read the HTML documentation regarding the config files, as well as the 'Whats New' section to find out what has changed. He leido la documentacion y estoy perdido ya que segun esa pagina solo hay que crear el fichero con esas opciones y en la ayuda de nagios me indica una plantilla que dice mas o menos asi para el mrtg.cfg: ################################################################### # MRTG Graphs: Nagios 3.0.6 Statistics # # You can add the following entries to your MRTG config file to # begin graphing several Nagios statistics which can be useful for # debugging and trending purposes. The nagiostats binary (which is # included as part of the Nagios distribution) is used to generate # the data. ################################################################### # Service Latency and Execution Time Target[192.168.1.1_1]: `/usr/sbin/nagiostats --mrtg --data=AVGACTSVCLAT,AVGACTSVCEXT,PROGRUNTIME,NAGIOSVERPID` MaxBytes[192.168.1.1_1]: 12500000 Title[192.168.1.1_1]: Average Service Check Latency and Execution Time PageTop[192.168.1.1_1]: <H1>Average Service Check Latency and Execution Time</H1> #Options[192.168.1.1_1]: growright,gauge,nopercent #YLegend[192.168.1.1_1]: Milliseconds #ShortLegend[192.168.1.1_1]: #LegendI[192.168.1.1_1]: Latency: #LegendO[192.168.1.1_1]: Execution Time: #Legend1[192.168.1.1_1]: Latency #Legend2[192.168.1.1_1]: Execution Time #Legend3[192.168.1.1_1]: Maximal 5 Minute Latency #Legend4[192.168.1.1_1]: Maximal 5 Minute Execution Time y el fichero creado por el mrtg es: Target[192.168.1.1_1]: 1:comunidad@192.168.1.1: SetEnv[192.168.1.1_1]: MRTG_INT_IP="165.98.114.106" MRTG_INT_DESCR="FastEthernet0/0" MaxBytes[192.168.1.1_1]: 12500000 Title[192.168.1.1_1]: Traffic Analysis for 1 PageTop[192.168.1.1_1]: <h1>Traffic Analysis for 1</h1> <div id="sysdetails"> <table> <tr> <td>System:</td> <td>Router in </td> </tr> <tr> <td>Maintainer:</td> <td></td> </tr> <tr> <td>Description:</td> <td>FastEthernet0/0 OUTSIDE </td> </tr> <tr> <td>ifType:</td> <td>ethernetCsmacd (6)</td> </tr> <tr> <td>ifName:</td> <td>Fa0/0</td> </tr> <tr> <td>Max Speed:</td> <td>12.5 MBytes/s</td> </tr> <tr> <td>Ip:</td> <td>175.48.103.16 (host-16-103-48-175.dominio.com)</td> </tr> </table> </div> Di intento copiar el mtrg tanto de la plantilla como del mrtg me da error en el nagios.cfg. cfg_file=/etc/nagios/objects/mrtg.cfg Ninguna de las tres formas anteriores me funciona, alguna guia o pista de en que lugar estoy herrando? Espero haber sido claro con lo que intento hacer, intento monitorear el mrtg desde el nagios. He tratado tambien con la pagina guia de nagios http://nagios.sourceforge.net/docs/nagios-3.pdf y tampoco he lograda mucho. -- -=> Roberto José Blandino Cisneros -=> Nicaragua, Nicaragua Tel:2786328+74254 http://gnu-linux-opensource.blogspot.com/ http://softwarelibre.uni.edu.ni/ -- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
El 2009-03-12 a las 14:56 -0600, Roberto José Blandino Cisneros escribió:
Ya tengo Nagios, y tengo configurado el monitoreo a dos hosts, uno a windows y otro a linux, existen documentacion pero para switch y segun esta pagina http://nagios.linuxbaja.org/node/35 deberia de ser asi el fichero para que mande a buscar el log del mrtg
define service{ use generic-service ; Inherit values from a template host_name myhostname service_description Description check_command check_local_mrtgtraf!/srv/www/htdocs/mrtg/pub_html/192.168.1.1_1.log!AVG!1000000,2000000!5000000,5000000!10 } pero el nagios no se ejecuta y lo unico que muestra es que verifique el error pero este no indica nada solo lo siguiente sin darme ninguna pista. Solo se que algo estoy haciendo mal o que mrtg y nagios son incompatibles. Ambos paquetes los he instalado de los repositorios, asi que no se que anda mal.
Sólo comentar una cosa... En la página que mencionas pone que tienes que definir dos objetos: "define host" y "define service", y sólo has añadido el del servicio ¿eso es correcto? :-? Saludos, -- Camaleón -- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
Yo era el que estaba errando, gracias, tenia mala de todas formas la
definicion del servicio.
Gracias!
Queda para todo aquel que desee anexar mrtg a nagios.
Esta Excelente!
El día 13 de marzo de 2009 13:38, Camaleón
El 2009-03-12 a las 14:56 -0600, Roberto José Blandino Cisneros escribió:
Ya tengo Nagios, y tengo configurado el monitoreo a dos hosts, uno a windows y otro a linux, existen documentacion pero para switch y segun esta pagina http://nagios.linuxbaja.org/node/35 deberia de ser asi el fichero para que mande a buscar el log del mrtg
define service{ use generic-service ; Inherit values from a template host_name myhostname service_description Description check_command check_local_mrtgtraf!/srv/www/htdocs/mrtg/pub_html/192.168.1.1_1.log!AVG!1000000,2000000!5000000,5000000!10 } pero el nagios no se ejecuta y lo unico que muestra es que verifique el error pero este no indica nada solo lo siguiente sin darme ninguna pista. Solo se que algo estoy haciendo mal o que mrtg y nagios son incompatibles. Ambos paquetes los he instalado de los repositorios, asi que no se que anda mal.
Sólo comentar una cosa...
En la página que mencionas pone que tienes que definir dos objetos: "define host" y "define service", y sólo has añadido el del servicio ¿eso es correcto? :-?
Saludos,
-- Camaleón -- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
-- -=> Roberto José Blandino Cisneros -=> Nicaragua, Nicaragua Tel:2786328+74254 http://gnu-linux-opensource.blogspot.com/ http://softwarelibre.uni.edu.ni/ -- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
Ok solucionado!
tenia que crear mi mrtg.cfg de la siguiente manera.
# Define the switch that we'll be monitoring
define host{
use generic-switch ; Inherit default
values from a template
host_name r1 ; The name we're
giving to this switch
alias Router ; A longer name
associated with the switch
address 192.168.1.1 ; IP address of the switch
hostgroups routers ; Host groups this
switch is associated with
}
# Create a service to PING to switch
define service{
use generic-service ; Inherit values from a template
host_name r1 ; The name of the host
the service is associated with
service_description PING ; The service description
check_command check_ping!200.0,20%!600.0,60% ; The
command used to monitor the service
normal_check_interval 5 ; Check the service
every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service
every minute until its final/hard state is determined
}
# Create a new hostgroup for routers
define hostgroup{
hostgroup_name routers ; The name of the hostgroup
alias Network Routers ; Long name of the group
}
# Monitor bandwidth via MRTG logs
define service{
use generic-service ; Inherit values from a template
host_name r1
service_description Analisis de trafico para 1
check_command
check_local_mrtgtraf!/srv/www/htdocs/mrtg/pub_html/192.168.1.1_1.log!AVG!7000000,7000000!10000000,10000000!10
}
2009/3/12 Roberto José Blandino Cisneros
Distro: Opensuse 11.0
Ok ya tengo MRTG y Nagios configurados, estuve leyendo que Nagios tiene su propio plugin para trabajar con nagios, mas sin embargo aun no logro que desde nagios se me muestren las estadisticas que mrtg me ha estado arrojando.
El MRTG lo tengo creado de la siguiente manera.
# cd /srv/www/htdocs/mrtg/pub_html # cfgmaker --global 'WorkDir: /srv/virtual/mrtg' --show-op-down --output /srv/www/htdocs/mrtg/cfg/mrtg.cfg comunity@xxx.xxx.xxx.xxx # mrtg ../cfg/mrtg.cfg ; indexmaker --title=Outbound_Inbound_Traffic --subtitle=MRTG_Stats --pagetop=Esta\ pagina\ es\ un\ Beta\! --output=index.html ../cfg/mrtg.cfg
De esta forma puedo ver en mi servidor web la pagina mostrada por mrtg.
Ya tengo Nagios, y tengo configurado el monitoreo a dos hosts, uno a windows y otro a linux, existen documentacion pero para switch y segun esta pagina http://nagios.linuxbaja.org/node/35 deberia de ser asi el fichero para que mande a buscar el log del mrtg
define service{ use generic-service ; Inherit values from a template host_name myhostname service_description Description check_command check_local_mrtgtraf!/srv/www/htdocs/mrtg/pub_html/192.168.1.1_1.log!AVG!1000000,2000000!5000000,5000000!10 } pero el nagios no se ejecuta y lo unico que muestra es que verifique el error pero este no indica nada solo lo siguiente sin darme ninguna pista. Solo se que algo estoy haciendo mal o que mrtg y nagios son incompatibles. Ambos paquetes los he instalado de los repositorios, asi que no se que anda mal.
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid directives and data defintions. If you are upgrading from a previous version of Nagios, you should be aware that some variables/definitions may have been removed or modified in this version. Make sure to read the HTML documentation regarding the config files, as well as the 'Whats New' section to find out what has changed.
He leido la documentacion y estoy perdido ya que segun esa pagina solo hay que crear el fichero con esas opciones y en la ayuda de nagios me indica una plantilla que dice mas o menos asi para el mrtg.cfg:
################################################################### # MRTG Graphs: Nagios 3.0.6 Statistics # # You can add the following entries to your MRTG config file to # begin graphing several Nagios statistics which can be useful for # debugging and trending purposes. The nagiostats binary (which is # included as part of the Nagios distribution) is used to generate # the data. ###################################################################
# Service Latency and Execution Time Target[192.168.1.1_1]: `/usr/sbin/nagiostats --mrtg --data=AVGACTSVCLAT,AVGACTSVCEXT,PROGRUNTIME,NAGIOSVERPID` MaxBytes[192.168.1.1_1]: 12500000 Title[192.168.1.1_1]: Average Service Check Latency and Execution Time PageTop[192.168.1.1_1]: <H1>Average Service Check Latency and Execution Time</H1> #Options[192.168.1.1_1]: growright,gauge,nopercent #YLegend[192.168.1.1_1]: Milliseconds #ShortLegend[192.168.1.1_1]: #LegendI[192.168.1.1_1]: Latency: #LegendO[192.168.1.1_1]: Execution Time: #Legend1[192.168.1.1_1]: Latency #Legend2[192.168.1.1_1]: Execution Time #Legend3[192.168.1.1_1]: Maximal 5 Minute Latency #Legend4[192.168.1.1_1]: Maximal 5 Minute Execution Time
y el fichero creado por el mrtg es:
Target[192.168.1.1_1]: 1:comunidad@192.168.1.1: SetEnv[192.168.1.1_1]: MRTG_INT_IP="165.98.114.106" MRTG_INT_DESCR="FastEthernet0/0" MaxBytes[192.168.1.1_1]: 12500000 Title[192.168.1.1_1]: Traffic Analysis for 1 PageTop[192.168.1.1_1]: <h1>Traffic Analysis for 1</h1> <div id="sysdetails"> <table> <tr> <td>System:</td> <td>Router in </td> </tr> <tr> <td>Maintainer:</td> <td></td> </tr> <tr> <td>Description:</td> <td>FastEthernet0/0 OUTSIDE </td> </tr> <tr> <td>ifType:</td> <td>ethernetCsmacd (6)</td> </tr> <tr> <td>ifName:</td> <td>Fa0/0</td> </tr> <tr> <td>Max Speed:</td> <td>12.5 MBytes/s</td> </tr> <tr> <td>Ip:</td> <td>175.48.103.16 (host-16-103-48-175.dominio.com)</td> </tr> </table> </div>
Di intento copiar el mtrg tanto de la plantilla como del mrtg me da error en el nagios.cfg.
cfg_file=/etc/nagios/objects/mrtg.cfg
Ninguna de las tres formas anteriores me funciona, alguna guia o pista de en que lugar estoy herrando?
Espero haber sido claro con lo que intento hacer, intento monitorear el mrtg desde el nagios.
He tratado tambien con la pagina guia de nagios http://nagios.sourceforge.net/docs/nagios-3.pdf y tampoco he lograda mucho. -- -=> Roberto José Blandino Cisneros -=> Nicaragua, Nicaragua Tel:2786328+74254 http://gnu-linux-opensource.blogspot.com/ http://softwarelibre.uni.edu.ni/
-- -=> Roberto José Blandino Cisneros -=> Nicaragua, Nicaragua Tel:2786328+74254 http://gnu-linux-opensource.blogspot.com/ http://softwarelibre.uni.edu.ni/ -- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
participants (2)
-
Camaleón
-
Roberto José Blandino Cisneros