Skip to content

Instantly share code, notes, and snippets.

View crashdump's full-sized avatar
🖖

Adrien P. crashdump

🖖
View GitHub Profile
@crashdump
crashdump / Template CouchDB.xml
Last active February 28, 2024 15:04
CouchDB / BigCouch - Zabbix Monitoring
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2013-12-03T16:57:07Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@crashdump
crashdump / check-ssl-expire.py
Last active January 9, 2023 09:45
Report how many days before and http ssl certificate expire. I've also provided a template if you want to use it with Zabbix as an External Check: - Configure ExternalScripts variable in zabbix_server.conf - Put the script in the external script folder (I've used /etc/zabbix/externalscripts/) - Import the template & assign it to your host. - Wat…
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Adrien Pujol - http://www.crashdump.fr/"
__copyright__ = "Copyright 2013, Adrien Pujol"
__license__ = "Mozilla Public License"
__version__ = "0.3"
__email__ = "adrien.pujol@crashdump.fr"
__status__ = "Development"
__doc__ = "Check a TLS certificate validity."
@crashdump
crashdump / compare-ntp-time.py
Last active December 29, 2022 16:17
Compare the time of two ntp servers.
#!/usr/bin/python
import struct, sys, time, argparse
from socket import socket, AF_INET, SOCK_DGRAM
error_margin = 3
def get_time(host):
sock = socket(AF_INET, SOCK_DGRAM)
sock.settimeout(2)
@crashdump
crashdump / Template Kamailio.xml
Last active August 29, 2022 09:38
Kamailio - Zabbix Monitoring
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2013-12-03T11:38:27Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@crashdump
crashdump / Template Freeswitch.xml
Created December 4, 2013 16:02
Freeswitch - Zabbix Monitoring
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2013-12-04T16:01:36Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@crashdump
crashdump / zbx-exim-stats.sh
Created June 3, 2013 12:25
A simple Zabbix statistics pusher. It check and report these values: - Number of running processes exim4 (trigger if 0) - Mails Queue Size (trigger if >500 and >1000) - Mails Received - Mails Error - Mails Received Size in Bytes - Mails Delivered - Mails Delivered Size in Bytes Import the template. Assign to you hosts. Cron the .sh.. You're good…
#!/bin/bash
# Set Variables
EXIMLOG=/var/log/exim4/mainlog
MYLOG=/tmp/exim_status.log
OFFSETFILE=/tmp/eximstatusoffset.dat
EXIMSTATS=/usr/sbin/eximstats
LOGTAIL=/usr/sbin/logtail
ZABBIX_SENDER=/usr/bin/zabbix_sender
ZABBIX_CONF=/etc/zabbix/zabbix_agentd.conf
@crashdump
crashdump / iptables
Last active September 24, 2020 17:13
### BEGIN INIT INFO
# Provides: firewall-ipv4
# Required-Start: $network
# Required-Stop: $network
# Default-Start: S 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Firewall rules
# Description: Simple script to initialise an iptables firewall
### END INIT INFO
@crashdump
crashdump / ip6tables
Last active November 20, 2019 13:21
### BEGIN INIT INFO
# Provides: firewall
# Required-Start: $network
# Required-Stop: $network
# Default-Start: S 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Firewall (ipv6) rules
# Description: Simple script to initialise an ip6tables firewall
### END INIT INFO
@crashdump
crashdump / keybase.md
Last active June 5, 2019 19:47
Keybase Proof

Keybase proof

I hereby claim:

  • I am crashdump on github.
  • I am adrienp (https://keybase.io/adrienp) on keybase.
  • I have a public key ASBN0dRpWA_POCJKLSZuueSZiYT4NbHMS9FQgHQ9oLWoHgo

To claim this, I am signing this object:

@crashdump
crashdump / consul-ssh-configurator.py
Last active July 5, 2016 17:54 — forked from mattupstate/consul-ssh-configurator.py
A script to generate an SSH config from Consul's HTTP API
#!/usr/bin/env python3
"""
Renders a partial SSH configuration file from Nodes and Services
located in a specified Consul catalog and then merges other partial
config files into the main ~/.ssh/config file. The Consul based SSH
config follows a convention for the SSH host::
Host <prefix>_<consul-cluster-name>_<node-name>
User <ssh-user>
Hostname <consul-node-address>