Skip to main content

argo-mon-library

ARGO Monitoring Service library: A simple python library for interacting with the ARGO Monitoring Service REST API

The ARGO Monitoring service is designed to monitor the status, availability, and reliability of services provided by electronic infrastructures with moderate to high complexity. Its web API provides the Serving Layer, used for retrieving the Status, Availability, and Reliability reports as well as the actual raw metric results. This library intends to provide access to basic functionality of the API, in a simple and intuitive way.

You may find more information pertaining to the service and its web API on the ARGO Monitoring Service and ARGO web API documentation pages.

Library installation

The library been tested with Python versions 3.9, 3.11, and 3.12 on Rocky 9. In order to install the library, you'll need to check out the source, have python setuptools installed and run

python3 ./setup.py build && \
  sudo python3 ./setup.py install

Alternatively, on RHEL-based systems with rpm-build and python3-dev installed, you may run

mkdir -p ~/rpmbuild/SOURCES && \
  python3 ./setup.py build && \
  python3 ./setup.py bdist_rpm && \
  cp dist/argo-mon-library-0.1.0.tar.gz && \
  rpmbuild -bb argo-mon-library.spec

to create an RPM file for each supported python version under ~/rpmbuild/RPMS/noarch, and then use rpm / dnf to install the desired RPM packages, e.g.

sudo dnf install ~/rpmbuild/RPMS/noarch/python3-argo-mon-library-0.1.0-1.el9.noarch.rpm

for version 0.1.0-1 of the library using the default (platform) python.

Authentication

The Argo Monitoring library needs a valid API key to authenticate against the service's REST API. Each API key gives access to a specific tenant. Once a valid key has been obtained, a monitoring service object may be initialized as follows:

from argo_mon_library import ArgoMonitoringService
mon = ArgoMonitoringService(endpoint="mon_endpoint", apikey="your_api_key")

Examples

In the examples folder, you may find the following library usage examples:

  • getting a list of reports for a tenant (examples/get_reports.py)
  • getting the status for each endpoint of all groups defined in a report
  • getting daily/monthy A/R results for groups defined in a report

Help on running each example is available by running the example with -h.

Listing reports

Assuming you've saved your API key in a file under ~/mon.key, you may run the first example against the development instance of the service with

python3 ./examples/get_reports.py --host api.devel.mon.argo.grnet.gr --api-key ~/mon.key -f

This will print out a list of reports for the tenant, along with some information about the report, such as thresholds and the topology schema group hierarchy

Getting report endpoint statuses

To get status data for endpoints belonging to groups of a report, run

python3 ./examples/get_endpoint_statuses.py --host api.devel.mon.argo.grnet.gr --api-key ~/mon.key -f --report REPORTNAME --start-date YYYY-MM-DD

where REPORTNAME is the name of a report, as listed in the 1st example, and YYYY-MM-DD is an ISO formated date. An optional end date may be passed with --end-date YYY-MM-DD, which otherwise defaults to the day defined by --start-date.

Getting report A/R results

To get daily A/R results for all groups in a report, run

python3 ./examples/get_group_results.py --host api.devel.mon.argo.grnet.gr --api-key ~/mon.key -f --report REPORTNAME --start-date YYYY-MM-DD

where REPORTNAME is the name of a report, as listed in the 1st example, and YYYY-MM-DD is an ISO formated date. An optional end date may be passed with --end-date YYY-MM-DD, which otherwise defaults to the day defined by --start-date. Additionally,

  • The optional argument --monthly may be specified to fetch results with a monthy granularity, instead of daily.
  • The optional argument --supergroup SUPERGROUPNAME may be specified, in order to fetch results for a specific top-level group (supergroup)
  • The optional argument --group GROUNAME may be specified in order to fetch results for specific group of each supergroup, instead of all groups

Environment variables

  • DEBUG: Set to any truthy value in order to have debugging information printed to stdout, for development pusposes.

Metadata

Release files for argo-mon-library 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for argo-mon-library 0.1.0
File Size Uploaded
argo-mon-library-0.1.0.tar.gz 19.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for argo-mon-library 0.1.0
File Interpreter ABI Platform
argo_mon_library-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.1 kB

Release files / argo-mon-library-0.1.0.tar.gz

Download URL argo-mon-library-0.1.0.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b3806ae66d23dc6a2b1dfc951a7915379a7802ad9c756f8c5407352615ac5bdc
BLAKE2b-256 checksum
How to use checksums
8930f821188ffc6f1c2518dffb5ad1be3f37bd0a6b89936dbfaf2a5a7251085f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.2

Release files / argo_mon_library-0.1.0-py3-none-any.whl

Download URL argo_mon_library-0.1.0-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fb60ea0467307ecce84149728be678bb7fbd9123a231323ddce39b403c6a71b
BLAKE2b-256 checksum
How to use checksums
258024c53c28bcfff45d72689bfed43512736c7589aba8f445bea0e08a371301
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page