-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.py
executable file
·44 lines (36 loc) · 1.24 KB
/
install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup for weewx prometheus pushgateway pusher
"""
__title__ = 'PromPush'
__version__ = '1.1.0'
__author__ = 'Tom Mitchell <[email protected]>'
__license__ = 'Apache License, Version 2.0'
""" props to steve ulrich for the original version of this!!"""
import setup
def loader():
"""install PromPush extension"""
return WeewxPromPushInstaller()
class WeewxPromPushInstaller(setup.ExtensionInstaller):
"""installs weewx PromPush extension"""
def __init__(self):
super(WeewxPromPushInstaller, self).__init__(
version=__version__,
name=__title__,
description='post weather data to prometheus pushgateway.',
author='Tom Mitchell',
author_email='[email protected]',
restful_services='user.prompush.PromPush',
config={
'StdRESTful': {
'PromPush': {
'host': 'PUSH_GW_HOST',
'port': 'PUSH_GW_PORT',
'job': 'PROMETHEUS_JOB_NAME',
'instance': 'PROMETHEUS_INSTANCE_NAME'
}
}
},
files=[('bin/user', ['bin/user/prompush.py'])]
)