Cloud Foundry CF cli plugin - show top stats
Branch: master
Clone or download
Latest commit a4b6991 Feb 5, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Add x of y on status message. Also changed page size to 100 from defa… Jan 31, 2018
docs Updated docs on UTF8 usage Jan 12, 2017
eventdata Do not allow reload cache if we are in the middle of loading cache Jan 31, 2018
eventrouting Event Rate History updates and fix Page Down issue on list widget Jan 14, 2017
metadata Fixed for multi-thread map concurent update issue in metadata. Fix ab… Feb 5, 2018
screenshots Updated documentation Aug 1, 2017
scripts Build version v0.9.0 Jan 24, 2018
testhelpers Fixing some imports to allow for test compilation Jan 3, 2017
top Handle non-privileged better by correctly colorizing apps in list Apr 23, 2017
toplog Monitor staging events to reload metadata when staging is complete Aug 5, 2017
ui Remove some debug log lines Feb 5, 2018
util Show app name with parentheses for deleted and brackets for not yet s… Jan 23, 2018
.gitignore Changed CPU% size in header from 6 to 6 and changed stdout/stderr in … Feb 3, 2017
LICENSE Update LICENSE Dec 7, 2016
README.md Added 'now part of CGI' to plugin info Aug 1, 2017
cSpell.json Added event rate history Jan 14, 2017
compile.sh
diego_cell.txt Added target info on header Oct 27, 2016
glide.lock Added glide package manager files Jan 5, 2017
glide.yaml Added glide package manager files Jan 5, 2017
main.go Build version v0.9.3 Feb 5, 2018
main_test.go
repo-index.yml Fixed filename Jan 25, 2018
run.sh added routeStats structs to track routing requests. WIP Dec 22, 2016
top_plugin_suite_test.go Fixing some imports to allow for test compilation Jan 3, 2017
top_plugin_test.go Fixing some imports to allow for test compilation Jan 3, 2017

README.md

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.

Cloud Foundry Summit 2017 session about TOP

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

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 scope if privileged mode is needed

The top plugin will run without special scope (permissions) however it determines at runtime what scopes you have and displays the appropriate functionality based on those scopes. 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 scopes 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 scopes to an existing Cloud Foundry user (or LDAP group). To assign needed scopes:

Install the uaac client CLI if you do not already have it:

gem install cf-uaac

Login and add two scopes. 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 target https://login.system.YOUR.DOMAIN --skip-ssl-validation
uaac token client get admin -s [UAA Admin Client Credentials]  

To assign scopes to a LDAP group (recommended if connected to LDAP/Active Directory):

uaac group map --name cloud_controller.admin [FULL DN to LDAP group]
uaac group map --name doppler.firehose [FULL DN to LDAP group]

To assing scopes directly to a user:

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 (now part of CGI)

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' )