Changeset 3270


Ignore:
Timestamp:
08/06/13 14:16:15 (11 years ago)
Author:
sanmai
Message:
  • Adapt monitoring plugins to new command line argument processing.
  • Fix MPI monitoring checks table so that every check is on a separate line.
Location:
monitoring/plugins/mpi
Files:
10 edited

Legend:

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

    r3242 r3270  
    77special_plugin_description = "Discojuice HTML"
    88special_plugin_file_name = os.path.basename(__file__)
     9command_line_parameters = [("-h", "host",),
     10                           ("-u", "URL",)]
    911
    10 def special_main_subroutine(host) :
    1112
    12     UP_URLs = ('/mw1/sds/discojuice',
    13                '/mw2/sds/discojuice',) # X- use frozenset
     13def special_main_subroutine(host, URL) :
     14
     15    UP_URLs = (URL,)
    1416   
    1517    # Check status for all UP_URLs.
     
    2628
    2729if __name__ == "__main__" :
    28     generic_tla_monitoring.main(special_main_subroutine)
     30    generic_tla_monitoring.main(special_main_subroutine,
     31                                command_line_parameters)
  • monitoring/plugins/mpi/check_clarin_discojuice_json.py

    r3242 r3270  
    44import os, pdb
    55
     6
    67special_plugin_description = "Discojuice JSON"
    78special_plugin_file_name = os.path.basename(__file__)
     9command_line_parameters = [("-h", "host",),
     10                           ("-u", "URL",)]
    811
    912
    10 def special_main_subroutine(host) :
    11     UP_URLs = ("/discojuice/metadata_clarin1.json",
    12                "/discojuice/metadata_clarin2.json",)
     13def special_main_subroutine(host, URL) :
     14
     15    UP_URLs = (URL,)
    1316   
    1417    # Check status for all UP_URLs.
     
    2528
    2629if __name__ == "__main__" :
    27     generic_tla_monitoring.main(special_main_subroutine)
     30    generic_tla_monitoring.main(special_main_subroutine,
     31                                command_line_parameters)
  • monitoring/plugins/mpi/check_lat_annex.py

    r3043 r3270  
    77special_plugin_description = "Annex"
    88special_plugin_file_name = os.path.basename(__file__)
     9command_line_parameters = [("-h", "host",),
     10                           ("-u", "URL",)]
    911
    10 def special_main_subroutine(host) :
    1112
    12     UP_URLs = ("/ds/annex/runLoader?nodeid=MPI600401%23",) # X- use frozenset
     13def special_main_subroutine(host, URL) :
     14
     15    UP_URLs = (URL,) # X- use frozenset
    1316   
    1417    # Check status for all UP_URLs.
     
    2326
    2427if __name__ == "__main__" :
    25     generic_tla_monitoring.main(special_main_subroutine)
     28    generic_tla_monitoring.main(special_main_subroutine,
     29                                command_line_parameters)
  • monitoring/plugins/mpi/check_lat_avatech_clam.py

    r3243 r3270  
    77special_plugin_description = "AVATecH CLAM"
    88special_plugin_file_name = os.path.basename(__file__)
     9command_line_parameters = [("-h", "host",),
     10                           ("-u", "URL",)]
    911
    10 def special_main_subroutine(host) :
     12def special_main_subroutine(host, URL) :
    1113
    12     UP_URLs = ('/avatech/avatech_iais_fine_segmentation',) # X- use frozenset
     14    UP_URLs = (URL,) # X- use frozenset
    1315   
    1416    # Check status for all UP_URLs.
     
    2527
    2628if __name__ == "__main__" :
    27     generic_tla_monitoring.main(special_main_subroutine)
     29    generic_tla_monitoring.main(special_main_subroutine,
     30                                command_line_parameters)
  • monitoring/plugins/mpi/check_lat_cql_endpoint.py

    r3263 r3270  
    88special_plugin_file_name = os.path.basename(__file__)
    99CQL_NAMESPACE = "http://www.loc.gov/zing/srw/"
    10 
    1110command_line_parameters = [("-h", "host",),
    1211                           ("-u", "URL",)]
  • monitoring/plugins/mpi/check_lat_handle.py

    r3043 r3270  
    77special_plugin_description = "Handle"
    88special_plugin_file_name = os.path.basename(__file__)
     9command_line_parameters = [("-h", "host",),
     10                           ("-u", "URL",)]
    911
    1012# Warning: old checking condition "if 300 <= r1.status and r1.status < 400:" X-
    1113
    12 def special_main_subroutine(host) :
     14def special_main_subroutine(host, URL) :
    1315    #result = test_case(host);
    1416    #result = check_condition(host)
    1517    #generic_tla_monitoring.nagios_return(result['code'], result['message'])
    1618
    17     UP_URLs = ('/?hdl=1839%2F00-0000-0000-0000-0000-4&auth=x',) # X- use frozenset
     19    UP_URLs = (URL,) # X- use frozenset
    1820    # /1839/00-0000-0000-0000-0000-4
    1921    # POST hdl=1839%2F00-0000-0000-0000-0009-4&auth=x&noredirect=
     
    3133
    3234if __name__ == "__main__" :
    33     generic_tla_monitoring.main(special_main_subroutine)
     35    generic_tla_monitoring.main(special_main_subroutine,
     36                                command_line_parameters)
    3437
  • monitoring/plugins/mpi/check_lat_imdi.py

    r3043 r3270  
    77special_plugin_description = "IMDI browser"
    88special_plugin_file_name = os.path.basename(__file__)
     9command_line_parameters = [("-h", "host",),
     10                           ("-u", "URL",)]
    911
    10 def special_main_subroutine(host) :
     12def special_main_subroutine(host, URL) :
    1113
    12     UP_URLs = ('/ds/imdi_browser/viewcontroller?request=view&nodeid=MPI299144%23',)
     14    UP_URLs = (URL,)
    1315    #UP_URLs_encoded  = urllib.parse.quote_plus()
    1416
     
    3032
    3133if __name__ == "__main__" :
    32     generic_tla_monitoring.main(special_main_subroutine)
     34    generic_tla_monitoring.main(special_main_subroutine,
     35                                command_line_parameters)
  • monitoring/plugins/mpi/check_lat_lamus.py

    r3043 r3270  
    55
    66
    7 special_plugin_description      = "Lamus"
    8 special_plugin_file_name        = os.path.basename(__file__)
     7special_plugin_description = "Lamus"
     8special_plugin_file_name = os.path.basename(__file__)
     9command_line_parameters = [("-h", "host",),
     10                           ("-u", "URL",)]
    911
    10 def special_main_subroutine(host) :
    1112
    12     UP_URLs          = ('/jkc/lamus/lamusstart.jsp',) # X- use frozenset
     13def special_main_subroutine(host, URL) :
     14
     15    UP_URLs = (URL,) # X- use frozenset
    1316   
    1417    # Check status for all UP_URLs.
    15     results          = map(lambda UP_URL : generic_tla_monitoring.check_condition(host          = host,
    16                                                                                   UP_URL        = UP_URL,
    17                                                                                   HTTP_method   = 'GET',
    18                                                                                   validator     = generic_tla_monitoring.check_HTML_wellformedness,
    19                                                                                   special_plugin_file_name = special_plugin_file_name),
    20                            UP_URLs)
     18    results = map(lambda UP_URL : generic_tla_monitoring.check_condition(host          = host,
     19                                                                         UP_URL        = UP_URL,
     20                                                                         HTTP_method   = 'GET',
     21                                                                         validator     = generic_tla_monitoring.check_HTML_wellformedness,
     22                                                                         special_plugin_file_name = special_plugin_file_name),
     23                  UP_URLs)
    2124   
    22     generic_tla_monitoring.nagios_return_complex(results, reporter = special_plugin_description)
     25    generic_tla_monitoring.nagios_return_complex(results,
     26                                                 reporter = special_plugin_description)
    2327
    2428if __name__ == "__main__" :
    25     generic_tla_monitoring.main(special_main_subroutine)
     29    generic_tla_monitoring.main(special_main_subroutine,
     30                                command_line_parameters)
    2631   
  • monitoring/plugins/mpi/integration_test.R

    r3043 r3270  
    77                      header    = TRUE);
    88
    9 arg_sets <-
     9command_line_arguments <-
    1010    base:::paste(test_info$Nagios.plugin, "-h", test_info$host);
     11command_line_arguments <- c(command_line_arguments,
     12                            test_info[,5L:ncol(test_info)]);
    1113
    12 ## test_results has a value equal to the exit status of the scripts with arguments arg_sets run.
     14## test_results has a value equal to the exit status of the scripts with arguments command_line_arguments run.
    1315
    1416test_results <-
    15     base:::integer(length = base:::length(arg_sets));
     17    base:::integer(length = base:::length(command_line_arguments));
    1618test_stdout <-
    17     base:::character(length = base:::length(arg_sets));
     19    base:::character(length = base:::length(command_line_arguments));
    1820#test_stderr
    19 #   <- character(length = length(arg_sets));
     21#   <- character(length = length(command_line_arguments));
    2022## X- stderr output cannot be caught separately yet due to R implementation issue
    2123
    22 for (test_index in 1L:base:::length(arg_sets))
     24for (test_index in 1L:base:::length(command_line_arguments))
    2325{
    2426    base:::message(base:::paste0("Running test ", test_index));
    2527
    2628    arg_set <-
    27         arg_sets[test_index];
     29        command_line_arguments[test_index];
    2830
    2931    test_output <-
     
    4345
    4446    test_stdout[test_index] <-
    45         base:::paste0(test_output, sep = "\n", collapse = "\n");
     47        base:::paste0(test_output,
     48                      sep = "\n",
     49                      collapse = "\n");
    4650
    4751    # browser();
     
    4953
    5054test_results_df <-
    51     base:::data.frame(description       = test_info$service,
    52                       arg_sets          = arg_sets,
    53                       test_results      = test_results,
    54                       test_stdout       = test_stdout,
    55                       stringsAsFactors  = FALSE);
     55    base:::data.frame(description             = test_info$service,
     56                      command_line_arguments  = command_line_arguments,
     57                      test_results            = test_results,
     58                      test_stdout             = test_stdout,
     59                      stringsAsFactors        = FALSE);
    5660
    5761test_results_file_path <-
  • monitoring/plugins/mpi/plugins_hosts_services.tab

    r3263 r3270  
    1111check_lat_oai_endpoint.py       OAI-PMH corpus1.mpi.nl  http    '/ds/oaiprovider/oai2?verb=Identify'
    1212check_clarin_saml.py    SAML    www.clarin.eu   https   
    13 check_clarin_discojuice_json.py Discojuice JSON catalog.clarin.eu       http    '/mw1/sds/discojuice'; '/mw2/sds/discojuice'
    14 check_clarin_discojuice_html.py Discojuice HTML catalog.clarin.eu       http    '/discojuice/metadata_clarin1.json'; '/discojuice/metadata_clarin2.json'
     13check_clarin_discojuice_json.py Discojuice JSON catalog.clarin.eu       http    '/mw1/sds/discojuice'
     14check_clarin_discojuice_json.py Discojuice JSON catalog.clarin.eu       http    '/mw2/sds/discojuice'
     15check_clarin_discojuice_html.py Discojuice HTML catalog.clarin.eu       http    '/discojuice/metadata_clarin1.json'
     16check_clarin_discojuice_html.py Discojuice HTML catalog.clarin.eu       http    '/discojuice/metadata_clarin2.json'
    1517check_lat_avatech_clam.py       AVATecH CLAM    lux17.mpi.nl    http    '/avatech/avatech_iais_fine_segmentation'
    1618check_clarin_ldap.py    LDAP directory  user.clarin.eu  ldap   
Note: See TracChangeset for help on using the changeset viewer.