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_dataserver_service(host_name, port, service_groups)
common.services.tools.nagios_config.get_host_def(host_name, alias, address, 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.nagios_config.template_service = '\ndefine service{\n use target-%(http)s-service\n host_name %(host_name)s\n service_description %(service_description)s\n servicegroups target-service,%(servicegroups)s\n check_command check_%(http)s_arg!%(args)s\n}'

template_service_port = ‘’’ define service{

use target-%(http)s-service host_name %(host_name)s service_description %(service_description)s port %(port)d servicegroups target-service,%(servicegroups)s check_command check_%(http)s_arg!-p %(port)d -w 10 -c 30 -t 30

}’‘’

common.services.tools.ping_services module

common.services.tools.service_list module

List of Astro-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