Skip to content

Instantly share code, notes, and snippets.

deb http://deb.debian.org/debian bookworm main contrib
deb http://deb.debian.org/debian-security/ bookworm-security main contrib
deb http://deb.debian.org/debian bookworm-updates main contrib
deb http://mirrors.linode.com/debian bookworm main contrib
deb http://mirrors.linode.com/debian-security/ bookworm-security main contrib
deb http://mirrors.linode.com/debian bookworm-updates main contrib
@roojs
roojs / nagios-add-stuff.php
Last active June 22, 2022 01:50
script to install nagios montioring tool, output server config, so it can be copy and pasted to monitoring server
#!/usr/bin/php
<?php
# tool to try and reduce the work required to add nagios plugins to servers, and their lxc client
# usage: log into server, and run
# curl http:///{the gist url}/nagios-add-stuff.php | sudo php
# functions
$GLOBALS['added_first_br'] = array(); // array of files that we have added the line break.
#!/bin/bash
#
#command[check_memory]=/usr/lib/nagios/plugins/check_memory -w 10 -c 5
#
#
USAGE="`basename $0` [-w|--warning]<percent free> [-c|--critical]<percent free>"
THRESHOLD_USAGE="WARNING threshold must be greater than CRITICAL: `basename $0` $*"
calc=/tmp/memcalc
percent_free=/tmp/mempercent
#!/bin/sh
########################################################
# #
# www.361way.com #
# Useage: check_traffic -i Interface -w warn -c cirt #
# it's for pnp4nagios check the traffic #
# based on https://exchange.nagios.org/directory/Plugins/Network-Connections%2C-Stats-and-Bandwidth/check_traffic_pnp4naios/details
########################################################
@roojs
roojs / mysqlrouter_check
Last active March 2, 2022 09:25
mysqlrouter_check
#!/bin/bash
#usage in cron... /mysqlrouter_check cluster-hk2 mysqluser mysqlpass
match=$1
mysqluser=$2
mysqlpass=$3
routerpid=$(/bin/pidof mysqlrouter)