This solution assumes that you have Nagios installed along with the 'check_jmx' plugin. To monitor Artifactory remotely, you must first enable remote JMX monitoring. Add the following to your artifactory.default file:
export JAVA_OPTIONS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
Remember the port you use, it will be important later. Next, open up jconsole, and connect to Artifactory. Find the value that you'd like to grab, and note the ObjectName, and Attribute you'd like. Then, run the following command:
You will want to use the following command:
./check_jmx -U service:jmx:rmi:///jndi/rmi://$IP:$PORT/jmxrmi -O $ObjectName -A $Attribute
For example, if you want the 'Size' of the 'Binary Storage' you will see the following:
Your command will be:
check_jmx -U service:jmx:rmi:///jndi/rmi://127.0.0.1:9010/jmxrmi -O “org.jfrog.artifactory:instance=Artifactory, type=Storage,property=Bintray Storage” -A Size