mendix / m2ee-tools

m2ee, the Mendix runtime helper tools for GNU/Linux
Other
27 stars 40 forks source link

Handle M2EERuntimeNotFullyRunning in munin code #48

Open knorrie opened 4 years ago

knorrie commented 4 years ago

This is not very useful:

-# munin-run mxruntime_tr10000
Traceback (most recent call last):
  File "/etc/munin/plugins/mxruntime_tr10000", line 69, in <module>
    m2ee.munin.print_values(m2ee_instance, name)
  File "/usr/lib/python2.7/dist-packages/m2ee/munin.py", line 98, in print_values
    stats, java_version = get_stats('values', m2)
  File "/usr/lib/python2.7/dist-packages/m2ee/munin.py", line 141, in get_stats
    stats, java_version = get_stats_from_runtime(m2)
  File "/usr/lib/python2.7/dist-packages/m2ee/munin.py", line 165, in get_stats_from_runtime
    stats.update(m2.client.runtime_statistics(timeout=5))
  File "/usr/lib/python2.7/dist-packages/m2ee/client.py", line 120, in runtime_statistics
    return self.request("runtime_statistics", timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/m2ee/client.py", line 50, in request
    raise M2EERuntimeNotFullyRunning(status, action)
m2ee.client.M2EERuntimeNotFullyRunning: The Mendix Runtime is not fully running, but reporting status 'created'. Unable to execute action runtime_statistics.

Just act like the app isn't running at all, don't explode.