Add Supermicro as a vendor (#44)
This commit is contained in:
parent
8de682f46d
commit
0e8b470062
7 changed files with 42 additions and 5 deletions
16
README.md
16
README.md
|
@ -85,7 +85,7 @@ Tested on:
|
|||
|
||||
* DSS7500
|
||||
|
||||
## HP
|
||||
## HP / HPE
|
||||
|
||||
### Blades
|
||||
|
||||
|
@ -97,10 +97,20 @@ Tested on:
|
|||
### Pizzas
|
||||
|
||||
* ProLiant DL380p Gen8
|
||||
* ProLiant SL4540 Gen8
|
||||
* ProLiant SL4540 Gen9
|
||||
* ProLiant XL450 Gen10
|
||||
|
||||
## HPE
|
||||
## Supermicro
|
||||
|
||||
* HPE ProLiant XL450 Gen10
|
||||
### Blades
|
||||
|
||||
Feel free to send me a dmidecode output for Supermicro's blade!
|
||||
|
||||
### Pizzas
|
||||
|
||||
* SSG-6028R
|
||||
* SYS-6018R
|
||||
|
||||
# TODO
|
||||
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
import argparse
|
||||
|
||||
from netbox_agent.dell.dell import DellHost
|
||||
from netbox_agent.vendors.dell import DellHost
|
||||
import netbox_agent.dmidecode as dmidecode
|
||||
from netbox_agent.hp.hp import HPHost
|
||||
from netbox_agent.vendors.hp import HPHost
|
||||
from netbox_agent.vendors.supermicro import SupermicroHost
|
||||
from netbox_agent.logging import logging # NOQA
|
||||
|
||||
MANUFACTURERS = {
|
||||
'Dell Inc.': DellHost,
|
||||
'HP': HPHost,
|
||||
'HPE': HPHost,
|
||||
'Supermicro': SupermicroHost,
|
||||
}
|
||||
|
||||
|
||||
|
|
25
netbox_agent/vendors/supermicro.py
vendored
Normal file
25
netbox_agent/vendors/supermicro.py
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
from netbox_agent.server import ServerBase
|
||||
|
||||
|
||||
class SupermicroHost(ServerBase):
|
||||
def is_blade(self):
|
||||
return self.get_product_name().startswith('SBI')
|
||||
|
||||
def get_blade_slot(self):
|
||||
# No supermicro on hands
|
||||
return None
|
||||
|
||||
def get_chassis_name(self):
|
||||
if not self.is_blade():
|
||||
return None
|
||||
return 'Chassis {}'.format(self.get_service_tag())
|
||||
|
||||
def get_chassis(self):
|
||||
if self.is_blade():
|
||||
return self.dmi.get_by_type('Chassis')[0]['Version']
|
||||
return self.get_product_name()
|
||||
|
||||
def get_chassis_service_tag(self):
|
||||
if self.is_blade():
|
||||
return self.dmi.get_by_type('Chassis')[0]['Serial Number']
|
||||
return self.get_service_tag()
|
Loading…
Reference in a new issue