diff options
Diffstat (limited to 'hosts/vidhar/prometheus')
| -rw-r--r-- | hosts/vidhar/prometheus/default.nix | 60 | ||||
| -rw-r--r-- | hosts/vidhar/prometheus/zte_dsl01.mgmt.yggdrasil | 26 |
2 files changed, 7 insertions, 79 deletions
diff --git a/hosts/vidhar/prometheus/default.nix b/hosts/vidhar/prometheus/default.nix index 1e649824..3e938933 100644 --- a/hosts/vidhar/prometheus/default.nix +++ b/hosts/vidhar/prometheus/default.nix | |||
| @@ -63,7 +63,7 @@ in { | |||
| 63 | systemd = { | 63 | systemd = { |
| 64 | enable = true; | 64 | enable = true; |
| 65 | extraFlags = [ | 65 | extraFlags = [ |
| 66 | "--systemd.collector.unit-include=(dhcpcd-dsl|pppd-telekom|corerad|ndppd)\.service" | 66 | "--systemd.collector.unit-include=(dhcpcd-.*|pppd-telekom|corerad|ndppd)\.service" |
| 67 | "--systemd.collector.enable-restart-count" | 67 | "--systemd.collector.enable-restart-count" |
| 68 | "--systemd.collector.enable-ip-accounting" | 68 | "--systemd.collector.enable-ip-accounting" |
| 69 | ]; | 69 | ]; |
| @@ -144,17 +144,6 @@ in { | |||
| 144 | ]; | 144 | ]; |
| 145 | scrape_interval = "15s"; | 145 | scrape_interval = "15s"; |
| 146 | } | 146 | } |
| 147 | { job_name = "zte"; | ||
| 148 | static_configs = [ | ||
| 149 | { targets = ["localhost:9900"]; } | ||
| 150 | ]; | ||
| 151 | relabel_configs = [ | ||
| 152 | { replacement = "dsl01"; | ||
| 153 | target_label = "instance"; | ||
| 154 | } | ||
| 155 | ]; | ||
| 156 | scrape_interval = "15s"; | ||
| 157 | } | ||
| 158 | { job_name = "unbound"; | 147 | { job_name = "unbound"; |
| 159 | static_configs = [ | 148 | static_configs = [ |
| 160 | { targets = ["localhost:${toString config.services.prometheus.exporters.unbound.port}"]; } | 149 | { targets = ["localhost:${toString config.services.prometheus.exporters.unbound.port}"]; } |
| @@ -274,6 +263,9 @@ in { | |||
| 274 | { record = "systemd_unit_runtime_seconds:resets_per_week"; | 263 | { record = "systemd_unit_runtime_seconds:resets_per_week"; |
| 275 | expr = "resets(systemd_unit_runtime_seconds[1w])"; | 264 | expr = "resets(systemd_unit_runtime_seconds[1w])"; |
| 276 | } | 265 | } |
| 266 | { record = "systemd_unit_runtime_seconds:avg_resets_per_day"; | ||
| 267 | expr = "avg_over_time(systemd_unit_runtime_seconds:resets_per_day[1w])"; | ||
| 268 | } | ||
| 277 | ]; | 269 | ]; |
| 278 | } | 270 | } |
| 279 | { name = "apcupsd-transfers"; | 271 | { name = "apcupsd-transfers"; |
| @@ -290,6 +282,9 @@ in { | |||
| 290 | { record = "apcupsd_last_transfer_on_battery_counter_seconds:resets_per_week"; | 282 | { record = "apcupsd_last_transfer_on_battery_counter_seconds:resets_per_week"; |
| 291 | expr = "resets(apcupsd_last_transfer_on_battery_counter_seconds[1w])"; | 283 | expr = "resets(apcupsd_last_transfer_on_battery_counter_seconds[1w])"; |
| 292 | } | 284 | } |
| 285 | { record = "apcupsd_last_transfer_on_battery_counter_seconds:avg_resets_per_day"; | ||
| 286 | expr = "avg_over_time(apcupsd_last_transfer_on_battery_counter_seconds:resets_per_day[1w])"; | ||
| 287 | } | ||
| 293 | ]; | 288 | ]; |
| 294 | } | 289 | } |
| 295 | ]; | 290 | ]; |
| @@ -315,47 +310,6 @@ in { | |||
| 315 | }; | 310 | }; |
| 316 | }; | 311 | }; |
| 317 | 312 | ||
| 318 | systemd.services."prometheus-zte-exporter@dsl01.mgmt.yggdrasil" = { | ||
| 319 | wantedBy = [ "multi-user.target" ]; | ||
| 320 | after = [ "network.target" ]; | ||
| 321 | serviceConfig = { | ||
| 322 | Restart = "always"; | ||
| 323 | PrivateTmp = true; | ||
| 324 | WorkingDirectory = "/tmp"; | ||
| 325 | DynamicUser = true; | ||
| 326 | CapabilityBoundingSet = [""]; | ||
| 327 | DeviceAllow = [""]; | ||
| 328 | LockPersonality = true; | ||
| 329 | MemoryDenyWriteExecute = true; | ||
| 330 | NoNewPrivileges = true; | ||
| 331 | PrivateDevices = true; | ||
| 332 | ProtectClock = true; | ||
| 333 | ProtectControlGroups = true; | ||
| 334 | ProtectHome = true; | ||
| 335 | ProtectHostname = true; | ||
| 336 | ProtectKernelLogs = true; | ||
| 337 | ProtectKernelModules = true; | ||
| 338 | ProtectKernelTunables = true; | ||
| 339 | ProtectSystem = "strict"; | ||
| 340 | RemoveIPC = true; | ||
| 341 | RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ]; | ||
| 342 | RestrictNamespaces = true; | ||
| 343 | RestrictRealtime = true; | ||
| 344 | RestrictSUIDSGID = true; | ||
| 345 | SystemCallArchitectures = "native"; | ||
| 346 | UMask = "0077"; | ||
| 347 | |||
| 348 | Type = "simple"; | ||
| 349 | ExecStart = "${pkgs.zte-prometheus-exporter}/bin/zte-prometheus-exporter"; | ||
| 350 | Environment = "ZTE_BASEURL=http://%I ZTE_HOSTNAME=localhost ZTE_PORT=9900"; | ||
| 351 | EnvironmentFile = config.sops.secrets."zte_dsl01.mgmt.yggdrasil".path; | ||
| 352 | }; | ||
| 353 | }; | ||
| 354 | sops.secrets."zte_dsl01.mgmt.yggdrasil" = { | ||
| 355 | format = "binary"; | ||
| 356 | sopsFile = ./zte_dsl01.mgmt.yggdrasil; | ||
| 357 | }; | ||
| 358 | |||
| 359 | systemd.services."prometheus-nftables-exporter" = { | 313 | systemd.services."prometheus-nftables-exporter" = { |
| 360 | wantedBy = [ "multi-user.target" ]; | 314 | wantedBy = [ "multi-user.target" ]; |
| 361 | after = [ "network.target" ]; | 315 | after = [ "network.target" ]; |
diff --git a/hosts/vidhar/prometheus/zte_dsl01.mgmt.yggdrasil b/hosts/vidhar/prometheus/zte_dsl01.mgmt.yggdrasil deleted file mode 100644 index 1c9c1fe0..00000000 --- a/hosts/vidhar/prometheus/zte_dsl01.mgmt.yggdrasil +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | { | ||
| 2 | "data": "ENC[AES256_GCM,data:nAsn7dhfDr0+V1cJjpqWn/kJQt2zGjlfQKi3n5speroJkL3IvMG/9fsTaXJQZSi2gPlrN8GbxKQ=,iv:9g0V3xRBC+sa/JPP2bUZMfg//VuKT5qI7ua9iU4QRCg=,tag:fzwih9OHUBLmx8dxL4BjGg==,type:str]", | ||
| 3 | "sops": { | ||
| 4 | "kms": null, | ||
| 5 | "gcp_kms": null, | ||
| 6 | "azure_kv": null, | ||
| 7 | "hc_vault": null, | ||
| 8 | "age": [ | ||
| 9 | { | ||
| 10 | "recipient": "age1qffdqvy9arld9zd5a5cylt0n98xhcns5shxhrhwjq5g4qa844ejselaa4l", | ||
| 11 | "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBIaEE3bUFBY0xKSDUrVnc2\nbFpjSkNOSm56amJTNjdXcTljdDNRREhITm1NCjZrOUEwNFpxN2FmTVV5T2xCbENk\nMEFmVzlPZ29CTlJ4dVNCRUsyRFFseXcKLS0tIEhscVZ4VUVsaG9OUnBIRFE4WXA2\ncGFnbWpNMlNIQzFLc1Ryc1Z3NUl1bVUKi9zYBlF2vslGKu4GP368ApbvuxjZnQpF\nuOujXSNoEps21wY6xUENm+CbYbgaJjSgmb5c1IjAmnubVI4JVY9OyQ==\n-----END AGE ENCRYPTED FILE-----\n" | ||
| 12 | } | ||
| 13 | ], | ||
| 14 | "lastmodified": "2021-12-31T15:00:33Z", | ||
| 15 | "mac": "ENC[AES256_GCM,data:sw2NVXHLibbuOChgScLhSTjGZBjSoHpzIuRqfCW0eL3DwhL5CekG6T/oYu06KjNmxVjxwb3OmqECSU0TUvPn9ySOWwMSoBfyJpDoTHnZ+YOjOH351IOAMBNcBDJse7aLGRWW5YXKLDfmp8Dhg2hlMhCmkVwAquQjPhfmAdJfj64=,iv:wgM/BlRU2XJSGj7KvAo1WRamecffUDnFvv2+4twtsQY=,tag:0mXblJtTGMTvxndedws94A==,type:str]", | ||
| 16 | "pgp": [ | ||
| 17 | { | ||
| 18 | "created_at": "2023-01-30T10:58:49Z", | ||
| 19 | "enc": "-----BEGIN PGP MESSAGE-----\n\nhF4DXxoViZlp6dISAQdAcwl1Blp3J5wgpRJKbYI1G1yEZrRYeYuoDtYUh3ToMAQw\nd92/bIJJR5Ml91eDym9uBN0fFRRy72r6FOx4qZT7S4DhmuA84qCbASjF8bKSclc0\n0l4BBXvDS5Dz1Q7iYc+LxZjHASV1v73A+MaeCFvG/pjmHzF0z0EzBiAJD4ZWGcP0\nX2dDbjl+n9VFrvmeLRxQNh4XZW43iTXdRjwHDgm16zhd9X6VOVhr5UkC4Nyjq2Ar\n=4ZEa\n-----END PGP MESSAGE-----\n", | ||
| 20 | "fp": "30D3453B8CD02FE2A3E7C78C0FB536FB87AE8F51" | ||
| 21 | } | ||
| 22 | ], | ||
| 23 | "unencrypted_suffix": "_unencrypted", | ||
| 24 | "version": "3.7.1" | ||
| 25 | } | ||
| 26 | } \ No newline at end of file | ||
