Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ndkprd/netbox-to-obsidian
Python script to pull data from Netbox and convert it to Obsidian metadata Markdown-friendly format.
https://github.com/ndkprd/netbox-to-obsidian
netbox obsidian
Last synced: 4 months ago
JSON representation
Python script to pull data from Netbox and convert it to Obsidian metadata Markdown-friendly format.
- Host: GitHub
- URL: https://github.com/ndkprd/netbox-to-obsidian
- Owner: ndkprd
- License: mit
- Created: 2024-09-09T05:29:03.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-09T11:31:34.000Z (5 months ago)
- Last Synced: 2024-09-26T20:44:10.228Z (4 months ago)
- Topics: netbox, obsidian
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Netbox to Obsidian
Python script to pull data from [Netbox](https://netboxlabs.com) and convert it to [Obsidian](https://obsidian.md) metadata Markdown-friendly format.
Some unneeded background:
I love using Obsidian's wikilink, and sometimes when writing daily notes I'll refer to a device that I need to manage/troubleshoot. This scripts help giving me more context to the devices, while also keeping it in sync with my infrastructure SSOT.
## Usage
### Install Requirements
```bash
py -m pip install -r requirements.txt
```### Define URL and and API Token in .env
For example:
```bash
NETBOX_API_TOKEN=super-secret-token
NETBOX_URL=https://netbox.domain.tld
```### Configure `config.yaml` as required
For example:
```yaml
---config:
- netbox_endpoint: "/api/dcim/devices"
obsidian_template: "device.md.j2"
obsidian_folder: "output/Devices"- netbox_endpoint: "/api/dcim/manufacturers"
obsidian_template: "manufacturer.md.j2"
obsidian_folder: "output/Manufacturers"- netbox_endpoint: "/api/dcim/device-roles"
obsidian_template: "device_role.md.j2"
obsidian_folder: "output/Device Roles"- netbox_endpoint: "/api/dcim/sites"
obsidian_template: "site.md.j2"
obsidian_folder: "output/Sites"```
You can also add more Netbox models or modify templates as you want, just add/modify the file inside the `/templates` folder for the templates.
### Run the script
```bash
py ./netbox-to-obsidian.py
```You can setup scheduler to run the script periodically.
## License
MIT, use at your own risk.