
|
If you were logged in you would be able to see more operations.
|
|
|
Hyperic HQ
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
|
|
|
|
This issue Is related to:
|
|
HHQ-2318
Allow auto-discovered server resource properties to be overridden via agent.properties
|
|
|
|
|
|
|
|
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.
|
|
Description
|
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. |
Show » |
|
HHQ-1649andHHQ-2318currently serve as workarounds.