Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New template for Linux: dmidecode -t system #1998

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ juniper_junos_show_vlans.textfsm, .*, juniper_junos, sh[[ow]] vl[[ans]]

juniper_screenos_get_route.textfsm, .*, juniper_screenos, get route

linux_dmidecode_-t_system.textfsm, .*, linux, dmidecode -t system
linux_ip_address_show.textfsm, .*, linux, ip a[[ddress]] [[show]]
linux_ip_route_show.textfsm, .*, linux, ip r[[oute]] [[show]]
linux_ip_link_show.textfsm, .*, linux, ip l[[ink]] [[show]]
Expand Down
78 changes: 78 additions & 0 deletions ntc_templates/templates/linux_dmidecode_-t_system.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Value SYSTEM_MANUFACTURER (\S+|\S.+\S)
Value SYSTEM_PRODUCT_NAME (\S+|\S.+\S)
Value SYSTEM_SERIAL_NUMBER (|S+|\S.+\S)
Value SYSTEM_UUID (\S+|\S.+\S)

Start
^\s*\#\s*dmidecode\s*\S+\s*$$
^\s*\#\s*SMBIOS\s*entry\s*point\s*at\s*\S+\s*$$
^\s*Getting\s*SMBIOS\s*data\s*from\s*sysfs\.\s*$$
^\s*SMBIOS\s*\d+\.\d+(?:.\d+)?\s*present\.\s*$$
^\s*\#\s*SMBIOS\s*implementations\s*newer\s*than\s*version\s*\d+\.\d+\s*are\s*not\s*$$
^\s*\#\s*fully\s*supported\s*by\s*this\s*version\s*of\s*dmidecode\.\s*$$
^\s*$$
^\s*Handle\s*\S+,\s*DMI\s*type\s*\d+,\s*\d+\s*bytes$$ -> decisor
^. -> Error

decisor
^\s*System\s*Configuration\s*Options\s*$$ -> system_configurations
^\s*System\s*Boot\s*Information\s*$$ -> system_boot_information
^\s*System\s*Information\s*$$ -> system
^\s*System\s*Event\s*Log\s*$$ -> system_event_log
^\s*System\s*Reset\s*$$ -> system_reset
^. -> Error

system
^\s*Manufacturer:\s+${SYSTEM_MANUFACTURER}\s*$$
^\s*Product\s*Name:\s+${SYSTEM_PRODUCT_NAME}\s*$$
^\s*Version:\s*(?:\S.+\S\s*)?$$
^\s*Serial\s*Number:\s+${SYSTEM_SERIAL_NUMBER}\s*$$
^\s*UUID:\s+${SYSTEM_UUID}\s*$$
^\s*Wake-up\s*Type:\s+\S.+\S\s*$$
^\s*SKU\s*Number:\s+\S.+\S\s*$$
^\s*Family:\s+\S.+\S\s*$$
^\s*$$
^\s*Handle\s*\S+,\s*DMI\s*type\s*\d+,\s*\d+\s*bytes$$ -> decisor
^. -> Error

system_configurations
^\s*Option\s+\d+:\s+\S.+\S\s*$$
^\s*$$
^\s*Handle\s*\S+,\s*DMI\s*type\s*\d+,\s*\d+\s*bytes$$ -> decisor
^. -> Error

system_boot_information
^\s*System\s*Boot\s*Information\s*$$
^\s*Status:\s+\S.+\S\s*$$ -> Record
^\s*Handle\s*\S+,\s*DMI\s*type\s*\d+,\s*\d+\s*bytes$$ -> decisor
^. -> Error

system_event_log
^\s*Area\s*Length:\s+\d+\s*bytes\s*$$
^\s*Header\s*Start\s*Offset:\s+\S.+\S\s*$$
^\s*Header\s*Length:\s+\d+\s*bytes\s*$$
^\s*Data\s*Start\s*Offset:\s+\S.+\S\s*$$
^\s*Access\s*Method:\s+\S.+\S\s*$$
^\s*Access\s*Address:\s+\S.+\S\s*$$
^\s*Status:\s+\S.+\S\s*$$
^\s*Change\s*Token:\s+\S.+\S\s*$$
^\s*Header\s*Format:\s+\S.+\S\s*$$
^\s*Supported\s*Log\s*Type\s*Descriptors:\s+\d+\s*$$
^\s*Descriptor\s+\d+:\s+\S.+\S\s*$$
^\s*Data\s*Format\s+\d+:\s+\S.+\S\s*$$
^\s*$$
^\s*Handle\s*\S+,\s*DMI\s*type\s*\d+,\s*\d+\s*bytes$$ -> decisor
^. -> Error

system_reset
^\s*Status:\s+\S.+\S\s*$$
^\s*Watchdog\s*Timer:\s+\S.+\S\s*$$
^\s*Boot\s*Option:\s+\S.+\S\s*$$
^\s*Boot\s*Option\s*On\s*Limit:\s+\S.+\S\s*$$
^\s*Reset\s*Count:\s+\S.+\S\s*$$
^\s*Reset\s*Limit:\s+\S.+\S\s*$$
^\s*Timer\s*Interval:\s+\S.+\S\s*$$
^\s*Timeout:\s+\S.+\S\s*$$
^\s*$$
^\s*Handle\s*\S+,\s*DMI\s*type\s*\d+,\s*\d+\s*bytes$$ -> decisor
^. -> Error
51 changes: 51 additions & 0 deletions tests/linux/dmidecode_-t_system/linux_dmidecode_-t_system.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# dmidecode 1.11
SMBIOS 1.1 present.

Handle 0x0001, DMI type 1, 11 bytes
System Information
Manufacturer: HP
Product Name: ProG4 Deepseek G6
Version:
Serial Number: AA111100AA
UUID: 1111AA1A-AA1A-11A1-1AAA-A1111AAAA1AA
Wake-up Type: Power Switch
SKU Number: 000000-000
Family: Not Specified

Handle 0x0011, DMI type 12, 1 bytes
System Configuration Options
Option 1: Jumper settings can be described here.

Handle 0x0011, DMI type 11, 11 bytes
System Event Log
Area Length: 32 bytes
Header Start Offset: 0x0000
Header Length: 32 bytes
Data Start Offset: 0x0010
Access Method: General-purpose non-volatile data functions
Access Address: 0x0000
Status: Valid, Not Full
Change Token: 0x0000001D
Header Format: Type 1
Supported Log Type Descriptors: 3
Descriptor 1: POST error
Data Format 1: POST results bitmap
Descriptor 2: Single-bit ECC memory error
Data Format 2: Multiple-event
Descriptor 3: Multi-bit ECC memory error
Data Format 3: Multiple-event

Handle 0x001A, DMI type 23, 13 bytes
System Reset
Status: Enabled
Watchdog Timer: Present
Boot Option: Do Not Reboot
Boot Option On Limit: Do Not Reboot
Reset Count: Unknown
Reset Limit: Unknown
Timer Interval: Unknown
Timeout: Unknown

Handle 0x001A, DMI type 32, 20 bytes
System Boot Information
Status: No errors detected
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
parsed_sample:
- system_manufacturer: "HP"
system_product_name: "ProG4 Deepseek G6"
system_serial_number: "AA111100AA"
system_uuid: "1111AA1A-AA1A-11A1-1AAA-A1111AAAA1AA"