WowzaMediaServer monitoreado via JMX con Nagios
Primero tenemos que descargar el plugin CHECK_JMX de la siguiente URL check_jmx
Para ver las opciones que tenemos disponible podemos ejecutarlo con el parametro “-help”
./check_jmx -help Usage: check_jmx -U url -O object_name -A attribute [-K compound_key] [-I attribute_info] [-J attribute_info_key] -w warn_limit -c crit_limit [-v[vvv]] [-help]
where options are:
-help Prints this page -U JMX URL, for example: service:jmx:rmi://192.168.0.1:8084/jndi/rmi://192.168.0.1:8085/jmxrmi -O Object name to be checked, for example: java.lang:type=Memory -A Attribute of the object to be checked, for example: NonHeapMemoryUsage -K Attribute key for -A attribute compound data, for example, "used" (optional) -I Attribute of the object containing information for text output (optional) -J Attribute key for -I attribute compound data, for example, "used" (optional) -v[vvv] verbatim level controlled as a number of v (optional) -w warning integer value -c critical integer value
Note that if warning level > critical, system checks object attribute value to be LESS THAN OR EQUAL warning, critical
If warning level < critical, system checks object attribute value to be MORE THAN OR EQUAL warning, critical
A continuacion les dejo algunos ejemplos genericos.
Esto nos daria el uso de Memory Heap de la VM
./check_jmx -U service:jmx:rmi://192.168.0.1:8084/jndi/rmi://192.168.0.1:8085/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 10000000 -c 100000000
Este es especifico para controlar la cantidad de usuarios conectados en todo el servidor:
./check_jmx -U service:jmx:rmi://192.168.0.1:8084/jndi/rmi://192.168.0.1:8085/jmxrmi -O WowzaMediaServerPro:name=Connections -A current -vvvv -w 10 -c 20
El resultado es algo como esto:
JMX OK current=5
Ahora veremos un caso muy puntual:
./check_jmx -U service:jmx:rmi://192.168.0.1:8084/jndi/rmi://192.168.0.1:8085/jmxrmi -O WowzaMediaServerPro:vHosts=VHosts,vHostName=_defaultVHost_,applications=Applications,applicationName=rtplive,applicationInstances=ApplicationInstances,applicationInstanceName=_definst_,name=Connections -A current -vvvv -c 1000 -w 750
Veamos los parametros por partes, asi podemos entender mejor que estamos midiendo:
I’m using this to simply return the currently running version of Wowza.
check_jmx -U service:jmx:rmi://localhost:8084/jndi/rmi://localhost:8085/jmxrmi -O WowzaMediaServerPro:name=Server -A version
Works great except it always returns the exit status as CRITICAL. Any way to fix this?
Hi, please send me the script to alejandro[@]linuxiso.com.ar and I’ll check what hapen…
Hi, I add your check to my script visite the next post for more information.
Best Regards