netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.03k stars 2.57k forks source link

Add IPMI to device with link #8864

Closed unrelatedinfo closed 2 years ago

unrelatedinfo commented 2 years ago

NetBox version

v.3.1.9

Feature type

New functionality

Proposed functionality

Adding an IPMI field that is shown on the main view of the device with a clickable link.

Use case

Will further reduce time when looking for iDRAC/iLO/IPMI and quickly allow you to establish connections.

Database changes

No response

External dependencies

No response

jcralbino commented 2 years ago

Currently i am doing this by using service option. You have the following steps here:

  1. Add the ip address being used by IPMI in the correct interface of the device
  2. Add a service association on that ip to the correct port ( name the service template IPMI)
  3. You can create a custom link leveraging the service template of the device that would allow you to establish connection from a url.
jeremystretch commented 2 years ago

As @jcralbino points out, you can use a custom link and/or a service to accomplish this. Please open a discussion if you'd like further assistance.

martinum4 commented 2 years ago

Here, for a custom link, you only have to filter according to manufacturer and interface names:

{{obj.interfaces.get(name="iLO").ip_addresses.first().address.ip}}

jeremystretch commented 2 years ago

You could also filter on the mgmt_only flag on the interface model.

martinum4 commented 2 years ago

I could filter for Management, yes, but depending on the usecase (e.g. virtualization) some (like myself) might consider the OS management too and have added virtual interfaces for that, this way we only actually filter for the hardware-interfaces based on the names.

Anyway, i decided to finish the custom link, it might not be pretty but it is working:

{% if obj.device_type.manufacturer.name == 'Dell' %}http://{{obj.interfaces.get(name="iDRAC").ip_addresses.first().address.ip}} {% elif obj.device_type.manufacturer.name == 'HP' %}http://{{obj.interfaces.get(name="iLO").ip_addresses.first().address.ip}} {%else%}{% endif %}

unrelatedinfo commented 2 years ago

Thanks for all the replies here. However to me this would be a feature that doesnt need to be worked around as 90% of the devices that will be added to netbox will have IPMI or some form of management console tied to it, and today it seems that its mostly based around WebUI's.

jcralbino commented 2 years ago

One option could be to improve the existing service mapping to create the custom link

The workflow would be something like

  1. Associate an IP address to the device interface
  2. Create a service mapping to this ip detailing the port and name of service
  3. Select a flag ( during creation of service mapping ) to create a custom link based on the service created

The issue now is that point 3 needs to be done manually. But i believe it could be a valid feature to have an option when creating the service mapping to create also a custom link for this service