mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Switch to magellan collect pdu
This commit is contained in:
parent
ad500d086d
commit
4971f62dba
1 changed files with 7 additions and 7 deletions
|
|
@ -26,7 +26,7 @@ func transformToSMDFormat(inventory *pdu.PDUInventory) []map[string]any {
|
||||||
numberPart = outlet.ID[splitIndex:]
|
numberPart = outlet.ID[splitIndex:]
|
||||||
|
|
||||||
var pValue int
|
var pValue int
|
||||||
if len(letterPart) > 1 {
|
if len(letterPart) > 0 {
|
||||||
pValue = int(unicode.ToUpper(rune(letterPart[0])) - 'A')
|
pValue = int(unicode.ToUpper(rune(letterPart[0])) - 'A')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,8 +57,8 @@ func transformToSMDFormat(inventory *pdu.PDUInventory) []map[string]any {
|
||||||
return []map[string]any{pduRecord}
|
return []map[string]any{pduRecord}
|
||||||
}
|
}
|
||||||
|
|
||||||
var pduCollectCmd = &cobra.Command{
|
var pduCmd = &cobra.Command{
|
||||||
Use: "collect [hosts...]",
|
Use: "pdu [hosts...]",
|
||||||
Short: "Collect inventory from JAWS-based PDUs",
|
Short: "Collect inventory from JAWS-based PDUs",
|
||||||
Long: `Connects to one or more PDUs with a JAWS interface to collect hardware inventory.`,
|
Long: `Connects to one or more PDUs with a JAWS interface to collect hardware inventory.`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
@ -103,8 +103,8 @@ var pduCollectCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
PduCmd.AddCommand(pduCollectCmd)
|
pduCmd.Flags().StringVarP(&username, "username", "u", "", "Set the PDU username")
|
||||||
|
pduCmd.Flags().StringVarP(&password, "password", "p", "", "Set the PDU password")
|
||||||
|
|
||||||
pduCollectCmd.Flags().StringVarP(&username, "username", "u", "", "Set the PDU username")
|
CollectCmd.AddCommand(pduCmd)
|
||||||
pduCollectCmd.Flags().StringVarP(&password, "password", "p", "", "Set the PDU password")
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue