Setup ssh/promtail/loki for grafana ssh dashboard
This commit is contained in:
parent
18181f9085
commit
0b4ce24253
4 changed files with 122 additions and 0 deletions
31
nixos/viridian/services/promtail.nix
Normal file
31
nixos/viridian/services/promtail.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.promtail = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
server = {
|
||||
http_listen_port = 9080;
|
||||
grpc_listen_port = 0;
|
||||
};
|
||||
positions = {
|
||||
filename = "/tmp/positions.yaml";
|
||||
};
|
||||
clients = [{
|
||||
url = "http://127.0.0.1:${toString config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push";
|
||||
}];
|
||||
scrape_configs = [{
|
||||
job_name = "system";
|
||||
static_configs = [{
|
||||
targets = [ "localhost" ]; # Promtail target is localhost
|
||||
labels = {
|
||||
instance = "viridian.kanto.dev"; # Label identifier for instance
|
||||
env = "kanto"; # Environment label
|
||||
job = "secure"; # Job label
|
||||
__path__ = "/var/log/sshd.log";
|
||||
};
|
||||
}];
|
||||
}];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue