Bug 619138 - add agent prompt command to force an inventory sync
Summary: add agent prompt command to force an inventory sync
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent
Version: 3.0.0
Hardware: All
OS: All
low
low
Target Milestone: ---
: ---
Assignee: John Mazzitelli
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-28 16:33 UTC by John Mazzitelli
Modified: 2013-09-02 07:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-02 07:24:14 UTC
Embargoed:


Attachments (Terms of Use)

Description John Mazzitelli 2010-07-28 16:33:28 UTC
Sometimes an agent's inventory might go out of sync (usually due to some unforseen bug). If this happens, the only way to correct it would be to restart the agent VM with --cleanconfig or --purgedata option.

It would be nice to have an agent prompt command to have it do this without killing the VM. Even if it was something like the "plugins update" command where that just shuts down the PC, downloads the plugins and restarts the PC without taking down the entire VM.

Something like:

inventory --sync

which would shutdown the PC, delete the inventory.dat file, then restart the PC.

Comment 1 John Mazzitelli 2010-07-28 18:25:04 UTC
did a quick implementation - "inventory --sync" now purges the inventory and restarts the PC so the inventory is synced

master commit: 148c25cc279be5f96923c149fc0530512afdb9a0

Comment 2 Sunil Kondkar 2010-10-26 10:10:42 UTC
Verified on RHQ Build#511

Entered the command inventory --sync at agent prompt.
 

> inventory --sync
The plugin container has been stopped.
Purged the persisted inventory found at [data/inventory.dat], sync will occur when plugin container restarts
The plugin container has been started.

Need to verify documentation for --sync option.

Comment 3 Mike Foley 2011-06-21 20:44:10 UTC
additionally verifying documentation, as follows:

> help
    avail: Get availability of inventoried resources
   config: Manages the agent configuration
    debug: Provides features to help debug the agent.
discovery: Asks a plugin to run a server scan discovery
 download: Downloads a file from the RHQ Server
dumpspool: Shows the entries found in the command spool file
     exit: Shuts down the agent's communications services and kills the agent
 failover: Provides HA failover functionality
       gc: Helps free up memory by invoking the garbage collector
getconfig: Displays one, several or all agent configuration preferences
     help: Shows help for a given command
 identify: Asks to identify a remote server
inventory: Provides information about the current inventory of resources
 listdata: Lists and optionally deletes agent data files. USE WITH CAUTION!
      log: Configures some settings for the log messages
  metrics: Shows the agent metrics
   native: Obtains native system information
       pc: Starts and stops the plugin container and all deployed plugins
     ping: Pings the RHQ Server
     piql: Executes a PIQL query to search for running processes
  plugins: Updates the agent plugins with the latest versions from the server
     quit: Shuts down the agent's communications services and kills the agent
 register: Registers this agent with the RHQ Server
schedules: Retrieves measurement schedule information for the specified resource
   sender: Controls the command sender to start or stop sending commands
setconfig: Sets an agent configuration preference
    setup: Sets up the agent configuration by asking a series of questions
 shutdown: Shuts down all communications services without killing the agent
    sleep: Puts the agent prompt to sleep for a given amount of seconds.
    start: Starts the agent comm services so it can accept remote requests
    timer: Times how long it takes to execute another prompt command
   update: Provides agent update functionality
  version: Shows information on agent version and agent environment

> inventory -?
inventory: invalid option -- ?
Syntax: inventory [--sync] [--xml] [--export=<file>] [--norecurse]
                  [--id=<#>] | --types | <inventory-binary-file>]
>

Comment 4 Heiko W. Rupp 2013-09-02 07:24:14 UTC
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.


Note You need to log in before you can comment on or make changes to this bug.