Creating the python client is easy. Unfortunately, none of the packages are built by default in the online release (yet). They have been requested for release, but it will take a while before they end up on the online system.

Please note: The client must be run in the online system, inside the ACL's. The client port on the monitor server is not available to machines outside the online system. At the bottom is a demo client written for the muon system.

Build the sharable libraries required for python

See this web page.

Setup for python running

See this web page

Write the Python Code

Below describes how to write a very simple test program that will generate a monitor item. You can use this pattern to integrate monitor information into a more complex monitor program.

import l3xmonitor_util_module
import time
j = l3xmonitor_util_module.monitor_client("tester")
count=0
while 1:
  j.set_item("count", count)
  print count
  count += 1
  time.sleep(1)

Short explanation of the relevant lines of code:

That is all there is to developing python based code. Once you have this running, you may want to test it by running a simple python display which requests this data from the MS.

Muon Demo Client

To test this out I originally wrote this python file to test this out. I modified a file in the muon_readout cvs package -- in the client subdirectory. I can't remember the original filename, I'm afraid. If you build the python module as listed above, put the resulting .so in your PYTHONPATH (as described above as well), setup onl_apps (required by the muon readout code), and then download this file into the client subdirectory of the muon_readout package and type python m_mon.py it will start to furnish monitor info to the monitor system. You can see the monitor info with this handy web page if you want (it will be pretty boring if m_mon.py is not running).