Merge subnet lists

May 10, 2023, 11:34 pm python subnet cidr merge

This is a small python snippet to merge multiple subnet lists mixed with single ip addresses and CIDRs.

netaddr module required, install it with "pip install netaddr".

Usage: python merge.py merge1.txt merge2.txt etc.

from netaddr import cidr_merge
import sys

if __name__ == "__main__":

    i...

Continue Reading...

This little code snippet is the base of my Netbox Webhook Listener written in APIFlask. APIFlask is a package which based on Flask but specialized on REST API.

Github Gist: Netbox Webhook Listener written with APIFlask

APIFlask Documentation

Code

import hmac
from apiflask import APIFlask
im...

Continue Reading...

I have written a short script to sync devices to CheckMK when they get an IP adress in Netbox.

Sources: lanbugs/netbox-scripts @GibHub

Quick manual

Files & Netbox user

Place the file in /etc/netbox/scripts folder or in case of docker in ./scripts in the docker root of netbox. You need a use...

Continue Reading...

dnsq - Tool to check DNS zones syncronity

December 14, 2022, 10:26 pm dns go

This is my first GO project to learn the programming language :-)

asciicast

What can dnsq do for you?

dnsq has several options to check with the SOA serial if the replication of zones are completed.

You can predefine a config.yml or several config.yml files in the program folder to define the nameserv...

Continue Reading...

To parse outputs of commands in Ansible you can use TEXTFSM. You need to install textfsm with pip.

TEXTFSM is a template based parser for commandline outputs.

Install of the required packages
python -m virtualenv venv
source venv/bin/activate
pip install ansible ansible-pylibssh textfsm
Exam
...

Continue Reading...