dell / OpenManage-Enterprise

Script collateral leveraging the OME/OME-M REST APIs
Apache License 2.0
95 stars 49 forks source link

Need a script to initiate Configuration Inventory #58

Closed markatdxb closed 3 years ago

markatdxb commented 4 years ago

Hello, im looking for a script which would kick off collection of Configuration data from single or multiple iDRACs Currently as far as im aware there is only schedule job in OME which performs the collection on daily basis, but as for our automation approach i would like the ability to start the process via REST or script for single iDRAC thx

grantcurell commented 3 years ago

I'd be willing to take a look at it. I'm not sure what is meant by configuration data though - do you have a screenshot or something?

markatdxb commented 3 years ago

Hi, pls see attached. Our plan is to fully automated the new iDrac configuration process.

Our current process:

Let me know if you would need any more details

image

grantcurell commented 3 years ago

@markatdxb - I haven't used that functionality before. I'll take a look and report back here!

grantcurell commented 3 years ago

@markatdxb - Just wanted to give you a heads up I think I have a working solution. Took me a bit because it required an undocumented API call and had to study up on how the configuration inventory specifically worked. I'll PR it here tomorrow.

grantcurell commented 3 years ago

Request completed in that PR in Python.

grantcurell commented 3 years ago

Resolved with https://github.com/dell/OpenManage-Enterprise/pull/70. PowerShell parity requirement ticket is here https://github.com/dell/OpenManage-Enterprise/issues/45

grantcurell commented 3 years ago

@markatdxb - did this do what you were looking for?

markatdxb commented 3 years ago

@grantcurell Sorry i cant find your script refresh_device_inventory in repo

RaajeevKalyan commented 3 years ago

I think it was renamed -https://github.com/dell/OpenManage-Enterprise/blob/master/Core/Python/invoke_refresh_inventory.py

grantcurell commented 3 years ago

Sorry about that - I updated the names so PowerShell and Python matched. The scripts are also now listed here

markatdxb commented 3 years ago

@grantcurell - just tested the script. i specified single idrac IP but log shows inventory refresh runs on all devices

grantcurell commented 3 years ago

@markatdxb huh - I just hopped in bed. I'll give it a go tomorrow and see what's up.

RaajeevKalyan commented 3 years ago

Possible I am missing something, but on a quick skim, It looks like your default is to not skip the config inventory - if no group name is specified I think after refreshing the inventory the script will go through and default to running config inventory on the All Devices Group -

@markatdxb - could you retry setting the -skip flag to true?

markatdxb commented 3 years ago

just tested to add --skip-config-inventory - didnt work - it ran but didnt pull configuration data

grantcurell commented 3 years ago

@markatdxb on the way back home from a morning meeting now - I'll take a look. Just to clarify though, if you skip config inventory the tab under devices does not update

Only the firmware versions and stuff

grantcurell commented 3 years ago

@markatdxb - at first I thought there was a problem, but then I remembered the config inventory operates on the configuration group. See help text:

    parser.add_argument("--groupname", "-g", required=False, default="All Devices",
                        help="The name of the group containing the devices whose inventory you want to refresh. "
                             "Defaults to all devices. Due to the way the API functions, if you want to refresh the "
                             "configuration inventory, you must have all applicable devices in a group. The "
                             "configuration inventory is specific to the tab called \"Configuration Inventory\" under "
                             "a device's view. You can use the create_static_group and add_device_to_static group "
markatdxb commented 3 years ago

@grantcurell - if I understand above correctly I need to put device to some temp group first, run the script and remove device from the group?

grantcurell commented 3 years ago

@markatdxb unfortunately yes. That's for the configuration inventory only (the tab as shown below)

image

for just refreshing the firmware list and all that you don't need the group. The config inventory is the same as this button:

image

The regular inventory is the same as pressing this button:

image

I actually didn't know there was a distinction until I wrote this code 😂

grantcurell commented 3 years ago

I just added a warning that will give people a heads up.