Skip to content

Instantly share code, notes, and snippets.

@jangaraj
Created December 15, 2015 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jangaraj/c8bdb48f0d139002316f to your computer and use it in GitHub Desktop.
Save jangaraj/c8bdb48f0d139002316f to your computer and use it in GitHub Desktop.
# values from management plugin
UserParameter=rabbitmq.statusmgmt[*],curl --connect-timeout 1 --max-time 1 -s -u `grep ^amqpuser /opt/zenoss/etc/global.conf | awk '{print $$2}'`:`grep ^amqppassword /opt/zenoss/etc/global.conf | awk '{print $$2}'` http://127.0.0.1:55672/api/$1 | python -c 'exec("try:\n import sys, simplejson; print simplejson.load(sys.stdin)[\"$2\"][\"$3\"][\"$4\"];\nexcept Exception, err:\n print 0;")'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment