WowzaMediaServer monitoreado via JMX con Nagios Update 2
En el post anterior hablamos de como se podria monitorear una VM via JMX y dimos unos ejemplos aplicados al Servidore de Streaming WowzaMediaServer.
En esta oportunidad les dejo para que usen, un script que hice para usar en conjunto con NAGIOS, especificamente para Monitorear este excelente producto.
Su uso es muy simple, por defecto ya esta configurado para usar los puertos por Defautl que usa WowzaMediaServer, recuerden que necesitan tener habilitado el acceso via JMX a la Java Virtual Machine.
Este plugin tiene como Dependencias algunos modulos de PERL y el plugin CHECK_JMX nombrado en el articulo anterior.
La lista de Modulos de PERL son:
- Getopt::Long
- Getopt::Long::Descriptive
- Math::Round
- Scalar::Util
- Switch
Para instalar estos modulos en distribuciones RedHat/Centos/Fedora la linea a usar seria:
yum install -y perl-Math-Round perl-Getopt-Long perl-Getopt-Long-Descriptive perl-Scalar-List-Utils perl-Switch
Pero siempre recomiento instalarlos via CPAN para tener la ultima version, ademas que funciona con todas las Distribuciones.
cpan> install Getopt::Long::Descriptive Getopt::Long Math::Round Scalar::Util Switch
Hasta el momento tengo 3 chequeos cargados.
- HeapMemoryUsed (Show in % the Heap Memory Used)
- TotalCurrentServerConnections (Show the number of active connection in all vHosts)
- CurrentServerVersion (Compare the Server and Build Version currently in use)
Si te gustaria que agregue algun otro checkeo no dudes en escribirme y con gusto tratare de hacerlo.
Les dejo unos ejemplos del uso de los comandos:
Current Server Version
./check_jmx_wowzamediaserver.pl -host=10.111.222.1 -check=CurrentServerVersion -w=12081 -c=1.7.0
Tendra como resultado si es correcto
OK :: Server=1.7.0 Build=12081 | 1.7.0 12081
Sino dira algo asi
CRITICAL :: Server Version 1.7.0 not equal than 2.0.4 | 1.7.0 12081
Total Current Server Connections
./check_jmx_wowzamediaserver.pl -host=10.111.222.1 -check=TotalCurrentServerConnections -w=100 -c=1000
OK :: TotalCurrentServerConnections 54 | TotalCurrentServerConnections=54
Heap Memory Used
./check_jmx_wowzamediaserver.pl -host=10.111.222.1 -check=HeapMemoryUsed -w=10 -c=98
OK :: HeapMemoryUsage 7% | mem_used=53999824 mem_max=775487488
Podran notar que en la respuesta del Script aparece un PIPE ( | ) y luego mas informacion, esto se usa para enviar la informacion en Nagios referida a Performance Data, y en un nuevo POST hablaremos de como integrar esta informacion con la Herramienta CACTI o Centreon
Espero que lo usen y me escriban comentarios, y sugerencias sobre este el Script, para Descargarlo este es el Link (incluye las dependencias de check_jmx): check_jmx_wowzamediaserver (821) (Updated 12/10/2009)
Gracias por los aportes para el WMS, te dejo un tip, yo actualmente tengo la version por suscripción y por lo pronto para la verificación de version el string que devuelve es diferente:
JMX CRITICAL For input string: “Wowza Media Server Pro Software Subscription 1.7.2 build12107″
Ya que agrega obviamente la palabra Subscription.
Saludos
Juan,
Gracias por la info, voy a corregir el plugins y lo publicare en unos dias… comentame que mas te gustaria agregarle al Plugin, quiero seguir mejorando la funcionalidad, pero no se que mas agregar, espero tus comentarios.
Saludos,
Alejandro
@Juan Manuel Irigaray
Seria posible que me dejes consultar tu instalacion? ya que como no tengo ningun server con esa licencia no puedo corregir el plugin, solo necesitaria conectarme, yo te pasaria la IP que usaria para conectarme via JMX y corregir el plugins.
Espero tu respuesta
Ale
@Juan Manuel Irigaray
Creo que ya pude arreglar este problema, por favor descargate la ultima actualizacion, cambiaron varias cosas, y comentame si te funciona con esta version.
Saludos,
Alejandro
Hola Alejandro,
estoy siguiendo tus instrucciones para activar una monitorización de un Wowza server con Nagios. Todo va bien, por ahora, pero me surge una primera duda: para que funcione la llamada con el “check_jmx” he tenido que desactivar la autenticación vía puertos JMX. No veo como especificar nombre de usuario y password en la llamada.
¿Es esto así o hay alguna solución?
Gracias,
Ángel
@Angelneda
Se puede especificar hay que hacer unos cambios en el script, pero se puede…
Dame un par de dias asi cambio el script y lo integramos con la autenticacion.
Como te funciono lo demas ya lo tenes integrado?
Saludos,
Ale
@Alejandro
Estoy en ello. Ya he visto como especificar username y password en el 2check_jmx” (no lo he probado todavía). En la medida que vaya avanzando te informo…
is it possible (and where) to insert jmx password and username?
Thanks,,,
Hi, thanks for ask, Yes is possible check this link:
http://code.google.com/p/jmxquery/wiki/Usage
Only need add this parameters to the command line:
-username monitorRole -password passwordTell me if I can help you with something else.
Best Regards,
Ale
thanks Alejandro,
), with the python script I have some problems but I’m pretty sure it’s due to my distro installation (i.e. the split function inside check_jmx_wowzamediaserver.pl doesn’t return anything, just like there’s the wrong index element.. strange, isn’t it?).
yesterday I spent some times reading about jmx. Really interesting.
I’v added some lines of code to the JMXQuery.java class in order to be able to pass user/passwd, rebuild the project and bingo!
Just one note: this things works with the check_jmx plugin (see your previous post
Anyway thanks for your interesting posts!
Regards
p.s. I see, following the link you provided, under the download section, there are only the .class files. If you don’t have the time to edit the code I can mail you the few lines I’ve added (only for the nagios plugin).
Hi,
thanks for the scripts, they work pretty well, both in combination with Nagios 3 and Cacti.
however, occasionally the script produces the following output:
CRITICAL :: TotalCurrentServerConnections 4 = 1000
the commandline used is:
./check_jmx_wowzamediaserver.pl -host=localhost -check=TotalCurrentServerConnections -w=800 -c=1000
in fact, there are only 4 connections, so anything but critical. something is confusing the script and messing up the output.
$TotalCurrentServerConnections=`java -cp $pluginsDir/jmxquery.jar jmxquery.JMXQuery -U service:jmx:rmi://$host:$portjmx/jndi/rmi://$host:$portjndi/jmxrmi -O WowzaMediaServerPro:name=Connections -A current -username $jmxuser -password $jmxpasswd -v`;
@TotalCurrentServerConnections=split /\s+/, “$TotalCurrentServerConnections”;
$TotalCurrentServerConnections=$TotalCurrentServerConnections[5];
chomp($TotalCurrentServerConnections);
Any idea what it could be and how it could be solved?
@Gerbrand Oudenaarden
Hi, thanks for your feedback.
Yes I know where is the possible problem, give me a few days and I’ll fix that.
Thanks again
Kind Regards,
Alejandro