top-plugin by Kurt Kellner of ECS Team (www.ECSTeam.com)
This is a Cloud Foundry command-line cf interactive plugin for showing live statistics of the targeted Cloud Foundry foundation.
The live statistics include application statistics and route statistics among others.
The primary source of information that the top plugin uses is via monitoring the Cloud Foundry firehose.
The plugin will run in one of two modes, privileged or non-privileged depending on your Cloud Foundry user permission.
If you are a foundation operator you will want to use top in privileged mode. This is done automatically if the
correct permissions are granted to your Cloud Foundry login (or if you are logged in via admin
account). See
Assign Permissions for more information on assigning permissions.
Installation Instructions
![Screenshot](https://github.com/ECSTeam/cloudfoundry-top-plugin/raw/v0.7.9/screenshots/screencast1.gif)
Screenshots
More screenshots here
Usage Documentation
After installation be sure to view the full top
documentation as
well as the Frequently Asked Questions (FAQ) page.
Installation
There are two options for installation; use the plugin repo (recommended) or manual installation.
Install from plugin repository (recommended)
NOTE: This installation method requires that your client computer has access to the internet.
If internet access is not available from client computer use the manual method.
Verify you have a repo named CF-Community
registered in your cf client.
cf list-plugin-repos
If the above command does not show CF-Community
you can add the repo via:
cf add-plugin-repo CF-Community http://plugins.cloudfoundry.org/
Now that we have the cloud foundry community repo registered, install top
:
cf install-plugin -r CF-Community "top"
Manual installation method
- Download the binary file for your target OS from the latest release
- If you've already installed the plugin and are updating, you must first run
cf uninstall-plugin top
- Then install the plugin with
cf install-plugin top-plugin-darwin
(or top-plugin-linux
or top-plugin.exe
)
- If you get a permission error run:
chmod +x top-plugin-darwin
(or top-plugin-linux
) on the binary
- Verify the plugin installed by looking for it with
cf plugins
Upgrade to latest version
To upgrade to the lastest version of top plugin, uninstall plugin and install again.
cf uninstall-plugin top
cf install-plugin -r CF-Community "top" (or use manual install method described above)
Assign permissions if privileged mode is needed
The top
plugin will run without special permissions however it determines at runtime
what permissions you have and displays the appropriate functionality based on those
permissions. If you are a foundation operator you will want the additional functionality
that top provides to privileged users.
If you are logged in with the Cloud Foundry admin
account, no additional permissions
are needed, the admin
account has everything it needs to run top with full functionality.
For non-admin accounts, to run top in privileged mode you need to assign two permissions
to an existing Cloud Foundry user. To assign needed permissions:
Install the uaac client CLI if you do not already have it:
gem install cf-uaac
Login and add two permission. Note that the UAA password is NOT the
"Admin Credentials", the password is found in the ERT under Credentials tab,
look for password for "Admin Client Credentials".
uaac token client get admin -s [UAA Admin Client Credentials]
uaac member add cloud_controller.admin [username]
uaac member add doppler.firehose [username]
Note: The change in permissions does not take effect until user username performs
a logout and login.
Usage
Although top
does not require any special permissions, foundation operators
will want to run top
in privileged mode as described in the
Assign permissions
section above. The plugin does not require arguments. Simply run:
cf top
Options
List top live statistics for CF.
NAME:
top - Displays top stats - by Kurt Kellner of ECS Team
USAGE:
cf top
OPTIONS:
-debug -d, enable debugging
-no-top-check -ntc, do not check if there are other instances of top running
-nozzles -n, specify the number of nozzle instances (default: 2)
-cygwin -c, force run under cygwin (Use this to run: 'cmd /c start cf top -cygwin' )