Skip to content

Commit

Permalink
Added cmd ism_show_profiles contributed by Gerald Rausch
Browse files Browse the repository at this point in the history
  • Loading branch information
HMBJOrth committed Mar 29, 2023
1 parent 872b79d commit 6e9b122
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:author: Jürgen Orth
:email: Juergen.Orth@Fujitsu.com
:version: v1.0.9
:version: v1.0.10

:imagesdir: img/
:toc: preamble
Expand Down Expand Up @@ -33,6 +33,7 @@ IMPORTANT: *#Please note: This toolset is provided W/O ANY WARRANTY and is to be
[cols="5%,10%,65%,20%"]
|=================
|Version|Date|Description|Author
|1.0.10|2023-03-27|+ `ism_show_profiles`: Added command to list all available deployment profiles in ISM. (thanks to mailto:Gerald.Rausch@Fujitsu.com[Gerald Rausch])|mailto:{email}[{Author}]
|1.0.9|2023-03-08|+ `ism_get_snap`: Snapfile will be deleted on ISM-VA after it has been downloaded.|mailto:{email}[{Author}]
|1.0.8|2023-03-03|+ Added missing command in commandlist of README|mailto:{email}[{Author}]
|1.0.7|2023-02-28|
Expand Down Expand Up @@ -186,6 +187,9 @@ Sets power thresholds for all/given nodes.
* <<ism_show_racks>> +
Display an overview of racks with _RackId_ and _RackName_.

* <<ism_show_profiles>> +
List all available deployment profiles in ISM.

* <<ism_show_isos>> +
Display imported ISO files.

Expand Down Expand Up @@ -844,6 +848,36 @@ RackId RackName
14 R1
----
[[ism_show_profiles]]
==== `ism_show_profiles`
List all available deployment profiles in ISM.
TIP: To avoid line wrapping you can pipe output to `less -S`.
[source,shell,indent=8]
----
$ism_show_profiles

ID Profile Node NodeIP-iRMC Status Category
=== ================================================== ================== =============== ========== ====================
19 TX2550m5-9-25_PXE_ESXi_7U3 TX2550M5-9-25 192.xxx.x.xx assigned Server-TX
16 RX2520m4-7-33_PXE_ESXi_7U3 RX2520M4-7-33 192.xxx.x.xx error Server-RX
2 RX2540M2-9-6-wind2019 RX2540M2-9-6 192.xxx.x.xx error Server-RX
17 TX2550m5-9-25_PXE_SLES_15-4 --- --- unassigned Server-TX
9 TX2550m5-9-25_PXE__use_existing --- --- unassigned Server-TX
14 RX2520m4-7-33_PXE_SLES_15-4 --- --- unassigned Server-RX
13 snmptrapdest --- --- unassigned Server-RX
12 RX2520m4-7-33_elcm__RAID0_win2019 --- --- unassigned Server-RX
11 RX2520m4-7-33_PXE__use_existing_SATA --- --- unassigned Server-RX
10 RX2520m4-7-33_PXE__use_existing_raid_copy --- --- unassigned Server-RX
8 RX2520m4-7-33_PXE__use_existing_raid --- --- unassigned Server-RX
7 RX2520m4-7-33_PXE_Sata_R1 --- --- unassigned Server-RX
6 RX2520m4-7-33_elcm_copy --- --- unassigned Server-RX
5 RX2520m4-7-33_elcm --- --- unassigned Server-RX
4 RX2520m4-7-33 --- --- unassigned Server-RX
3 RX2520M4-7-33-wind2019_copy --- --- unassigned Server-RX
----
[[ism_show_isos]]
==== `ism_show_isos`
Shows the ISO files that have been uploaded to ISM VA.
Expand Down
Binary file removed doc/ISMtools v1.0.9.pdf
Binary file not shown.
Binary file added doc/README.pdf
Binary file not shown.
30 changes: 30 additions & 0 deletions scripts/ism_show_profiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# (c) Gerald Rausch ;-)
# $Id: ism_show_profiles 178 2023-03-29 10:19:43Z HMBJOrth $
# for documentation see https://github.com/fujitsu/ISMtools

. ${0%/*}/.ism_env

CheckJQ

FMTHEAD="%3s+%-50s+%-18s+%-15s+%10s+%-20s\n"
FMTLINE="%3d %-50s %-18s %-15s %10s %-20s\n"

# Prefetch nodename and nodeip in array
while read id nodename ipaddr
do
profile_nodes[$id]="$nodename"
profile_ips[$id]="$ipaddr"
done < <( ism_cmd get /nodes | jq -j '.IsmBody.Nodes[]|.NodeId," ",.Name," ",.IpAddress,"\n"')

# table header
printf "$FMTHEAD" ID Profile Node NodeIP\-iRMC Status Category | tr '+' ' '
printf "$FMTHEAD" " " | tr ' +' '= '

# print results
while read id profile nodeid category status
do
printf "$FMTLINE" "$id" "$profile" "${profile_nodes[$nodeid]:----}" "${profile_ips[$nodeid]:----}" "$status" "${category:0:20}"
done < <(ism_cmd get "/profiles/profiles" | \
jq -j '.IsmBody.ProfileList[]|.ProfileId," ",.ProfileName," ",.AssignedNodeId," ",.CategoryName," ",.Status,"\n"') |\
sort +4 -6 -r

0 comments on commit 6e9b122

Please sign in to comment.