Index: /monitoring/plugins/mpi/README
===================================================================
--- /monitoring/plugins/mpi/README	(revision 1993)
+++ /monitoring/plugins/mpi/README	(revision 1994)
@@ -1,3 +1,4 @@
-These nagios plugins are intended to be used with the following host parameter:
+These Nagions plugins to monitor a services running on hosts with a certain hostname can be run from the command line with:
+./pluginname.py -h hostname
 
-corpus1.mpi.nl
+The file plugins_hosts_services.tab is a small TAB-separated table that contains the applicable plugin name, the service it checks, and the hostname that it is supposed to run on witin the current CLARIN infrastructure.
Index: /monitoring/plugins/mpi/check_lat_comp_reg.py
===================================================================
--- /monitoring/plugins/mpi/check_lat_comp_reg.py	(revision 1994)
+++ /monitoring/plugins/mpi/check_lat_comp_reg.py	(revision 1994)
@@ -0,0 +1,81 @@
+#!/usr/bin/python
+
+import sys, getopt, httplib
+
+DESCRIPTION  = "Component Registry" 
+
+nagios_codes = {
+                'OK'        : 0,
+                'WARNING'   : 1,
+                'CRITICAL'  : 2,
+                'UNKNOWN'   : 3,
+                'DEPENDENT' : 4
+                }
+
+def usage():
+    """ returns nagios status UNKNOWN with
+        a one line usage description
+        usage() calls nagios_return()
+    """
+    nagios_return('UNKNOWN',
+                  "usage: {0} -h host".format(sys.argv[0]))
+
+def nagios_return(code, response):
+    """ prints the response message
+        and exits the script with one
+        of the defined exit codes
+        DOES NOT RETURN
+    """
+    print code + ": " + response
+    sys.exit(nagios_codes[code])
+
+# default host: catalog.clarin.eu
+def check_condition(host):
+    UP_URL  = '/ds/ComponentRegistry/'
+
+    conn    = httplib.HTTPConnection(host)
+    
+    conn.request("GET", UP_URL)
+    
+    r1      = conn.getresponse()
+    
+    conn.close()
+    
+    if r1.status == 200:
+        return {
+                "code"      : "OK", 
+                "message"   : 'Host "{0}", service "{1}" is up.'.format(host, DESCRIPTION)
+                }
+    else:
+        return {
+                "code"      : "CRITICAL", 
+                "message"   : 'Host "{0}", service "{1}" has a problem.'.format(host, DESCRIPTION)
+                }
+
+
+def main():
+    """ example options processing
+        here we're expecting 1 option "-h"
+        with a parameter
+    """
+
+    if len(sys.argv) < 2:
+        usage()
+
+    try:
+        opts, args  = getopt.getopt(sys.argv[1:], "h:")
+    except getopt.GetoptError, err:
+        usage()
+
+    for o, value in opts:
+        if o == "-h":
+            host    = value
+        else:
+            usage()
+    
+    result          = check_condition(host)
+    nagios_return(result['code'], result['message'])
+
+if __name__ == "__main__":
+    main()
+
Index: /monitoring/plugins/mpi/check_lat_cql_endpoint.py
===================================================================
--- /monitoring/plugins/mpi/check_lat_cql_endpoint.py	(revision 1994)
+++ /monitoring/plugins/mpi/check_lat_cql_endpoint.py	(revision 1994)
@@ -0,0 +1,106 @@
+#!/usr/bin/python
+
+import sys, getopt, httplib, xml.etree.ElementTree
+
+
+DESCRIPTION     = "CQL endpoint"
+CQL_NAMESPACE   = "http://www.loc.gov/zing/srw/"
+
+# Warning: check of validity of returned data relies on the XML namespace NAMESPACE of the returned XML markup.
+
+nagios_codes    = {
+                    'OK'        : 0,
+                    'WARNING'   : 1,
+                    'CRITICAL'  : 2,
+                    'UNKNOWN'   : 3,
+                    'DEPENDENT' : 4
+                    }
+
+def usage() :
+    """ returns nagios status UNKNOWN with
+        a one line usage description
+        usage() calls nagios_return()
+    """
+    nagios_return('UNKNOWN',
+                  "usage: {0} -h host".format(sys.argv[0]))
+
+def nagios_return(code, response) :
+    """ prints the response message
+        and exits the script with one
+        of the defined exit codes
+        DOES NOT RETURN
+    """
+    print code + ": " + response
+    sys.exit(nagios_codes[code])
+
+def check_response_data_validity(data) :
+    data_tree_root_element  = xml.etree.ElementTree.XML(text = data)
+
+    valid_root_element_tag  = "{{{0}}}explainResponse".format(CQL_NAMESPACE)
+
+    if data_tree_root_element.tag == valid_root_element_tag :
+        return True
+
+    return False
+
+def check_condition(host) :
+    UP_URL  = '/'
+
+    conn    = httplib.HTTPConnection(host)
+    
+    # try catch
+    conn.request("GET", UP_URL)
+    
+    r1      = conn.getresponse()
+
+    data    = r1.read()
+    
+    conn.close()
+    
+    if r1.status == 200 :
+        valid   = check_response_data_validity(data)
+
+        if valid :
+            return {
+                    "code"      : "OK", 
+                    "message"   : 'Host "{0}", service "{1}" is up and returns valid data.'.format(host, DESCRIPTION)
+                   }
+        else :
+            return {
+                    "code"      : "CRITICAL", 
+                    "message"   : 'Host "{0}", service "{1}" is up but returns invalid data!'.format(host, DESCRIPTION)
+                   }
+
+    else:
+        return {
+                "code"      : "CRITICAL", 
+                "message"   : 'Host "{0}", service "{1}" has a problem.'.format(host, DESCRIPTION)
+               }
+
+
+def main() :
+    """ example options processing
+        here we're expecting 1 option "-h"
+        with a parameter
+    """
+
+    if len(sys.argv) < 2 :
+        usage()
+
+    try:
+        opts, args  = getopt.getopt(sys.argv[1:], "h:")
+    except getopt.GetoptError, err:
+        usage()
+
+    for o, value in opts:
+        if o == "-h" :
+            host    = value
+        else:
+            usage()
+    
+    result          = check_condition(host)
+    nagios_return(result['code'], result['message'])
+
+if __name__ == "__main__" :
+    main()
+
Index: /monitoring/plugins/mpi/check_lat_vlo.py
===================================================================
--- /monitoring/plugins/mpi/check_lat_vlo.py	(revision 1994)
+++ /monitoring/plugins/mpi/check_lat_vlo.py	(revision 1994)
@@ -0,0 +1,80 @@
+#!/usr/bin/python
+
+import sys, getopt, httplib
+
+DESCRIPTION  = "Virtual Language Observatory" 
+
+nagios_codes = {
+                'OK'        : 0,
+                'WARNING'   : 1,
+                'CRITICAL'  : 2,
+                'UNKNOWN'   : 3,
+                'DEPENDENT' : 4
+                }
+
+def usage():
+    """ returns nagios status UNKNOWN with
+        a one line usage description
+        usage() calls nagios_return()
+    """
+    nagios_return('UNKNOWN',
+                  "usage: {0} -h host".format(sys.argv[0]))
+
+def nagios_return(code, response):
+    """ prints the response message
+        and exits the script with one
+        of the defined exit codes
+        DOES NOT RETURN
+    """
+    print code + ": " + response
+    sys.exit(nagios_codes[code])
+
+def check_condition(host):
+    UP_URL  = '/ds/vlo/'
+
+    conn    = httplib.HTTPConnection(host)
+    
+    conn.request("GET", UP_URL)
+    
+    r1      = conn.getresponse()
+    
+    conn.close()
+    
+    if r1.status == 200:
+        return {
+                "code"      : "OK", 
+                "message"   : 'Host "{0}", service "{1}" is up.'.format(host, DESCRIPTION)
+                }
+    else:
+        return {
+                "code"      : "CRITICAL", 
+                "message"   : 'Host "{0}", service "{1}" has a problem!'.format(host, DESCRIPTION)
+                }
+
+
+def main():
+    """ example options processing
+        here we're expecting 1 option "-h"
+        with a parameter
+    """
+
+    if len(sys.argv) < 2:
+        usage()
+
+    try:
+        opts, args  = getopt.getopt(sys.argv[1:], "h:")
+    except getopt.GetoptError, err:
+        usage()
+
+    for o, value in opts:
+        if o == "-h":
+            host    = value
+        else:
+            usage()
+    
+    result          = check_condition(host)
+    nagios_return(result['code'], result['message'])
+
+if __name__ == "__main__":
+    main()
+
Index: /monitoring/plugins/mpi/plugins_hosts_services.tab
===================================================================
--- /monitoring/plugins/mpi/plugins_hosts_services.tab	(revision 1994)
+++ /monitoring/plugins/mpi/plugins_hosts_services.tab	(revision 1994)
@@ -0,0 +1,9 @@
+Nagios plugin	service	host
+check_lat_cql_endpoint.py	CQL endpoint	cqlservlet.mpi.nl
+check_lat_vlo.py	Virtual Language Observatory	catalog.clarin.eu
+check_lat_comp_reg.py	Component Registry	catalog.clarin.eu
+check_lat_lexus.py	Lexus	corpus1.mpi.nl
+check_lat_lamus.py	Lamus	corpus1.mpi.nl
+check_lat_imdi.py	IMDI	corpus1.mpi.nl
+check_lat_handle.py	Handle	corpus1.mpi.nl
+check_lat_annex.py	Annex	corpus1.mpi.nl
