common.services.tools package

Submodules

common.services.tools.LogRedoUrl module

Script for parsing the dbview (or other) service log files and re-doing the requests the url to a local service

only GET requests are supported

The scripts assumes that a (dbview) web service is running on localhost:8080, run one with :

awe $AWEPIPE/common/services/general/myHttpServer.py -t -h localhost -p 8080
common.services.tools.LogRedoUrl.analyze(lines, verbose=0)

common.services.tools.nagios_check_data_server module

Script for parsing the data server status page.

This script can be used by nagios to query data servers.

class common.services.tools.nagios_check_data_server.DataServerStats(host, port, verbose=False)

Bases: object

getStats()

return statistics for the set data server

class common.services.tools.nagios_check_data_server.MyHTMLParser(debug=False)

Bases: html.parser.HTMLParser

handle_data(data)
handle_endtag(tag)
handle_starttag(tag, attrs)
common.services.tools.nagios_check_data_server.convert_bytes(byte_str)

convert bytes unit string to number

common.services.tools.nagios_check_data_server.get_content(url)

common.services.tools.nagios_config module

Generate nagios config files

common.services.tools.nagios_config.get_contact(domain)

Return the nagios contact given the domain. If domain is unknown use default_contact

common.services.tools.nagios_config.get_dataserver_service(host_name, port, service_groups)
common.services.tools.nagios_config.get_host_def(host_name, alias, address, service_groups, check=1)
common.services.tools.nagios_config.get_service_def(http, host_name, port, path, service_groups)
common.services.tools.nagios_config.get_ssl_cert_service(host_name, port, service_groups)
common.services.tools.nagios_config.main()

common.services.tools.ping_services module

Script for testing web services, the main page is requested and the time is measured. If the request takes longer then a defined maximum a mail is send.

common.services.tools.ping_services.mail(mail_to, msg, subject)

mail the messages

common.services.tools.ping_services.make_plot(coords, symbol, filename, max_y)

make plot of the coords

common.services.tools.ping_services.parse_stats(filename, to_print=False, to_plot=True)

parse the stats file

common.services.tools.ping_services.ping_services(to_print, to_write, to_stats)

ping the services and write retrieve times

common.services.tools.ping_services.plot_stats(filename, stats)

make plots of the stats

class common.services.tools.ping_services.service_ping(url)

Bases: threading.Thread

class to ‘ping’ a web service

run()

common.services.tools.service_list module

List of Astro/Lofar/Muse WISE services.

This list can be used by ping_services.py and nagios_config.py

Format is a dictionary :

services = {
(domain, type) : [service_url_1, service_url_2, …], …

}

common.services.tools.service_list.get_all_data_services()
common.services.tools.service_list.get_all_dpu_services()
common.services.tools.service_list.get_all_services(type_to_find)

return all data servers

common.services.tools.service_list.get_all_www_services()

Module contents