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

Serial number and product name #59

Open
fre4ki opened this issue Feb 21, 2022 · 15 comments
Open

Serial number and product name #59

fre4ki opened this issue Feb 21, 2022 · 15 comments

Comments

@fre4ki
Copy link

fre4ki commented Feb 21, 2022

Hey Alexis,

i found another useful option for Get-ArubaCXSystem.

The device serial number and product name (from the "show system" output).

Maybe for the next release?

Andy

@fre4ki fre4ki changed the title Serial number Serial number and product name Feb 21, 2022
@alagoutte
Copy link
Contributor

alagoutte commented Feb 22, 2022

Hi Andy,

For product_name, it is the model ?

you can look on

Invoke-ArubaCXRestMethod "system/subsystems"
chassis,1                                line_card,1/1                                  management_module,1/1
---------                                -------------                                  ---------------------
/rest/v10.09/system/subsystems/chassis,1 /rest/v10.09/system/subsystems/line_card,1%2F1 /rest/v10.09/system/subsystems/management_module,1%2F1

Invoke-ArubaCXRestMethod "system/subsystems/chassis,1"
    
acl_init_status                      : none
admin_state                          : up
asic_info                            : 
buttons                              : /rest/v10.09/system/subsystems/chassis,1/buttons
capabilities                         : {poe_plus_power}
capacities                           : 
daemons                              : /rest/v10.09/system/subsystems/chassis,1/daemons
data_plane_connectivity_state        : 
data_plane_connectivity_target_state : 
data_plane_error                     : 
data_plane_state                     : 
data_plane_target_state              : 
data_planes                          : /rest/v10.09/system/subsystems/chassis,1/data_planes
diag_test_results                    : /rest/v10.09/system/subsystems/chassis,1/diag_test_results
diagnostic_disable                   : False
diagnostic_last_run_timestamp        : 0
diagnostic_performed                 : 0
diagnostic_requested                 : 0
entity_state                         : 
fan_configuration_state              : 
fans                                 : /rest/v10.09/system/subsystems/chassis,1/fans
interfaces                           : 
leds                                 : /rest/v10.09/system/subsystems/chassis,1/leds
macs_remaining                       : 0
name                                 : 1
next_mac_address                     : 00:00:00:00:00:00
pac_gbp_init_status                  : none
part_number_cfg                      : 
poe_persistency_disable              : False
poe_power                            : 
policy_init_status                   : none
power_consumed                       : 
power_supplies                       : /rest/v10.09/system/subsystems/chassis,1/power_supplies
product_info                         : @{base_mac_address=08:00:09:0d:2d:06; device_version=0; instance=1; number_of_macs=74; part_number=ABC123; product_description=ArubaOS-CX_OVA; product_name=ArubaOS-CX_OVA; 
                                       serial_number=OVA0D2D06; vendor=Aruba}
psu_redundancy_oper                  : none
psu_redundancy_set                   : none
quick_poe                            : False
reboot_statistics                    : @{configuration=0; error=0; hotswap=0; isp=0; thermal=0; user=0}
resets_performed                     : 
resets_requested                     : 
resource_capacity                    : 
resource_reservation_per_feature     : 
resource_unreserved                  : 
resource_utilization                 : 
resource_utilization_per_feature     : 
resource_width_per_feature           : 
selftest                             : @{status=pending}
selftest_disable                     : False
software_images                      : 
state                                : ready
storage                              : 
temp_sensors                         : /rest/v10.09/system/subsystems/chassis,1/temp_sensors
thermal_state                        : 
type                                 : chassis
usb_status                           : empty

@fre4ki
Copy link
Author

fre4ki commented Feb 22, 2022

I get an error:
Error details: 404 Not Found
Unable to use ArubaCX API

It is useful to have a field with serial number and product type:

image

The data can be used for exporting in an csv-file in the rolling-out stage (documentation).

@alagoutte
Copy link
Contributor

What do you have with the first cmdlet ?

@fre4ki
Copy link
Author

fre4ki commented Feb 22, 2022

image

@alagoutte
Copy link
Contributor

can you try without the first "/"

Invoke-ArubaCXRestMethod "system/subsystems"

@fre4ki
Copy link
Author

fre4ki commented Feb 22, 2022

I get an output but no useful information

image

@alagoutte
Copy link
Contributor

you need to add info

Invoke-ArubaCXRestMethod "system/subsystems/chassis,1" ...

@fre4ki
Copy link
Author

fre4ki commented Feb 22, 2022

ok, i get now a field "product_info" which contains all informations but now i have to filter it out.

@alagoutte
Copy link
Contributor

It is good ?

I will look for add a Get-ArubaCXSubSystem

@fre4ki
Copy link
Author

fre4ki commented Feb 23, 2022

i'm new with powershell and i searched yesterday a solution for that.

1 way was to working with substring() in part_number and product_description but as the serial_number has a different start-point it is not ideal and difficult to export this way.

the best way would be:
searching for text serial_number= and extract all data after = to ;

Maybe you have a way?

@alagoutte
Copy link
Contributor

Hi

it is an array you can use .product_info.serial_number for example

@fre4ki
Copy link
Author

fre4ki commented Feb 23, 2022

I'm sorry but can you give me an example?

@alagoutte
Copy link
Contributor

can you try

(Invoke-ArubaCXRestMethod "system/subsystems/chassis,1").product_info

@fre4ki
Copy link
Author

fre4ki commented Feb 23, 2022

Amazing!

(Invoke-ArubaCXRestMethod "system/subsystems/chassis,1").product_info.part_number

(Invoke-ArubaCXRestMethod "system/subsystems/chassis,1").product_info.serial_number

(Invoke-ArubaCXRestMethod "system/subsystems/chassis,1").product_info.product_description

give me all necessary information.

@fre4ki fre4ki closed this as completed Feb 23, 2022
@fre4ki
Copy link
Author

fre4ki commented Feb 23, 2022

You are great! :-)

@alagoutte alagoutte reopened this Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants