Changeset 2019


Ignore:
Timestamp:
07/10/12 12:11:48 (12 years ago)
Author:
Sander_Maijers
Message:
  • Add Nagios monitoring plugins for SAML and OAI-PMH (XML validation).
  • Increase robustness of the current simple XML data well-formedness/validity checks, for in case the XML data is non-well-formed.
  • Some small string and message improvements.
Location:
monitoring/plugins/mpi
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • monitoring/plugins/mpi/check_clarin_comp_reg.py

    r1998 r2019  
    1919    """
    2020    nagios_return('UNKNOWN',
    21                   "usage: {0} -h host".format(sys.argv[0]))
     21                  "usage: %s -h host" % (sys.argv[0]))
    2222
    2323def nagios_return(code, response):
  • monitoring/plugins/mpi/check_clarin_vlo.py

    r1998 r2019  
    66
    77nagios_codes = {
    8 'OK'        : 0,
    9 'WARNING'   : 1,
    10 'CRITICAL'  : 2,
    11 'UNKNOWN'   : 3,
    12 'DEPENDENT' : 4
    13 }
     8                'OK'        : 0,
     9                'WARNING'   : 1,
     10                'CRITICAL'  : 2,
     11                'UNKNOWN'   : 3,
     12                'DEPENDENT' : 4
     13                }
    1414
    1515def usage():
     
    1818        usage() calls nagios_return()
    1919    """
    20     nagios_return('UNKNOWN',"usage: {0} -h host".format(sys.argv[0]))
     20    nagios_return('UNKNOWN', "usage: %s -h host" % (sys.argv[0]))
    2121
    2222def nagios_return(code, response):
     
    4040    conn.close()
    4141   
    42     if r1.status == 200:
     42    if r1.status == 200 :
    4343        return { "code"      : "OK", "message"   : 'Host %s, service %s is up.' % (host, DESCRIPTION) }
    4444    else:
     
    5151    """
    5252
    53     if len(sys.argv) < 2:
     53    if len(sys.argv) < 2 :
    5454        usage()
    5555
  • monitoring/plugins/mpi/check_lat_annex.py

    r1737 r2019  
    44
    55nagios_codes = {'OK': 0,
    6 'WARNING': 1,
    7 'CRITICAL': 2,
    8 'UNKNOWN': 3,
    9 'DEPENDENT': 4}
     6                'WARNING': 1,
     7                'CRITICAL': 2,
     8                'UNKNOWN': 3,
     9                'DEPENDENT': 4
     10                }
    1011
    1112def usage():
     
    1516    """
    1617    nagios_return('UNKNOWN',
    17             "usage: {0} -h host".format(sys.argv[0]))
     18            "usage: %s -h host" % (sys.argv[0]))
    1819
    1920def nagios_return(code, response):
  • monitoring/plugins/mpi/check_lat_cql_endpoint.py

    r1998 r2019  
    2323    """
    2424    nagios_return('UNKNOWN',
    25                   "usage: {0} -h host".format(sys.argv[0]))
     25                  "usage: %s -h host" % (sys.argv[0]))
    2626
    2727def nagios_return(code, response) :
     
    3535
    3636def check_response_data_validity(data) :
    37     data_tree_root_element  = xml.etree.ElementTree.XML(text = data)
    38        
    39     valid_root_element_tag  = "{%s}explainResponse" % (CQL_NAMESPACE)
    40        
    41     if data_tree_root_element.tag == valid_root_element_tag :
    42         return True
     37    try :
     38        data_tree_root_element  = xml.etree.ElementTree.XML(text = data)
     39           
     40        valid_root_element_tag  = "{%s}explainResponse" % (CQL_NAMESPACE)
     41           
     42        if data_tree_root_element.tag == valid_root_element_tag :
     43            return True
    4344
    44     return False
     45        return False
     46    except :
     47        return False
    4548
    4649def check_condition(host) :
     
    6467            return {
    6568                    "code"      : "OK",
    66                     "message"   : 'Host %s, service %s is up and returns valid data.' % (host, DESCRIPTION)
     69                    "message"   : 'Host %s, service %s is up and returns well-formed and probably valid data.' % (host, DESCRIPTION)
    6770                   }
    6871        else :
    6972            return {
    7073                    "code"      : "CRITICAL",
    71                     "message"   : 'Host %s, service %s is up but returns invalid data!' % (host, DESCRIPTION)
     74                    "message"   : 'Host %s, service %s is up but returns non-well-formed or invalid data.' % (host, DESCRIPTION)
    7275                   }
    7376
  • monitoring/plugins/mpi/check_lat_handle.py

    r1737 r2019  
    44
    55nagios_codes = {'OK': 0,
    6 'WARNING': 1,
    7 'CRITICAL': 2,
    8 'UNKNOWN': 3,
    9 'DEPENDENT': 4}
     6                'WARNING': 1,
     7                'CRITICAL': 2,
     8                'UNKNOWN': 3,
     9                'DEPENDENT': 4
     10                }
    1011
    1112def usage():
     
    1516    """
    1617    nagios_return('UNKNOWN',
    17             "usage: {0} -h host".format(sys.argv[0]))
     18            "usage: %s -h host" % (sys.argv[0]))
    1819
    1920def nagios_return(code, response):
  • monitoring/plugins/mpi/check_lat_imdi.py

    r1737 r2019  
    44
    55nagios_codes = {'OK': 0,
    6 'WARNING': 1,
    7 'CRITICAL': 2,
    8 'UNKNOWN': 3,
    9 'DEPENDENT': 4}
     6                'WARNING': 1,
     7                'CRITICAL': 2,
     8                'UNKNOWN': 3,
     9                'DEPENDENT': 4
     10                }
    1011
    1112def usage():
     
    1516    """
    1617    nagios_return('UNKNOWN',
    17             "usage: {0} -h host".format(sys.argv[0]))
     18            "usage: %s -h host" % (sys.argv[0]))
    1819
    1920def nagios_return(code, response):
  • monitoring/plugins/mpi/check_lat_lamus.py

    r1737 r2019  
    33import sys, getopt, httplib
    44
    5 nagios_codes = {'OK': 0,
    6 'WARNING': 1,
    7 'CRITICAL': 2,
    8 'UNKNOWN': 3,
    9 'DEPENDENT': 4}
     5nagios_codes = {
     6                'OK': 0,
     7                'WARNING': 1,
     8                'CRITICAL': 2,
     9                'UNKNOWN': 3,
     10                'DEPENDENT': 4
     11                }
    1012
    1113def usage():
     
    1517    """
    1618    nagios_return('UNKNOWN',
    17             "usage: {0} -h host".format(sys.argv[0]))
     19            "usage: %s -h host" % (sys.argv[0]))
    1820
    1921def nagios_return(code, response):
     
    2729
    2830def check_condition(host):
    29     conn = httplib.HTTPConnection(host)
    30     conn.request("GET","/jkc/lamus/lamusstart.jsp")
    31     r1 = conn.getresponse()
     31    conn    = httplib.HTTPConnection(host)
     32    conn.request("GET", "/jkc/lamus/lamusstart.jsp")
     33    r1      = conn.getresponse()
    3234    conn.close()
    3335    if r1.status == 200:
  • monitoring/plugins/mpi/check_lat_lexus.py

    r1737 r2019  
    44
    55nagios_codes = {'OK': 0,
    6 'WARNING': 1,
    7 'CRITICAL': 2,
    8 'UNKNOWN': 3,
    9 'DEPENDENT': 4}
     6                'WARNING': 1,
     7                'CRITICAL': 2,
     8                'UNKNOWN': 3,
     9                'DEPENDENT': 4
     10                }
    1011
    1112def usage():
     
    1516    """
    1617    nagios_return('UNKNOWN',
    17             "usage: {0} -h host".format(sys.argv[0]))
     18            "usage: %s -h host" % (sys.argv[0]))
    1819
    1920def nagios_return(code, response):
  • monitoring/plugins/mpi/plugins_hosts_services.tab

    r1997 r2019  
    88check_lat_handle.py     Handle  corpus1.mpi.nl
    99check_lat_annex.py      Annex   corpus1.mpi.nl
     10check_lat_oai_endpoint.py       OAI-PMH corpus1.mpi.nl
     11check_clarin_saml.py    SAML    www.clarin.eu
Note: See TracChangeset for help on using the changeset viewer.