Open IT Experts for Enterprise

Zylk empresa de desarrollo de ecommerce

More about JMXTerm and Alfresco

Cesar Capillas
Cesar Capillas
One of the multiple possibilities for JMXTerm client is
scripting for defined tasks in your Alfresco Enterprise Server (as
pointed out in the previous
post). Let’s check it with some simple examples. Consider the next
shell script called (run-jmx.sh) 
#!/bin/bash
java -jar jmxterm-1.0-alpha-4-uber.jar -l service:jmx:rmi:///jndi/rmi://localhost:50500/alfresco/jmxrmi -p change_asap -u controlRole -i $1
 
And then the following text file (show-users.jmx)
 
domain Alfresco
bean Alfresco:Name=RepoServerMgmt
get UserCountAll
run listUserNamesAll
close
 
The result is something like:
 
$ ./run-jmx.sh show-users.jmx

Welcome to JMX terminal. Type "help" for available commands.
#domain is set to Alfresco
#bean is set to Alfresco:Name=RepoServerMgmt

#mbean = Alfresco:Name=RepoServerMgmt:
UserCountAll = 3;

#calling operation listUserNamesAll of mbean Alfresco:Name=RepoServerMgmt
#operation returns: 
[ admin, zylk, alfresco ]
#disconnected
 
You can prepare then other useful jmx scripts such as (ldap-resync.jmx)
 
domain Alfresco
bean log4j:logger=org.alfresco.repo.security.sync
set priority DEBUG
bean Alfresco:Category=Synchronization,Type=Configuration,id1=default
run stop
run start
bean log4j:logger=org.alfresco.repo.security.sync
set priority INFO
close
 
Finally you also may use it for monitoring purposes, for example,
for a nagios monitoring (in the same way that Alfresco
Nagios Icinga plugin does it with check_jmx.jar).
 
Some references of this are:
  • https://www.zylk.net/actualidad/jmx-command-line-recipes-for-alfresco-revisited/
  • https://wiki.jasig.org/display/UPM32/Monitoring+uPortal+MBeans,+Jmxterm+and+Cacti
  • https://www.janosgyerik.com/jmxterm-is-a-nice-command-line-jmx-client/

Si te ha parecido interesante comparte este post en RRS

Facebook
LinkedIn
Telegram
Email

Leer más sobre temas relacionados

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *