Compare commits

..

No commits in common. "902d60bbea1abd9f826a0e3e2628a9245b844859" and "0e24bc09a05dfb09c78eccc2436ddbd4f23f4570" have entirely different histories.

3 changed files with 13 additions and 11 deletions

View File

@ -203,12 +203,13 @@ From version 2.0 there are following metric names used
- `das_rest_value` - Remote REST API Value; Labels **name, url, method, server** - `das_rest_value` - Remote REST API Value; Labels **name, url, method, server**
- `das_shell_value` - Shell Value; Labels: **name, command, server** - `das_shell_value` - Shell Value; Labels: **name, command, server**
- `das_host_available` - Host availability; Labels **name, ip, server** - `das_host_available` - Host availability; Labels **name, ip, server**
- `das_net_interface_bytes` - Network Interface bytes; Labels: **name, server, metric=(sent|receive)** - `das_net_interface_bytes` - Network Interface bytes; Labels: **name, server, metric**=(sent|receive)
- `das_exporter` - Exporter Uptime for **server** in seconds - `das_exporter` - Exporter Uptime for **server** in seconds
- `das_uptime_seconds` - System uptime on **server** - `das_uptime_seconds` - System uptime on **server**
- `das_cpu_percent` - CPU used percent on **server** - `das_cpu_percent` - CPU used percent on **server**
- `das_memory_percent` - Memory used percent on **server** - `das_memory_percent` - Memory used percent on **server**
- `das_temperature` - Temperature overall; Labels **server**, **metric=(CPU|Chassis)**; - `das_ChassisTemperature_current` - Current Chassis Temperature overall on **server**
- `das_CpuTemperature_current` - Current CPU Temperature overall on **server**
**Note:** there are no doubles in metrics names supported by Prometheus. If so the exception occurs ant the application will be stopped. **Note:** there are no doubles in metrics names supported by Prometheus. If so the exception occurs ant the application will be stopped.
### 🚀 Launching the application ### 🚀 Launching the application

View File

@ -1,6 +1,6 @@
import os import os
APP_VERSION="2.1" APP_VERSION="2.0"
SCRIPT_PATH = os.path.dirname(__file__) SCRIPT_PATH = os.path.dirname(__file__)
CONFIGS_DIR = SCRIPT_PATH + "/configs" CONFIGS_DIR = SCRIPT_PATH + "/configs"
CONFIG_FILE_NAME = CONFIGS_DIR + "/config.json" CONFIG_FILE_NAME = CONFIGS_DIR + "/config.json"

View File

@ -270,7 +270,7 @@ class SystemData(AbstractData):
c_uptime: Counter c_uptime: Counter
g_cpu: Gauge g_cpu: Gauge
g_memory: Gauge g_memory: Gauge
g_tempr: Gauge g_chassis_temp: Gauge
g_cpu_temp: Gauge g_cpu_temp: Gauge
def __init__(self, interval, prefix=''): def __init__(self, interval, prefix=''):
super().__init__('system', interval, prefix) super().__init__('system', interval, prefix)
@ -285,9 +285,10 @@ class SystemData(AbstractData):
self.g_cpu.labels(server=self.instance_prefix) self.g_cpu.labels(server=self.instance_prefix)
self.g_memory = get_gauge_metric('das_memory_percent', 'Memory used percent on [server]', ['server']) self.g_memory = get_gauge_metric('das_memory_percent', 'Memory used percent on [server]', ['server'])
self.g_memory.labels(server=self.instance_prefix) self.g_memory.labels(server=self.instance_prefix)
self.g_tempr = get_gauge_metric('das_temperature', 'Temperature of [type] overall on [server]', ['metric', 'server']) self.g_chassis_temp = get_gauge_metric('das_ChassisTemperature_current', 'Current Chassis Temperature overall on [server]', ['server'])
self.g_tempr.labels(server=self.instance_prefix, metric='CPU') self.g_chassis_temp.labels(server=self.instance_prefix)
self.g_tempr.labels(server=self.instance_prefix, metric='Chassis') self.g_cpu_temp = get_gauge_metric('das_CpuTemperature_current', 'Current CPU Temperature overall on [server]', ['server'])
self.g_cpu_temp.labels(server=self.instance_prefix)
def set_data(self): def set_data(self):
time_ms = get_time_millis() time_ms = get_time_millis()
@ -319,13 +320,13 @@ class SystemData(AbstractData):
else: else:
self.ch_temp = self.cpu_temp self.ch_temp = self.cpu_temp
self.g_tempr.labels(server=self.instance_prefix, metric='Chassis').set(self.ch_temp) self.g_chassis_temp.labels(server=self.instance_prefix).set(self.ch_temp)
self.g_tempr.labels(server=self.instance_prefix, metric='CPU').set(self.cpu_temp) self.g_cpu_temp.labels(server=self.instance_prefix).set(self.cpu_temp)
except: except:
self.ch_temp = -500 self.ch_temp = -500
self.cpu_temp = -500 self.cpu_temp = -500
self.g_tempr.labels(server=self.instance_prefix, metric='Chassis').set(self.ch_temp) self.g_chassis_temp.labels(server=self.instance_prefix).set(self.ch_temp)
self.g_tempr.labels(server=self.instance_prefix, metric='CPU').set(self.cpu_temp) self.g_cpu_temp.labels(server=self.instance_prefix).set(self.cpu_temp)
self.set_collect_time(get_time_millis() - time_ms) self.set_collect_time(get_time_millis() - time_ms)
self.set_update_time() self.set_update_time()