> For the complete documentation index, see [llms.txt](https://documentation.tjhsst.edu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.tjhsst.edu/technologies/networking/netbox.md).

# Netbox

Netbox is an [open-source](https://github.com/netbox-community/netbox/) Django application that is designed to help manage and document networks and the devices on those networks. In the CSL we use it to document each machine and VM along with their network configurations.

## Installation&#x20;

Netbox consists of 4 parts:

1. PostgreSQL database
2. Redis
3. Netbox Django Application
4. HTTP Proxy and Daemon

Basic installation instructions are [here](https://netbox.readthedocs.io/en/stable/installation/). \
The `netbox` Ansible playbook properly installs and configures everything as well.

### Upgrading Netbox

Netbox graciously created an upgrade script that automatically upgrades the current installation.\
Just `ssh` into `netbox` and run the following:

```bash
/opt/netbox/upgrade.sh
```

Once the script finishes, make sure to restart the `supervisor`daemons:

```
supervisorctl restart netbox
supervisorctl restart netbox-rqworker
```

## Using Netbox

You can access the netbox web page at <https://netbox.tjhsst.edu>, but you MUST be VPN'ed into the CSL in order to access the website.

### Creating User Accounts

Netbox has SSO support. Use that to log in.

### Interacting with Netbox

Using netbox is pretty straightforward; navigating through the web page is pretty intuitive. More specific documentation on netbox is available [here](https://netbox.readthedocs.io/en/stable/core-functionality/ipam/), but here are a few basics:

* The highest order of organization is a `region`, it represents the physical area where the network is (TJHSST , CSL).&#x20;
* Next there are `sites`, they represent the specific area in the `region` that divides the network (Machine Room, Room 200, Room 200C, etc.).&#x20;
* Each `site` can have `racks`, which represent a physical server rack (only used in the Machine Room `site`)
* `devices` are the next organizational unit. `devices` are NOT VMs. `devices` can belong to a `rack`(in the case of servers), or they can be independent (in the case of workstations).
* `devices` have `interfaces` which can be assigned an `ip`.&#x20;
  * Creating `interfaces` and `ips` is not obvious, though.
    1. &#x20;First you have to create a `device`
    2. then on that `device`'s overview page, click the "Add Components" dropdown and select "Interfaces".
    3. &#x20;Then fill out the information for that `interface`.&#x20;
    4. Finally, when the `interface` is created, scroll to the bottom of the `device`'s overview page and click the green "+" box and add an `ip` there.

It is **much** easier to mass create devices through netbox's API, available at <https://netbox.tjhsst.edu/api>.\
In order to use the API, however, you must first create an API token [here](https://netbox.tjhsst.edu/user/api-tokens/).<br>

Some (messy) scripts that were used to bulk create the `borg` devices and workstations are available at <https://gitlab.tjhsst.edu/sysadmins/docs/netbox-scripts.git>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.tjhsst.edu/technologies/networking/netbox.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
