cancel
Showing results for 
Search instead for 
Did you mean: 

Find all blade serial numbers with REST call

TimRiker
Cirrostratus
Cirrostratus

How to I discover the serial numbers for all blades in a VIPRION chassis over REST? The data in /mgmt/tm/sys/hardware and /mgmt/tm/sys/license seems to only include the primary blade. We'd like to run a report to insure we have support coverage on all blades and chassis.

2 REPLIES 2

suttonsc
F5 Employee
F5 Employee

I don't believe there is a specific endpoint that will list the entire set of serial numbers. However, you can get the serial numbers from the slots using a 'util/bash' endpoint and sending a clsh command.

 

 

Here is an example of getting the blade serial numbers:

# curl -sku admin:${bigip_pass} https://${BIGIP-MGMT-ADDR}/mgmt/tm/util/bash -X POST -H "Content-Type: application/json" -d "{ \"command\":\"run\", \"utilCmdArgs\":\"-c 'clsh tmsh show sys hardware field-fmt \| awk \\\'/\^sys hardware system-info/,/\^}/ {if(\$1==\\\"host-board-serial-num\\\") print $2}\\\''\"}" | jq .commandResult | xargs echo -e host-board-serial-num bld012429s host-board-serial-num bld012451s

 

The core command is "utilCmdArgs": "-c 'clsh tmsh show sys hardware field-fmt" the rest just gets the specific serial information and dumps it in a more readable format.

 

Let me know if this gets you closer to what you are looking for.

TimRiker
Cirrostratus
Cirrostratus

I'll test this out. This requires that the account has advanced shell access, correct?

 

I only get one "host-board-serial-num" entry for the current blade. 😞