History | Log In     View a printable version of the current page.  
HQ 4.0 EE Release is Now Available | HQ 3.2.5-EE Maintenance Release is Now Available
Issue Details (XML | Word | Printable)

Key: HHQ-2320
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Doug MacEachern
Reporter: Doug MacEachern
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hyperic HQ

DaemonDetector may report incorrect installpath

Created: 22/Aug/08 05:47 PM   Updated: 09/Sep/08 10:47 PM
Component/s: Plugins
Affects Version/s: None
Fix Version/s: 4.0.0, 3.2.6

Issue Links:
Depends
 

Verify By: Kashyap Parikh
Last comment: 10 weeks, 2 days ago


 Description  « Hide
The DaemonDetector, used by certain plugins such as memcached, uses ServerDetector.getProcExe to get the installpath. This method will try the following:

1) Sigar.getProcExe().getName() - /proc/$pid/exe on linux, which can only be read if the agent is running as the same user or as root

2) Sigar.getProcArgs()[0] - aka argv0 - /proc/$pid/cmdline on linux which any user can read.
The first argument might not be the full path depending if the process is started with a relative path such as:
 ./executable
Rather than the absolute path, such as:
 /full/path/to/executable

3) Sigar.getProcModules()[0] - /proc/$pid/maps on linux, same perms as /proc/$pid/exe

---

In the case where getProcExe returns a relative path, it gets treated as relative to the agent's current working directory because ServerDetector calls:
server.setInstallPath(getCanonicalPath(installpath))
Where getCanonicalPath() calls new File(installpath).getCanonicalPath() and getCanonicalPath() calls getAbsolutePath().

Certain plugins using DaemonDetector will derive the installpath from app specific command-line arguments, so this is not an issue for all server types. But for those impacted, where the installpath also serves as the inventory identifier, this results in duplicate resources when the agent is upgraded changing the installpath.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Doug MacEachern - 22/Aug/08 05:48 PM
HHQ-1649 and HHQ-2318 currently serve as workarounds.

Doug MacEachern - 08/Sep/08 09:14 PM
ServerDetector will not call getCanonicalPath on relative installpaths to avoid being made absolute to the agent's current working directory.

Kashyap Parikh - 09/Sep/08 10:47 PM
Verified in 4.0.0 # 849 using memcached server.
Started it as: ./memcached -d -m 50 -l 10.0.0.5 -p 22233 -u spider -DINVENTORY_ID=QA1:22233
Auto discovered it and verified that the install path looks like /usr/local/bin/memcached