Skip to main content

No project description provided

Project description

GlobalNOC Status Monitoring Library

This Python library is used to write status files for GRNOC software.


Requirements

Please make sure you have the following dependencies already installed on your host:

  • python3
  • python3-setuptools

Installation

Run the following command to install the library:

foo@bar:~$ sudo yum install python3-globalnoc-monitoring-service-status

Import

Import the write_service_status function using the following line of code:

from globalnoc_monitoring_service_status import write_service_status

Function Parameters

The write_service_status function has the following parameters:

Parameter Required? Default Value Description
error Yes - Error Number
error_text Yes - Error Description
path No - Target folder
service No - Service Name
filename No status.txt Status File Name
timestamp No Current Time Unix Timestamp

Note: You must either provide a path to the status file folder or a service name.

If for some reason path and service are both passed as arguments, the function will create the status file at the provided path.

Usage

Here are some code snippets using this module:

from globalnoc_monitoring_service_status import write_service_status

# Create status.txt at /var/lib/grnoc/fortigate_collector/
write_service_status(error=0,
                     error_text='Data queued to RabbitMQ Successfully.', 
                     service='fortigate_collector')

# Create status_log at /var/lib/my_service/
write_service_status(error=1,
                     error_text='Error making GET request.', 
                     path='/var/lib/my_service/', 
                     filename='status_log')

# Create status.txt at /var/lib/my_service/ with custom timestamp
write_service_status(error=1,
                     error_text='Error making GET request.', 
                     path='/var/lib/my_service/',
                     timestamp='1596547846')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file globalnoc-monitoring-service-status-0.1.0.tar.gz.

File metadata

File hashes

Hashes for globalnoc-monitoring-service-status-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f8c630b267a3374c7ba33bf06e8053ecf0507fc3fb1be0cb170d5d934509b4c1
MD5 81a0e58c74a351f5f571b1c6cd5fdcb7
BLAKE2b-256 e841bda296e13c78816aae81ea74e7346d66e578be16bcabadcaed18ec5f2678

See more details on using hashes here.

File details

Details for the file globalnoc_monitoring_service_status-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for globalnoc_monitoring_service_status-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13e4aa58fbb03980b7425a55e35dee894bb67320f81d36bb70e162369822506e
MD5 b1759da6511e97e3288bf90dc23b6775
BLAKE2b-256 49b6f2469af292a08f053fb31e2b39b7e2a85ae014f33a340fe291756c2f6087

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page