Skip to content

Instantly share code, notes, and snippets.

@jorisd
jorisd / nginx_exporter.md
Created September 8, 2023 17:35 — forked from mattpr/nginx_exporter.md
using mtail and nginx access_log to export custom metrics from nginx for prometheus and other monitoring scrapers

Feedback

I'm sure I've gotten multiple things wrong here. Either flat out wrong, anti-patterns or just sub-optimal. I'm new to prometheus, grafana and mtail...so please feel free to share corrections/suggestions.

Background

There are a handful of custom nginx stats exporters.

Some are tying into internal nginx stats like the official nginx exporter: nginx-prometheus-exporter

@jorisd
jorisd / tmuxp.sh
Created November 20, 2019 22:06 — forked from mlgill/tmuxp.sh
Execute parallel processes in arbitrary number of tmux panes
#!/bin/bash
# The "tmuxifier"
# Execute parallel processes in an arbitrary number of tmux panes
# This script requires the path to an existing script to
# execute in parallel. Optionally, the number of threads to
# and the name of the tmux session can be input. If threads
# and session name are not entered, threads are determined
# automatically and session names is set to a default.

Keybase proof

I hereby claim:

  • I am jorisd on github.
  • I am jorisd (https://keybase.io/jorisd) on keybase.
  • I have a public key ASB3t-9DMwOT19foJIge4F0PahSW5ssxchUY0h-p-ZfQEwo

To claim this, I am signing this object:

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

group mygroup => "srv01", "web[01..10]";
task "test", sub {
my @servers = get_servers("mygroup");
for my $srv (@servers) {
run_task "foo", on => $srv, params => { param1 => "value1", param2 => "value2" };
}
};
sub get_servers {
use strict;
use warnings;
use Data::Dumper;
use Rex::Commands::Cloud;
use Rex::Commands::SimpleCheck;
use Rex::Commands::SCM;
use Rex::Commands::Iptables;
my $access_key = "your-access-key";
package Custom::Module;
desc "Sets initial debconf selections, and upgrade packages";
task "debconf", sub {
upload "lib/Vedeu/General/Prerequis/dist/dpkg-db", "/tmp";
say run "cat /tmp/dpkg-db | debconf-set-selections";
};