diff --git a/README.md b/README.md index 583b39d..7c224db 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,16 @@ Feel free to send me a dmidecode output for Supermicro's blade! * SSG-6028R * SYS-6018R +## QCT + +### Blades + +* QuantaMicro X10E-9N + +### Pizzas + +* Nothing ATM, feel free to send me a dmidecode or make a PR! + # TODO - [ ] CPU, RAID Card(s), RAM, Disks in `Device`'s `Inventory` diff --git a/netbox_agent/cli.py b/netbox_agent/cli.py index 6d2fc80..8ef6f56 100644 --- a/netbox_agent/cli.py +++ b/netbox_agent/cli.py @@ -3,6 +3,7 @@ import argparse from netbox_agent.vendors.dell import DellHost import netbox_agent.dmidecode as dmidecode from netbox_agent.vendors.hp import HPHost +from netbox_agent.vendors.qct import QCTHost from netbox_agent.vendors.supermicro import SupermicroHost from netbox_agent.logging import logging # NOQA @@ -11,6 +12,7 @@ MANUFACTURERS = { 'HP': HPHost, 'HPE': HPHost, 'Supermicro': SupermicroHost, + 'Quanta Cloud Technology Inc.': QCTHost, } diff --git a/netbox_agent/vendors/qct.py b/netbox_agent/vendors/qct.py new file mode 100644 index 0000000..322fa37 --- /dev/null +++ b/netbox_agent/vendors/qct.py @@ -0,0 +1,28 @@ +from netbox_agent.server import ServerBase + + +class QCTHost(ServerBase): + def is_blade(self): + return 'Location In Chassis' in self.dmi.get_by_type('Baseboard')[0].keys() + + def get_blade_slot(self): + if self.is_blade(): + return 'Slot {}'.format( + self.dmi.get_by_type('Baseboard')[0].get('Location In Chassis') + ) + 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()