Bug 619138

Summary: add agent prompt command to force an inventory sync
Product: [Other] RHQ Project Reporter: John Mazzitelli <mazz>
Component: AgentAssignee: John Mazzitelli <mazz>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: low    
Version: 3.0.0CC: skondkar
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-02 03:24:14 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description John Mazzitelli 2010-07-28 12:33:28 EDT
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 14:25:04 EDT
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 06:10:42 EDT
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 16:44:10 EDT
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 03:24:14 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.