mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2026-03-21 20:18:38 -06:00
Added installation instructions for Python package usage. Added new flags.
+38
-1
@@ -30,7 +30,41 @@ needed (see [config file](#config-file)):
|
||||
docker run -d -t -i -v $(pwd)/config.py:/opt/netbox-zabbix/config.py ...
|
||||
```
|
||||
|
||||
# Installation from Source (Python)
|
||||
# Install the Python package
|
||||
Instead of a all-in-1 solution you can opt to install the netbox-zabbix-sync Python package and import the class by yourself! This allows you to call the sync function in other scripts or with other requirements.
|
||||
|
||||
https://pypi.org/project/netbox-zabbix-sync/
|
||||
|
||||
```sh
|
||||
pip install netbox-zabbix-sync
|
||||
```
|
||||
We have provided an example configuration down below. You do not need to pass all of the configuration options. Only the options that you want to change from the base default configuration are required to be passed using a dictionary.
|
||||
```python
|
||||
from netbox_zabbix_sync import Sync
|
||||
|
||||
# Setting the configuration
|
||||
config = {"clustering": True}
|
||||
|
||||
# Setting the connection details. Obviously we recommend not using plain-text passwords in code
|
||||
# This is only as an example of passing variables to the connect() function.
|
||||
netbox_host = "https://netbox.internal"
|
||||
netbox_token = "supersecrettoken"
|
||||
zabbix_host = "https://zabbix.internal"
|
||||
zabbix_user = "NetboxSync"
|
||||
zabbix_pass = "supersecretpassword"
|
||||
|
||||
sync = Sync(config)
|
||||
sync.connect(
|
||||
nb_host=netbox_host,
|
||||
nb_token=netbox_token,
|
||||
zbx_host=zabbix_host,
|
||||
zbx_user=zabbix_user,
|
||||
zbx_pass=zabbix_pass
|
||||
)
|
||||
sync.start()
|
||||
```
|
||||
|
||||
# Installation from Source
|
||||
|
||||
## Cloning the repository
|
||||
|
||||
@@ -88,6 +122,9 @@ export REQUESTS_CA_BUNDLE=/path/to/your/ca-bundle.crt
|
||||
| -v | verbose | Log with info on. |
|
||||
| -vv | debug | Log with debugging on. |
|
||||
| -vvv | debug-all | Log with debugging on for all modules |
|
||||
| -version | | Shows the script version |
|
||||
| -q | --quiet | Turn off warnings |
|
||||
| -c | --config | Path to the config file (default: config.py next to the script or in the current directory) |
|
||||
|
||||
**Configuration**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user