This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

machiens.icarus: remove legacy monitoring

+75 -75
+75 -75
machines/icarus/config.nix
··· 61 61 # }; 62 62 63 63 # - metrics 64 - services.telegraf = { 65 - enable = true; 66 - extraConfig = { 67 - inputs = { 68 - cpu = {}; 69 - mem = {}; 70 - net = { 71 - ignore_protocol_stats = true; 72 - }; 73 - exec = { 74 - command = pkgs.writers.writePython3 "get_bat_stats" {} /* python */ '' 75 - import json 76 - import os 64 + # services.telegraf = { 65 + # enable = true; 66 + # extraConfig = { 67 + # inputs = { 68 + # cpu = {}; 69 + # mem = {}; 70 + # net = { 71 + # ignore_protocol_stats = true; 72 + # }; 73 + # exec = { 74 + # command = pkgs.writers.writePython3 "get_bat_stats" {} /* python */ '' 75 + # import json 76 + # import os 77 77 78 78 79 - values_to_fetch = [ 80 - "capacity", 81 - "energy_now", 82 - "energy_full", 83 - "energy_full_design", 84 - "charge_now", 85 - "charge_full", 86 - "charge_full_design", 87 - ] 79 + # values_to_fetch = [ 80 + # "capacity", 81 + # "energy_now", 82 + # "energy_full", 83 + # "energy_full_design", 84 + # "charge_now", 85 + # "charge_full", 86 + # "charge_full_design", 87 + # ] 88 88 89 - result = {} 90 - for sup in os.listdir('/sys/class/power_supply'): 91 - with open('/sys/class/power_supply/{}/type'.format(sup)) as f: 92 - if f.read().strip() != "Battery": 93 - continue 94 - for val in values_to_fetch: 95 - try: 96 - with open('/sys/class/power_supply/{}/{}'.format(sup, val)) as f: 97 - key = '{}_{}'.format(sup, val) 98 - try: 99 - result[key] = int(f.read().strip()) 100 - except ValueError: 101 - result[key] = f.read().strip() 102 - except: # noqa 103 - pass 89 + # result = {} 90 + # for sup in os.listdir('/sys/class/power_supply'): 91 + # with open('/sys/class/power_supply/{}/type'.format(sup)) as f: 92 + # if f.read().strip() != "Battery": 93 + # continue 94 + # for val in values_to_fetch: 95 + # try: 96 + # with open('/sys/class/power_supply/{}/{}'.format(sup, val)) as f: 97 + # key = '{}_{}'.format(sup, val) 98 + # try: 99 + # result[key] = int(f.read().strip()) 100 + # except ValueError: 101 + # result[key] = f.read().strip() 102 + # except: # noqa 103 + # pass 104 104 105 - print(json.dumps(result)) 106 - ''; 107 - data_format = "json"; 108 - name_suffix = "_bat"; 109 - interval = "10s"; 110 - }; 111 - }; 112 - outputs = { 113 - influxdb = { database = "telegraf"; urls = [ "http://localhost:8086" ]; }; 114 - }; 115 - }; 116 - }; 105 + # print(json.dumps(result)) 106 + # ''; 107 + # data_format = "json"; 108 + # name_suffix = "_bat"; 109 + # interval = "10s"; 110 + # }; 111 + # }; 112 + # outputs = { 113 + # influxdb = { database = "telegraf"; urls = [ "http://localhost:8086" ]; }; 114 + # }; 115 + # }; 116 + # }; 117 117 118 - # --- server --- 118 + # # --- server --- 119 119 120 - # - metrics 121 - services.influxdb = { 122 - enable = true; 123 - extraConfig = { 124 - opentsdb = [{ 125 - enabled = true; 126 - bind-address = ":4242"; 127 - database = "opentsdb"; 128 - retention-policy = ""; 120 + # # - metrics 121 + # services.influxdb = { 122 + # enable = true; 123 + # extraConfig = { 124 + # opentsdb = [{ 125 + # enabled = true; 126 + # bind-address = ":4242"; 127 + # database = "opentsdb"; 128 + # retention-policy = ""; 129 129 130 - batch-size = 1000; 131 - batch-pending = 5; 132 - batch-timeout = "1s"; 133 - }]; 134 - }; 135 - }; 130 + # batch-size = 1000; 131 + # batch-pending = 5; 132 + # batch-timeout = "1s"; 133 + # }]; 134 + # }; 135 + # }; 136 136 137 - # - logs 138 - services.graylog = { 139 - enable = true; 140 - passwordSecret = "AmjUYosI6hXKyI1MLEusupZy7srxQxZOowpHSmvF0ekMoi19go5qmnqd3po4VcQahdR1AKZ3Yk9tP6nLUbgmzLwQFodIc5g8"; 141 - rootPasswordSha2 = "cf80cd8aed482d5d1527d7dc72fceff84e6326592848447d2dc0b0e87dfc9a90"; # testing 142 - elasticsearchHosts = [ "http://localhost:9200" ]; 143 - }; 137 + # # - logs 138 + # services.graylog = { 139 + # enable = true; 140 + # passwordSecret = "AmjUYosI6hXKyI1MLEusupZy7srxQxZOowpHSmvF0ekMoi19go5qmnqd3po4VcQahdR1AKZ3Yk9tP6nLUbgmzLwQFodIc5g8"; 141 + # rootPasswordSha2 = "cf80cd8aed482d5d1527d7dc72fceff84e6326592848447d2dc0b0e87dfc9a90"; # testing 142 + # elasticsearchHosts = [ "http://localhost:9200" ]; 143 + # }; 144 144 145 - services.elasticsearch = { 146 - enable = true; 147 - }; 145 + # services.elasticsearch = { 146 + # enable = true; 147 + # }; 148 148 # services.loki = { 149 149 # enable = true; 150 150 # configuration = {