Using Pynetbox

Pynetbox is a Python API client library for NetBox. Here are some basic examples of using pynetbox. In this page: Getting started Creating and changing something Retrieving objects Deleting objects Handling object status Using tags Referring to other objects Here we assume that you already have NetBox running (I have NetBox 2.8.6 in this demo), […]

Subcommands with Argument Parsing in Python

An example how subcommands can be used with argparse module: Sample output: markku@btest:~/temp$ python3 usage: [-h] [-c CONFIG_FILE] {update-device,add-vlan} … positional arguments: {update-device,add-vlan} update-device update device data add-vlan add a VLAN optional arguments: -h, –help show this help message and exit -c CONFIG_FILE, –config-file CONFIG_FILE specify the configuration file to read (default: argtest.cfg) […]

LDAPS Problem: Can’t contact LDAP server (-1)

LDAP authentication problem in the customer environment: The error message was received right after entering the password. Tshark says: 1 0.000000000 → TCP 74 44780 → 3269 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=2891116193 TSecr=0 WS=128 2 0.001225814 → TCP 74 3269 → 44780 [SYN, ACK] Seq=0 Ack=1 Win=8192 Len=0 MSS=1460 […]