├── .coveragerc ├── .dockerignore ├── .flake8 ├── .github └── workflows │ ├── docker-push.yml │ └── python-package.yml ├── .gitignore ├── .pre-commit-config.yaml ├── CHANGELOG.md ├── Dockerfile ├── LICENSE ├── MANIFEST.in ├── README.md ├── alerts ├── vmware.rules └── vmware.rules.yml ├── catalog-info.yaml ├── dashboards ├── cluster.json ├── esx.json ├── esxi.json └── virtualmachine.json ├── docker-compose.yml ├── kubernetes ├── config.yml ├── readme.md └── vmware-exporter.yml ├── openshift ├── README.md ├── configmap.yaml ├── deployment.yaml ├── rolebinding.yaml ├── service.yaml └── servicemonitor.yaml ├── requirements-tests.txt ├── requirements.txt ├── setup.cfg ├── setup.py ├── systemd └── vmware_exporter.service ├── tests ├── integration │ └── test_container_health.py └── unit │ ├── test_helpers.py │ └── test_vmware_exporter.py ├── validate-signature.rb └── vmware_exporter ├── __init__.py ├── defer.py ├── helpers.py └── vmware_exporter.py /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | source = vmware_exporter 3 | omit = 4 | tests/* 5 | setup.py 6 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | config.yml 2 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = E402 3 | max-line-length = 120 4 | -------------------------------------------------------------------------------- /.github/workflows/docker-push.yml: -------------------------------------------------------------------------------- 1 | name: Build and Push Image 2 | on: 3 | release: 4 | types: [released] 5 | 6 | jobs: 7 | build: 8 | name: Build and push image 9 | runs-on: ubuntu-20.04 10 | 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Build Image 15 | id: build-image 16 | uses: redhat-actions/buildah-build@v2 17 | with: 18 | image: pryorda/vmware_exporter 19 | tags: latest ${{ github.sha }} ${{ github.event.release.tag_name }} 20 | dockerfiles: | 21 | ./Dockerfile 22 | 23 | # Podman Login action (https://github.com/redhat-actions/podman-login) also be used to log in, 24 | # in which case 'username' and 'password' can be omitted. 25 | - name: Push To dhub 26 | id: push-to-dhub 27 | uses: redhat-actions/push-to-registry@v2 28 | with: 29 | image: ${{ steps.build-image.outputs.image }} 30 | tags: ${{ steps.build-image.outputs.tags }} 31 | registry: docker.io 32 | username: ${{ secrets.DOCKERHUB_USERNAME }} 33 | password: ${{ secrets.DOCKERHUB_PASSWORD }} 34 | 35 | - name: Print image url 36 | run: echo "Image pushed to ${{ steps.push-to-dhub.outputs.registry-paths }}" 37 | -------------------------------------------------------------------------------- /.github/workflows/python-package.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries 3 | 4 | name: Python Package 5 | 6 | on: 7 | push: 8 | branches: [ main ] 9 | pull_request: 10 | branches: [ main ] 11 | 12 | jobs: 13 | build: 14 | if: github.event_name == 'pull_request' 15 | runs-on: ubuntu-latest 16 | 17 | strategy: 18 | matrix: 19 | python-version: [3.7] 20 | 21 | steps: 22 | - uses: actions/checkout@v2 23 | with: 24 | fetch-depth: 0 25 | ref: ${{ github.event.pull_request.head.sha }} 26 | - name: Set up Python ${{ matrix.python-version }} 27 | uses: actions/setup-python@v2 28 | with: 29 | python-version: ${{ matrix.python-version }} 30 | - name: Install dependencies 31 | run: | 32 | python -m pip install --upgrade pip 33 | pip install -e . -r requirements.txt -r requirements-tests.txt python-semantic-release 34 | sudo apt-get update && sudo apt-get install -y nodejs npm && sudo npm install -g dockerfilelint 35 | - name: Lint with flake8 36 | run: | 37 | # stop the build if there are Python syntax errors or undefined names 38 | flake8 vmware_exporter tests --statistics 39 | - name: Lint dockerfile 40 | run: dockerfilelint ./Dockerfile 41 | - name: Test with pytest 42 | run: | 43 | pytest --cov=. -v tests/unit 44 | - uses: codecov/codecov-action@v1 45 | - name: integration tests 46 | run: | 47 | pytest tests/integration 48 | - name: Setup ruby env 49 | uses: actions/setup-ruby@v1 50 | with: 51 | ruby-version: 2.7 52 | - run: | 53 | gem install pre-commit-sign 54 | export COMMIT_MESSAGE=$(git log -1) 55 | ruby validate-signature.rb "${COMMIT_MESSAGE}" 56 | 57 | deploy: 58 | strategy: 59 | matrix: 60 | python-version: [3.7] 61 | 62 | runs-on: ubuntu-latest 63 | if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} 64 | 65 | steps: 66 | - uses: actions/checkout@v2 67 | with: 68 | token: ${{ secrets.GH_TOKEN }} 69 | fetch-depth: 0 70 | - name: Set up Python ${{ matrix.python-version }} 71 | uses: actions/setup-python@v2 72 | with: 73 | python-version: ${{ matrix.python-version }} 74 | - name: install semantic-release 75 | run: | 76 | pip install python-semantic-release 77 | - name: deploy pip 78 | run: | 79 | git config --global user.name "semantic-release (via github actions)" 80 | git config --global user.email "semantic-release@github-actions" 81 | semantic-release publish 82 | env: # Or as an environment variable 83 | GH_TOKEN: ${{ secrets.GH_TOKEN }} 84 | PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} 85 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | local_settings.py 55 | 56 | # Flask stuff: 57 | instance/ 58 | .webassets-cache 59 | 60 | # Scrapy stuff: 61 | .scrapy 62 | 63 | # Sphinx documentation 64 | docs/_build/ 65 | 66 | # PyBuilder 67 | target/ 68 | 69 | # IPython Notebook 70 | .ipynb_checkpoints 71 | 72 | # pyenv 73 | .python-version 74 | 75 | # celery beat schedule file 76 | celerybeat-schedule 77 | 78 | # dotenv 79 | .env 80 | 81 | # virtualenv 82 | venv/ 83 | ENV/ 84 | 85 | # Spyder project settings 86 | .spyderproject 87 | 88 | # Rope project settings 89 | .ropeproject 90 | 91 | # Project 92 | config*.yml 93 | *.swp 94 | 95 | # Visual Studio Code 96 | .vscode 97 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/mirrors-autopep8 3 | rev: v1.5.6 # Use the sha / tag you want to point at 4 | hooks: 5 | - id: autopep8 6 | - repo: https://github.com/pre-commit/pre-commit-hooks 7 | rev: v1.3.0 8 | hooks: 9 | # Git state 10 | - id: check-merge-conflict 11 | stages: [commit] 12 | - id: check-added-large-files 13 | stages: [commit] 14 | # Sensitive information 15 | - id: detect-private-key 16 | stages: [commit] 17 | - id: detect-aws-credentials 18 | stages: [commit] 19 | args: 20 | - --allow-missing-credentials 21 | # Generic file state 22 | - id: trailing-whitespace 23 | stages: [commit] 24 | - id: mixed-line-ending 25 | stages: [commit] 26 | - id: end-of-file-fixer 27 | stages: [commit] 28 | exclude: .*\.tfvars$ # terraform fmt separates everything with blank lines leaving a trailing line at the end 29 | - id: check-executables-have-shebangs 30 | stages: [commit] 31 | # Language syntax/formatting 32 | - id: check-yaml 33 | stages: [commit] 34 | - id: check-json 35 | stages: [commit] 36 | - id: pretty-format-json 37 | stages: [commit] 38 | args: 39 | - --autofix 40 | - id: flake8 41 | stages: [commit] 42 | args: 43 | - --ignore=F705,E123,E402 44 | - repo: https://github.com/pryorda/dockerfilelint-precommit-hooks 45 | rev: v0.1.0 46 | hooks: 47 | - id: dockerfilelint 48 | stages: [commit] 49 | - repo: https://github.com/mattlqx/pre-commit-sign 50 | rev: v1.1.3 51 | hooks: 52 | - id: sign-commit 53 | stages: [commit-msg] 54 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). 4 | 5 | 6 | 7 | ## v0.18.4 (2022-10-11) 8 | ### Fix 9 | * **update_dashboards:** Updating datasource and adding prefix ([`a42968f`](https://github.com/pryorda/vmware_exporter/commit/a42968f0cb87598558f48f99d5341a36ab1175f1)) 10 | 11 | ## v0.18.3 (2022-03-25) 12 | ### Fix 13 | * **empty_string:** #294 ([`a806b1d`](https://github.com/pryorda/vmware_exporter/commit/a806b1da9f65c965769903ad5691ec1449965ddd)) 14 | 15 | ## v0.18.2 (2021-09-26) 16 | ### Fix 17 | * **fix_image:** Adding dhub automation - fix image ([#293](https://github.com/pryorda/vmware_exporter/issues/293)) ([`1b8bd18`](https://github.com/pryorda/vmware_exporter/commit/1b8bd18c22613582bdcbd1a5f488ca2f63b1e364)) 18 | 19 | ## v0.18.1 (2021-09-26) 20 | ### Fix 21 | * **fix_tag:** Adding dhub automation - fix tag ([#292](https://github.com/pryorda/vmware_exporter/issues/292)) ([`c3d7830`](https://github.com/pryorda/vmware_exporter/commit/c3d7830ea92567c21b5e5db51ead6ad3983c4082)) 22 | 23 | ## v0.18.0 (2021-09-26) 24 | ### Feature 25 | * **adding_dhub_automation:** Adding dhub automation ([#291](https://github.com/pryorda/vmware_exporter/issues/291)) ([`ba56f30`](https://github.com/pryorda/vmware_exporter/commit/ba56f300d1d2c2e7439e1f3406aada1e0111ed34)) 26 | 27 | ## v0.17.1 (2021-08-19) 28 | ### Fix 29 | * **adding_version:** Adding version cli ([`f83b058`](https://github.com/pryorda/vmware_exporter/commit/f83b0580f58bc2d3c7d53f99194d03ef02a02758)) 30 | 31 | ## v0.17.0 (2021-08-19) 32 | ### Feature 33 | * **add_vm_ds:** Adding vm datastore. ([`16c8604`](https://github.com/pryorda/vmware_exporter/commit/16c8604ef4e6c77d1eb5f1876ead544fde540967)) 34 | 35 | ## v0.16.1 (2021-06-10) 36 | ### Fix 37 | * **fixing_sensor:** Fix for badly behaving super-micro sensor #271 ([`2d5c196`](https://github.com/pryorda/vmware_exporter/commit/2d5c1965ec21ee6afc1d9ff3063bea3ca93bd99d)) 38 | 39 | ## v0.16.0 (2021-03-30) 40 | ### Feature 41 | * **adding_signature_validation:** Adding Validation for signatures. ([`72430d9`](https://github.com/pryorda/vmware_exporter/commit/72430d91f181b17c977aecb9b1fda90ef83bd4ee)) 42 | 43 | ## v0.15.1 (2021-03-30) 44 | ### Fix 45 | * **fix_sensor_lookup:** Fixing sensor lookup ([#262](https://github.com/pryorda/vmware_exporter/issues/262)) ([`e97c855`](https://github.com/pryorda/vmware_exporter/commit/e97c855581a4e8db8804c542aaece62b3d85081b)) 46 | 47 | ## v0.15.0 (2021-03-29) 48 | ### Feature 49 | * **sensors:** Adding sensor metrics ([`da2f489`](https://github.com/pryorda/vmware_exporter/commit/da2f48929fc8e377202c4e193d2d4836e4d90a38)) 50 | 51 | ## v0.14.3 (2021-03-11) 52 | ### Fix 53 | * **optimize_build:** Remove travis, add ifs to action ([#254](https://github.com/pryorda/vmware_exporter/issues/254)) ([`43d6556`](https://github.com/pryorda/vmware_exporter/commit/43d6556556171b3ada6804a29aaff4710e511094)) 54 | 55 | ## [0.4.2] - 2018-01-02 56 | ## Fixed 57 | - [#60](https://github.com/pryorda/vmware_exporter/pull/60) Typo Fix 58 | 59 | 60 | ## [0.4.1] - 2018-01-02 61 | ## Changed 62 | - [#50](https://github.com/pryorda/vmware_exporter/pull/50) Added tests + CI (#47) (#50) 63 | - [#55](https://github.com/pryorda/vmware_exporter/pull/55) Robustness around collected properties #55 64 | - [#58](https://github.com/pryorda/vmware_exporter/pull/58) Multiple section support via ENV variables. #58 65 | 66 | ## [0.4.0] - 2018-12-28 67 | ## Changed 68 | - [#44](https://github.com/pryorda/vmware_exporter/pull/44) Embrace more twisted machinery + allow concurrent scrapes 69 | 70 | ## [0.3.1] - 2018-12-23 71 | ### Changed 72 | - [#43](https://github.com/pryorda/vmware_exporter/pull/43) Property collectors 73 | ### Fixed 74 | - [#40](https://github.com/pryorda/vmware_exporter/pull/40) Fixed race condition with intermittent results @Jc2k 75 | 76 | ## [0.3.0] - 2018-12-09 77 | ### Changed 78 | - [#35](https://github.com/pryorda/vmware_exporter/pull/35) Refactor threading @Jc2k 79 | - [#34](https://github.com/pryorda/vmware_exporter/pull/34) README Updates @Rosiak 80 | ### Fixed 81 | - [#33](https://github.com/pryorda/vmware_exporter/pull/33) Drop None values in lables @akrauza 82 | 83 | ## [0.2.6] - 2018-11-24 84 | ### Changed 85 | - Updated setup.py 86 | 87 | ### Fixed 88 | - [#24](https://github.com/pryorda/vmware_exporter/issues/24) UTF8 Error @jnogol 89 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.7-alpine 2 | 3 | LABEL MAINTAINER="Daniel Pryor " 4 | LABEL NAME=vmware_exporter 5 | 6 | WORKDIR /opt/vmware_exporter/ 7 | COPY . /opt/vmware_exporter/ 8 | 9 | RUN set -x; buildDeps="gcc python3-dev musl-dev libffi-dev openssl openssl-dev rust cargo" \ 10 | && apk add --no-cache --update $buildDeps \ 11 | && pip install -r requirements.txt . \ 12 | && apk del $buildDeps 13 | 14 | EXPOSE 9272 15 | 16 | ENV PYTHONUNBUFFERED=1 17 | 18 | ENTRYPOINT ["/usr/local/bin/vmware_exporter"] 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2017, Remi Verchere 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md 2 | include requirements.txt 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Needs new home. Since Broadcom is no longer catering to its opensource/free base, I have decided to move on from maintaining this project. Please create a discussion if you would like to take over managing this project. 2 | 3 | 4 | # vmware_exporter 5 | 6 | VMware vCenter Exporter for Prometheus. 7 | 8 | Get VMware vCenter information: 9 | - Basic VM and Host metrics 10 | - Current number of active snapshots 11 | - Datastore size and other stuff 12 | - Snapshot Unix timestamp creation date 13 | 14 | ## Badges 15 | ![Docker Stars](https://img.shields.io/docker/stars/pryorda/vmware_exporter.svg) 16 | ![Docker Pulls](https://img.shields.io/docker/pulls/pryorda/vmware_exporter.svg) 17 | ![Docker Automated](https://img.shields.io/docker/automated/pryorda/vmware_exporter.svg) 18 | 19 | [![Travis Build Status](https://travis-ci.org/pryorda/vmware_exporter.svg?branch=master)](https://travis-ci.org/pryorda/vmware_exporter) 20 | ![Docker Build](https://img.shields.io/docker/build/pryorda/vmware_exporter.svg) 21 | [![Join the chat at https://gitter.im/vmware_exporter/community](https://badges.gitter.im/vmware_exporter/community.svg)](https://gitter.im/vmware_exporter/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 22 | 23 | ## Usage 24 | 25 | *Requires Python >= 3.6* 26 | 27 | - Install with `$ python setup.py install` or via pip `$ pip install vmware_exporter`. The docker command below is preferred. 28 | - Create `config.yml` based on the configuration section. Some variables can be passed as environment variables 29 | - Run `$ vmware_exporter -c /path/to/your/config` 30 | - Go to http://localhost:9272/metrics?vsphere_host=vcenter.company.com to see metrics 31 | 32 | Alternatively, if you don't wish to install the package, run it using `$ vmware_exporter/vmware_exporter.py` or use the following docker command: 33 | 34 | ``` 35 | docker run -it --rm -p 9272:9272 -e VSPHERE_USER=${VSPHERE_USERNAME} -e VSPHERE_PASSWORD=${VSPHERE_PASSWORD} -e VSPHERE_HOST=${VSPHERE_HOST} -e VSPHERE_IGNORE_SSL=True -e VSPHERE_SPECS_SIZE=2000 --name vmware_exporter pryorda/vmware_exporter 36 | ``` 37 | 38 | When using containers combined with `--env-file` flag, please use capital letters to set bolleans, for example: 39 | 40 | ``` 41 | $ podman run -it --rm -p 9272:9272 --name vmware_exporter --env-file config.env pryorda/vmware_exporter 42 | $ cat config.env 43 | VSPHERE_USER=administrator@vsphere.my.domain.com 44 | VSPHERE_PASSWORD=Secure-Pass 45 | VSPHERE_HOST=192.168.0.1 46 | VSPHERE_IGNORE_SSL=TRUE 47 | VSPHERE_SPECS_SIZE=2000 48 | ``` 49 | 50 | 51 | ### Configuration and limiting data collection 52 | 53 | Only provide a configuration file if enviroment variables are not used. If you do plan to use a configuration file, be sure to override the container entrypoint or add -c config.yml to the command arguments. 54 | 55 | If you want to limit the scope of the metrics gathered, you can update the subsystem under `collect_only` in the config section, e.g. under `default`, or by using the environment variables: 56 | 57 | collect_only: 58 | vms: False 59 | vmguests: True 60 | datastores: True 61 | hosts: True 62 | snapshots: True 63 | 64 | This would only connect datastores and hosts. 65 | 66 | You can have multiple sections for different hosts and the configuration would look like: 67 | ``` 68 | default: 69 | vsphere_host: "vcenter" 70 | vsphere_user: "user" 71 | vsphere_password: "password" 72 | ignore_ssl: False 73 | specs_size: 5000 74 | fetch_custom_attributes: True 75 | fetch_tags: True 76 | fetch_alarms: True 77 | collect_only: 78 | vms: True 79 | vmguests: True 80 | datastores: True 81 | hosts: True 82 | snapshots: True 83 | 84 | esx: 85 | vsphere_host: vc.example2.com 86 | vsphere_user: 'root' 87 | vsphere_password: 'password' 88 | ignore_ssl: True 89 | specs_size: 5000 90 | fetch_custom_attributes: True 91 | fetch_tags: True 92 | fetch_alarms: True 93 | collect_only: 94 | vms: False 95 | vmguests: True 96 | datastores: False 97 | hosts: True 98 | snapshots: True 99 | 100 | limited: 101 | vsphere_host: slowvc.example.com 102 | vsphere_user: 'administrator@vsphere.local' 103 | vsphere_password: 'password' 104 | ignore_ssl: True 105 | specs_size: 5000 106 | fetch_custom_attributes: True 107 | fetch_tags: True 108 | fetch_alarms: False 109 | collect_only: 110 | vms: False 111 | vmguests: False 112 | datastores: True 113 | hosts: False 114 | snapshots: False 115 | 116 | ``` 117 | Switching sections can be done by adding ?section=limited to the URL. 118 | 119 | #### Environment Variables 120 | | Variable | Precedence | Defaults | Description | 121 | | --------------------------------------| ---------------------- | -------- | --------------------------------------------------------------------------| 122 | | `VSPHERE_HOST` | config, env, get_param | n/a | vsphere server to connect to | 123 | | `VSPHERE_USER` | config, env | n/a | User for connecting to vsphere | 124 | | `VSPHERE_PASSWORD` | config, env | n/a | Password for connecting to vsphere | 125 | | `VSPHERE_SPECS_SIZE` | config, env | 5000 | Size of specs list for query stats function | 126 | | `VSPHERE_IGNORE_SSL` | config, env | False | Ignore the ssl cert on the connection to vsphere host | 127 | | `VSPHERE_FETCH_CUSTOM_ATTRIBUTES` | config, env | False | Set to true to collect objects custom attributes as metric labels | 128 | | `VSPHERE_FETCH_TAGS` | config, env | False | Set to true to collect objects tags as metric labels | 129 | | `VSPHERE_FETCH_ALARMS` | config, env | False | Fetch objects triggered alarms, and in case of hosts hdw alarms as well | 130 | | `VSPHERE_COLLECT_HOSTS` | config, env | True | Set to false to disable collection of host metrics | 131 | | `VSPHERE_COLLECT_DATASTORES` | config, env | True | Set to false to disable collection of datastore metrics | 132 | | `VSPHERE_COLLECT_VMS` | config, env | True | Set to false to disable collection of virtual machine metrics | 133 | | `VSPHERE_COLLECT_VMGUESTS` | config, env | True | Set to false to disable collection of virtual machine guest metrics | 134 | | `VSPHERE_COLLECT_SNAPSHOTS` | config, env | True | Set to false to disable collection of snapshot metrics | 135 | 136 | You can create new sections as well, with very similiar variables. For example, to create a `limited` section you can set: 137 | 138 | | Variable | Precedence | Defaults | Description | 139 | | ----------------------------------------------| ---------------------- | -------- | --------------------------------------------------------------------------| 140 | | `VSPHERE_LIMITED_HOST` | config, env, get_param | n/a | vsphere server to connect to | 141 | | `VSPHERE_LIMITED_USER` | config, env | n/a | User for connecting to vsphere | 142 | | `VSPHERE_LIMITED_PASSWORD` | config, env | n/a | Password for connecting to vsphere | 143 | | `VSPHERE_LIMITED_SPECS_SIZE` | config, env | 5000 | Size of specs list for query stats function | 144 | | `VSPHERE_LIMITED_IGNORE_SSL` | config, env | False | Ignore the ssl cert on the connection to vsphere host | 145 | | `VSPHERE_LIMITED_FETCH_CUSTOM_ATTRIBUTES` | config, env | False | Set to true to collect objects custom attributes as metric labels | 146 | | `VSPHERE_LIMITED_FETCH_TAGS` | config, env | False | Set to true to collect objects tags as metric labels | 147 | | `VSPHERE_LIMITED_FETCH_ALARMS` | config, env | False | Fetch objects triggered alarms, and in case of hosts hdw alarms as well | 148 | | `VSPHERE_LIMITED_COLLECT_HOSTS` | config, env | True | Set to false to disable collection of host metrics | 149 | | `VSPHERE_LIMITED_COLLECT_DATASTORES` | config, env | True | Set to false to disable collection of datastore metrics | 150 | | `VSPHERE_LIMITED_COLLECT_VMS` | config, env | True | Set to false to disable collection of virtual machine metrics | 151 | | `VSPHERE_LIMITED_COLLECT_VMGUESTS` | config, env | True | Set to false to disable collection of virtual machine guest metrics | 152 | | `VSPHERE_LIMITED_COLLECT_SNAPSHOTS` | config, env | True | Set to false to disable collection of snapshot metrics | 153 | 154 | You need to set at least `VSPHERE_SECTIONNAME_USER` for the section to be detected. 155 | 156 | ### Prometheus configuration 157 | 158 | You can use the following parameters in the Prometheus configuration file. The `params` section is used to manage multiple login/passwords. 159 | 160 | ``` 161 | - job_name: 'vmware_vcenter' 162 | metrics_path: '/metrics' 163 | static_configs: 164 | - targets: 165 | - 'vcenter.company.com' 166 | relabel_configs: 167 | - source_labels: [__address__] 168 | target_label: __param_target 169 | - source_labels: [__param_target] 170 | target_label: instance 171 | - target_label: __address__ 172 | replacement: localhost:9272 173 | 174 | - job_name: 'vmware_esx' 175 | metrics_path: '/metrics' 176 | file_sd_configs: 177 | - files: 178 | - /etc/prometheus/esx.yml 179 | params: 180 | section: [esx] 181 | relabel_configs: 182 | - source_labels: [__address__] 183 | target_label: __param_target 184 | - source_labels: [__param_target] 185 | target_label: instance 186 | - target_label: __address__ 187 | replacement: localhost:9272 188 | 189 | # Example of Multiple vCenter usage per #23 190 | 191 | - job_name: vmware_export 192 | metrics_path: /metrics 193 | static_configs: 194 | - targets: 195 | - vcenter01 196 | - vcenter02 197 | - vcenter03 198 | relabel_configs: 199 | - source_labels: [__address__] 200 | target_label: __param_target 201 | - source_labels: [__param_target] 202 | target_label: instance 203 | - target_label: __address__ 204 | replacement: exporter_ip:9272 205 | ``` 206 | 207 | ## Current Status 208 | 209 | - vCenter and vSphere 6.0/6.5 have been tested. 210 | - VM information, Snapshot, Host and Datastore basic information is exported, i.e: 211 | ``` 212 | # HELP vmware_snapshots VMware current number of existing snapshots 213 | # TYPE vmware_snapshot_count gauge 214 | vmware_snapshot_timestamp_seconds{vm_name="My Super Virtual Machine"} 2.0 215 | # HELP vmware_snapshot_timestamp_seconds VMware Snapshot creation time in seconds 216 | # TYPE vmware_snapshot_timestamp_seconds gauge 217 | vmware_snapshot_age{vm_name="My Super Virtual Machine",vm_snapshot_name="Very old snaphot"} 1478146956.96092 218 | vmware_snapshot_age{vm_name="My Super Virtual Machine",vm_snapshot_name="Old snapshot"} 1478470046.975632 219 | 220 | # HELP vmware_datastore_capacity_size VMware Datastore capacity in bytes 221 | # TYPE vmware_datastore_capacity_size gauge 222 | vmware_datastore_capacity_size{ds_name="ESX1-LOCAL"} 67377299456.0 223 | # HELP vmware_datastore_freespace_size VMware Datastore freespace in bytes 224 | # TYPE vmware_datastore_freespace_size gauge 225 | vmware_datastore_freespace_size{ds_name="ESX1-LOCAL"} 66349694976.0 226 | # HELP vmware_datastore_uncommited_size VMware Datastore uncommitted in bytes 227 | # TYPE vmware_datastore_uncommited_size gauge 228 | vmware_datastore_uncommited_size{ds_name="ESX1-LOCAL"} 0.0 229 | # HELP vmware_datastore_provisoned_size VMware Datastore provisoned in bytes 230 | # TYPE vmware_datastore_provisoned_size gauge 231 | vmware_datastore_provisoned_size{ds_name="ESX1-LOCAL"} 1027604480.0 232 | # HELP vmware_datastore_hosts VMware Hosts number using this datastore 233 | # TYPE vmware_datastore_hosts gauge 234 | vmware_datastore_hosts{ds_name="ESX1-LOCAL"} 1.0 235 | # HELP vmware_datastore_vms VMware Virtual Machines number using this datastore 236 | # TYPE vmware_datastore_vms gauge 237 | vmware_datastore_vms{ds_name="ESX1-LOCAL"} 0.0 238 | 239 | # HELP vmware_host_power_state VMware Host Power state (On / Off) 240 | # TYPE vmware_host_power_state gauge 241 | vmware_host_power_state{host_name="esx1.company.com"} 1.0 242 | # HELP vmware_host_cpu_usage VMware Host CPU usage in MHz 243 | # TYPE vmware_host_cpu_usage gauge 244 | vmware_host_cpu_usage{host_name="esx1.company.com"} 2959.0 245 | # HELP vmware_host_cpu_max VMware Host CPU max availability in MHz 246 | # TYPE vmware_host_cpu_max gauge 247 | vmware_host_cpu_max{host_name="esx1.company.com"} 28728.0 248 | # HELP vmware_host_memory_usage VMware Host Memory usage in Mbytes 249 | # TYPE vmware_host_memory_usage gauge 250 | vmware_host_memory_usage{host_name="esx1.company.com"} 107164.0 251 | # HELP vmware_host_memory_max VMware Host Memory Max availability in Mbytes 252 | # TYPE vmware_host_memory_max gauge 253 | vmware_host_memory_max{host_name="esx1.company.com"} 131059.01953125 254 | ``` 255 | 256 | ## References 257 | 258 | The VMware exporter uses theses libraries: 259 | - [pyVmomi](https://github.com/vmware/pyvmomi) for VMware connection 260 | - Prometheus [client_python](https://github.com/prometheus/client_python) for Prometheus supervision 261 | - [Twisted](http://twistedmatrix.com/trac/) for HTTP server 262 | 263 | The initial code is mainly inspired by: 264 | - https://www.robustperception.io/writing-a-jenkins-exporter-in-python/ 265 | - https://github.com/vmware/pyvmomi-community-samples 266 | - https://github.com/jbidinger/pyvmomi-tools 267 | 268 | Forked from https://github.com/rverchere/vmware_exporter. I removed the fork so that I could do searching and everything. 269 | 270 | ## Maintainer 271 | 272 | Daniel Pryor [pryorda](https://github.com/pryorda) 273 | 274 | ## License 275 | 276 | See LICENSE file 277 | 278 | [![Known Vulnerabilities](https://snyk.io/test/github/rmontenegroo/vmware_exporter/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/rmontenegroo/vmware_exporter?targetFile=requirements.txt) 279 | -------------------------------------------------------------------------------- /alerts/vmware.rules: -------------------------------------------------------------------------------- 1 | ALERT VMWarnMemoryUsage 2 | IF 3 | ((vmware_vm_mem_usage_average / 100) >= 90) and ((vmware_vm_mem_usage_average / 100) < 95) 4 | FOR 30m 5 | LABELS { severity = "warning" } 6 | ANNOTATIONS { 7 | title = "High memory usage on {{ $labels.instance }}: {{ $value | printf \"%.2f\" }}%", 8 | } 9 | 10 | ALERT VMCritMemoryUsage 11 | IF 12 | ((vmware_vm_mem_usage_average / 100) >= 95) 13 | FOR 5m 14 | LABELS { severity = "critical" } 15 | ANNOTATIONS { 16 | title = "Very High memory usage on {{ $labels.instance }}: {{ $value | printf \"%.2f\" }}%", 17 | } 18 | 19 | ALERT VMWarnNumberSnapshots 20 | IF 21 | (vmware_vm_snapshots < 3) 22 | FOR 30m 23 | LABELS { severity = "warning" } 24 | ANNOTATIONS { 25 | title = "High snapshots number on {{ $labels.instance }}: {{ $value }}", 26 | } 27 | 28 | ALERT VMCritNumberSnapshots 29 | IF 30 | (vmware_vm_snapshots >= 3) 31 | FOR 30m 32 | LABELS { severity = "critical" } 33 | ANNOTATIONS { 34 | title = "Very high snapshot number on {{ $labels.instance }}: {{ $value }}", 35 | } 36 | 37 | ALERT VMWarnAgeSnapshots 38 | IF 39 | ((time() - vmware_vm_snapshot_timestamp_seconds) / (60*60*24) >= 7) 40 | FOR 5m 41 | LABELS { severity = "warning" } 42 | ANNOTATIONS { 43 | title = "Outdated snapshot on {{ $labels.instance }}: {{ $value | printf \"%.0f\" }} days", 44 | } -------------------------------------------------------------------------------- /alerts/vmware.rules.yml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: vmware.rules 3 | rules: 4 | - alert: VMWarnMemoryUsage 5 | expr: ((vmware_vm_mem_usage_average / 100) >= 90) and ((vmware_vm_mem_usage_average 6 | / 100) < 95) 7 | for: 30m 8 | labels: 9 | severity: warning 10 | annotations: 11 | title: 'High memory usage on {{ $labels.instance }}: {{ $value | printf "%.2f" 12 | }}%' 13 | - alert: VMCritMemoryUsage 14 | expr: ((vmware_vm_mem_usage_average / 100) >= 95) 15 | for: 5m 16 | labels: 17 | severity: critical 18 | annotations: 19 | title: 'Very High memory usage on {{ $labels.instance }}: {{ $value | printf 20 | "%.2f" }}%' 21 | - alert: VMWarnNumberSnapshots 22 | expr: (vmware_vm_snapshots < 3) 23 | for: 30m 24 | labels: 25 | severity: warning 26 | annotations: 27 | title: 'High snapshots number on {{ $labels.instance }}: {{ $value }}' 28 | - alert: VMCritNumberSnapshots 29 | expr: (vmware_vm_snapshots >= 3) 30 | for: 30m 31 | labels: 32 | severity: critical 33 | annotations: 34 | title: 'Very high snapshot number on {{ $labels.instance }}: {{ $value }}' 35 | - alert: VMWarnAgeSnapshots 36 | expr: ((time() - vmware_vm_snapshot_timestamp_seconds) / (60 * 60 * 24) >= 7) 37 | for: 5m 38 | labels: 39 | severity: warning 40 | annotations: 41 | title: 'Outdated snapshot on {{ $labels.instance }}: {{ $value | printf "%.0f" 42 | }} days' 43 | -------------------------------------------------------------------------------- /catalog-info.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: backstage.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: vmware_exporter 5 | annotations: 6 | github.com/project-slug: pryorda/vmware_exporter 7 | spec: 8 | type: service 9 | lifecycle: unknown 10 | owner: production-engineering 11 | -------------------------------------------------------------------------------- /dashboards/esx.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "datasource", 5 | "label": "prometheus", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "prometheus", 9 | "pluginName": "Prometheus" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "4.3.0" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "prometheus", 28 | "name": "Prometheus", 29 | "version": "1.0.0" 30 | }, 31 | { 32 | "type": "panel", 33 | "id": "singlestat", 34 | "name": "Singlestat", 35 | "version": "" 36 | } 37 | ], 38 | "annotations": { 39 | "list": [] 40 | }, 41 | "editable": true, 42 | "gnetId": null, 43 | "graphTooltip": 0, 44 | "hideControls": false, 45 | "id": null, 46 | "links": [], 47 | "refresh": "10s", 48 | "rows": [ 49 | { 50 | "collapse": false, 51 | "height": 250, 52 | "panels": [ 53 | { 54 | "cacheTimeout": null, 55 | "colorBackground": false, 56 | "colorValue": false, 57 | "colors": [ 58 | "rgba(245, 54, 54, 0.9)", 59 | "rgba(237, 129, 40, 0.89)", 60 | "rgba(50, 172, 45, 0.97)" 61 | ], 62 | "datasource": "${datasource}", 63 | "decimals": 1, 64 | "description": "System uptime", 65 | "format": "s", 66 | "gauge": { 67 | "maxValue": 100, 68 | "minValue": 0, 69 | "show": false, 70 | "thresholdLabels": false, 71 | "thresholdMarkers": true 72 | }, 73 | "id": 3, 74 | "interval": null, 75 | "links": [], 76 | "mappingType": 1, 77 | "mappingTypes": [ 78 | { 79 | "name": "value to text", 80 | "value": 1 81 | }, 82 | { 83 | "name": "range to text", 84 | "value": 2 85 | } 86 | ], 87 | "maxDataPoints": 100, 88 | "minSpan": 1, 89 | "nullPointMode": "connected", 90 | "nullText": null, 91 | "postfix": "s", 92 | "postfixFontSize": "50%", 93 | "prefix": "", 94 | "prefixFontSize": "50%", 95 | "rangeMaps": [ 96 | { 97 | "from": "null", 98 | "text": "N/A", 99 | "to": "null" 100 | } 101 | ], 102 | "span": 3, 103 | "sparkline": { 104 | "fillColor": "rgba(31, 118, 189, 0.18)", 105 | "full": false, 106 | "lineColor": "rgb(31, 120, 193)", 107 | "show": false 108 | }, 109 | "tableColumn": "", 110 | "targets": [ 111 | { 112 | "expr": "time() - vmware_host_boot_timestamp_seconds{host_name=\"$hostname\"}", 113 | "format": "time_series", 114 | "intervalFactor": 2, 115 | "legendFormat": "", 116 | "refId": "A", 117 | "step": 4 118 | } 119 | ], 120 | "thresholds": "", 121 | "title": "Uptime", 122 | "type": "singlestat", 123 | "valueFontSize": "50%", 124 | "valueMaps": [ 125 | { 126 | "op": "=", 127 | "text": "N/A", 128 | "value": "null" 129 | } 130 | ], 131 | "valueName": "current" 132 | }, 133 | { 134 | "cacheTimeout": null, 135 | "colorBackground": false, 136 | "colorValue": true, 137 | "colors": [ 138 | "rgba(50, 172, 45, 0.97)", 139 | "rgba(237, 129, 40, 0.89)", 140 | "rgba(245, 54, 54, 0.9)" 141 | ], 142 | "datasource": "${datasource}", 143 | "format": "percent", 144 | "gauge": { 145 | "maxValue": 100, 146 | "minValue": 0, 147 | "show": true, 148 | "thresholdLabels": false, 149 | "thresholdMarkers": true 150 | }, 151 | "id": 4, 152 | "interval": null, 153 | "links": [], 154 | "mappingType": 1, 155 | "mappingTypes": [ 156 | { 157 | "name": "value to text", 158 | "value": 1 159 | }, 160 | { 161 | "name": "range to text", 162 | "value": 2 163 | } 164 | ], 165 | "maxDataPoints": 100, 166 | "minSpan": 1, 167 | "nullPointMode": "connected", 168 | "nullText": null, 169 | "postfix": "", 170 | "postfixFontSize": "50%", 171 | "prefix": "", 172 | "prefixFontSize": "50%", 173 | "rangeMaps": [ 174 | { 175 | "from": "null", 176 | "text": "N/A", 177 | "to": "null" 178 | } 179 | ], 180 | "repeat": null, 181 | "span": 3, 182 | "sparkline": { 183 | "fillColor": "rgba(31, 118, 189, 0.18)", 184 | "full": false, 185 | "lineColor": "rgb(31, 120, 193)", 186 | "show": true 187 | }, 188 | "tableColumn": "", 189 | "targets": [ 190 | { 191 | "expr": "vmware_host_cpu_usage{host_name=\"$hostname\"} / vmware_host_cpu_max{host_name=\"$hostname\"} * 100", 192 | "format": "time_series", 193 | "intervalFactor": 1, 194 | "legendFormat": "", 195 | "refId": "A", 196 | "step": 2 197 | } 198 | ], 199 | "thresholds": "80,90", 200 | "title": "CPU Usage", 201 | "type": "singlestat", 202 | "valueFontSize": "80%", 203 | "valueMaps": [ 204 | { 205 | "op": "=", 206 | "text": "N/A", 207 | "value": "null" 208 | } 209 | ], 210 | "valueName": "current" 211 | }, 212 | { 213 | "cacheTimeout": null, 214 | "colorBackground": false, 215 | "colorValue": true, 216 | "colors": [ 217 | "rgba(50, 172, 45, 0.97)", 218 | "rgba(237, 129, 40, 0.89)", 219 | "rgba(245, 54, 54, 0.9)" 220 | ], 221 | "datasource": "${datasource}", 222 | "format": "percent", 223 | "gauge": { 224 | "maxValue": 100, 225 | "minValue": 0, 226 | "show": true, 227 | "thresholdLabels": false, 228 | "thresholdMarkers": true 229 | }, 230 | "id": 5, 231 | "interval": null, 232 | "links": [], 233 | "mappingType": 1, 234 | "mappingTypes": [ 235 | { 236 | "name": "value to text", 237 | "value": 1 238 | }, 239 | { 240 | "name": "range to text", 241 | "value": 2 242 | } 243 | ], 244 | "maxDataPoints": 100, 245 | "minSpan": 1, 246 | "nullPointMode": "connected", 247 | "nullText": null, 248 | "postfix": "", 249 | "postfixFontSize": "50%", 250 | "prefix": "", 251 | "prefixFontSize": "50%", 252 | "rangeMaps": [ 253 | { 254 | "from": "null", 255 | "text": "N/A", 256 | "to": "null" 257 | } 258 | ], 259 | "span": 3, 260 | "sparkline": { 261 | "fillColor": "rgba(31, 118, 189, 0.18)", 262 | "full": false, 263 | "lineColor": "rgb(31, 120, 193)", 264 | "show": true 265 | }, 266 | "tableColumn": "", 267 | "targets": [ 268 | { 269 | "expr": "vmware_host_memory_usage{host_name=\"$hostname\"} / vmware_host_memory_max{host_name=\"$hostname\"} * 100", 270 | "format": "time_series", 271 | "intervalFactor": 1, 272 | "legendFormat": "", 273 | "refId": "A", 274 | "step": 2 275 | } 276 | ], 277 | "thresholds": "80,90", 278 | "title": "Memory Usage", 279 | "type": "singlestat", 280 | "valueFontSize": "80%", 281 | "valueMaps": [ 282 | { 283 | "op": "=", 284 | "text": "N/A", 285 | "value": "null" 286 | } 287 | ], 288 | "valueName": "current" 289 | }, 290 | { 291 | "cacheTimeout": null, 292 | "colorBackground": true, 293 | "colorValue": false, 294 | "colors": [ 295 | "rgba(245, 54, 54, 0.9)", 296 | "rgba(237, 129, 40, 0.89)", 297 | "rgba(50, 172, 45, 0.97)" 298 | ], 299 | "datasource": "${datasource}", 300 | "format": "none", 301 | "gauge": { 302 | "maxValue": 100, 303 | "minValue": 0, 304 | "show": false, 305 | "thresholdLabels": false, 306 | "thresholdMarkers": true 307 | }, 308 | "id": 6, 309 | "interval": null, 310 | "links": [], 311 | "mappingType": 1, 312 | "mappingTypes": [ 313 | { 314 | "name": "value to text", 315 | "value": 1 316 | }, 317 | { 318 | "name": "range to text", 319 | "value": 2 320 | } 321 | ], 322 | "maxDataPoints": 100, 323 | "nullPointMode": "connected", 324 | "nullText": null, 325 | "postfix": "", 326 | "postfixFontSize": "50%", 327 | "prefix": "", 328 | "prefixFontSize": "50%", 329 | "rangeMaps": [ 330 | { 331 | "from": "null", 332 | "text": "N/A", 333 | "to": "null" 334 | } 335 | ], 336 | "span": 3, 337 | "sparkline": { 338 | "fillColor": "rgba(31, 118, 189, 0.18)", 339 | "full": false, 340 | "lineColor": "rgb(31, 120, 193)", 341 | "show": false 342 | }, 343 | "tableColumn": "", 344 | "targets": [ 345 | { 346 | "expr": "vmware_host_power_state{host_name=\"$hostname\"}", 347 | "format": "time_series", 348 | "intervalFactor": 2, 349 | "refId": "A", 350 | "step": 4 351 | } 352 | ], 353 | "thresholds": "1,1", 354 | "title": "Host State", 355 | "type": "singlestat", 356 | "valueFontSize": "80%", 357 | "valueMaps": [ 358 | { 359 | "op": "=", 360 | "text": "UP", 361 | "value": "1" 362 | }, 363 | { 364 | "op": "=", 365 | "text": "DOWN", 366 | "value": "0" 367 | } 368 | ], 369 | "valueName": "current" 370 | } 371 | ], 372 | "repeat": null, 373 | "repeatIteration": null, 374 | "repeatRowId": null, 375 | "showTitle": false, 376 | "title": "Dashboard Row", 377 | "titleSize": "h6" 378 | }, 379 | { 380 | "collapse": false, 381 | "height": 398, 382 | "panels": [ 383 | { 384 | "aliasColors": {}, 385 | "bars": false, 386 | "dashLength": 10, 387 | "dashes": false, 388 | "datasource": "${datasource}", 389 | "decimals": 1, 390 | "fill": 0, 391 | "id": 1, 392 | "legend": { 393 | "alignAsTable": true, 394 | "avg": false, 395 | "current": true, 396 | "hideEmpty": false, 397 | "hideZero": false, 398 | "max": false, 399 | "min": false, 400 | "rightSide": true, 401 | "show": false, 402 | "total": false, 403 | "values": true 404 | }, 405 | "lines": true, 406 | "linewidth": 1, 407 | "links": [], 408 | "minSpan": 2, 409 | "nullPointMode": "null", 410 | "percentage": true, 411 | "pointradius": 5, 412 | "points": false, 413 | "renderer": "flot", 414 | "seriesOverrides": [], 415 | "spaceLength": 10, 416 | "span": 6, 417 | "stack": false, 418 | "steppedLine": false, 419 | "targets": [ 420 | { 421 | "expr": "vmware_host_cpu_usage{host_name=\"$hostname\"} / vmware_host_cpu_max{host_name=\"$hostname\"} * 100", 422 | "format": "time_series", 423 | "intervalFactor": 2, 424 | "legendFormat": "$hostname", 425 | "metric": "", 426 | "refId": "A", 427 | "step": 2 428 | } 429 | ], 430 | "thresholds": [], 431 | "timeFrom": null, 432 | "timeShift": null, 433 | "title": "ESX Host CPU Usage", 434 | "tooltip": { 435 | "shared": true, 436 | "sort": 0, 437 | "value_type": "individual" 438 | }, 439 | "type": "graph", 440 | "xaxis": { 441 | "buckets": null, 442 | "mode": "time", 443 | "name": null, 444 | "show": true, 445 | "values": [] 446 | }, 447 | "yaxes": [ 448 | { 449 | "format": "percent", 450 | "label": "", 451 | "logBase": 1, 452 | "max": "100", 453 | "min": "0", 454 | "show": true 455 | }, 456 | { 457 | "format": "short", 458 | "label": null, 459 | "logBase": 1, 460 | "max": null, 461 | "min": null, 462 | "show": false 463 | } 464 | ] 465 | }, 466 | { 467 | "aliasColors": {}, 468 | "bars": false, 469 | "dashLength": 10, 470 | "dashes": false, 471 | "datasource": "${datasource}", 472 | "decimals": 1, 473 | "fill": 1, 474 | "id": 2, 475 | "legend": { 476 | "alignAsTable": true, 477 | "avg": false, 478 | "current": true, 479 | "hideEmpty": false, 480 | "hideZero": false, 481 | "max": false, 482 | "min": false, 483 | "rightSide": true, 484 | "show": false, 485 | "total": false, 486 | "values": true 487 | }, 488 | "lines": true, 489 | "linewidth": 1, 490 | "links": [], 491 | "minSpan": 2, 492 | "nullPointMode": "null", 493 | "percentage": false, 494 | "pointradius": 5, 495 | "points": false, 496 | "renderer": "flot", 497 | "seriesOverrides": [], 498 | "spaceLength": 10, 499 | "span": 6, 500 | "stack": false, 501 | "steppedLine": false, 502 | "targets": [ 503 | { 504 | "expr": "vmware_host_memory_usage{host_name=\"$hostname\"} / vmware_host_memory_max{host_name=\"$hostname\"} * 100", 505 | "format": "time_series", 506 | "intervalFactor": 2, 507 | "legendFormat": "$hostname", 508 | "metric": "", 509 | "refId": "A", 510 | "step": 2 511 | } 512 | ], 513 | "thresholds": [], 514 | "timeFrom": null, 515 | "timeShift": null, 516 | "title": "ESX Host RAM Usage", 517 | "tooltip": { 518 | "shared": true, 519 | "sort": 0, 520 | "value_type": "individual" 521 | }, 522 | "type": "graph", 523 | "xaxis": { 524 | "buckets": null, 525 | "mode": "time", 526 | "name": null, 527 | "show": true, 528 | "values": [] 529 | }, 530 | "yaxes": [ 531 | { 532 | "format": "percent", 533 | "label": "", 534 | "logBase": 1, 535 | "max": "100", 536 | "min": "0", 537 | "show": true 538 | }, 539 | { 540 | "format": "short", 541 | "label": null, 542 | "logBase": 1, 543 | "max": null, 544 | "min": null, 545 | "show": false 546 | } 547 | ] 548 | } 549 | ], 550 | "repeat": null, 551 | "repeatIteration": null, 552 | "repeatRowId": null, 553 | "showTitle": false, 554 | "title": "Dashboard Row", 555 | "titleSize": "h6" 556 | } 557 | ], 558 | "schemaVersion": 14, 559 | "style": "dark", 560 | "tags": [ 561 | "vmware", 562 | "esx" 563 | ], 564 | "templating": { 565 | "list": [ 566 | { 567 | "current": { 568 | "text": "Prometheus", 569 | "value": "Prometheus" 570 | }, 571 | "hide": 0, 572 | "includeAll": false, 573 | "label": "Datasource", 574 | "multi": false, 575 | "name": "datasource", 576 | "options": [], 577 | "query": "prometheus", 578 | "refresh": 1, 579 | "regex": "", 580 | "skipUrlSync": false, 581 | "type": "datasource" 582 | }, 583 | { 584 | "allValue": null, 585 | "current": {}, 586 | "datasource": "$datasource", 587 | "hide": 0, 588 | "includeAll": false, 589 | "label": "Host:", 590 | "multi": false, 591 | "name": "hostname", 592 | "options": [], 593 | "query": "label_values(vmware_host_boot_timestamp_seconds,host_name)", 594 | "refresh": 1, 595 | "regex": "/([^:]+)/", 596 | "sort": 1, 597 | "tagValuesQuery": "", 598 | "tags": [], 599 | "tagsQuery": "", 600 | "type": "query", 601 | "useTags": false 602 | } 603 | ] 604 | }, 605 | "time": { 606 | "from": "now-5m", 607 | "to": "now" 608 | }, 609 | "timepicker": { 610 | "refresh_intervals": [ 611 | "5s", 612 | "10s", 613 | "30s", 614 | "1m", 615 | "5m", 616 | "15m", 617 | "30m", 618 | "1h", 619 | "2h", 620 | "1d" 621 | ], 622 | "time_options": [ 623 | "5m", 624 | "15m", 625 | "1h", 626 | "6h", 627 | "12h", 628 | "24h", 629 | "2d", 630 | "7d", 631 | "30d" 632 | ] 633 | }, 634 | "timezone": "browser", 635 | "title": "VMware ESX Hosts Information", 636 | "uid": "ed9d4bbf8801a8f79194b2ce6ead0ffcb8f9952a", 637 | "version": 17 638 | } -------------------------------------------------------------------------------- /dashboards/esxi.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "limit": 100, 11 | "name": "Annotations & Alerts", 12 | "showIn": 0, 13 | "type": "dashboard" 14 | } 15 | ] 16 | }, 17 | "description": "VMware ESXi single instance graphs.", 18 | "editable": true, 19 | "gnetId": 10076, 20 | "graphTooltip": 1, 21 | "id": 1, 22 | "iteration": 1574197896776, 23 | "links": [], 24 | "panels": [ 25 | { 26 | "cacheTimeout": null, 27 | "colorBackground": false, 28 | "colorValue": false, 29 | "colors": [ 30 | "#299c46", 31 | "rgba(237, 129, 40, 0.89)", 32 | "#d44a3a" 33 | ], 34 | "datasource": "$datasource", 35 | "format": "short", 36 | "gauge": { 37 | "maxValue": 100, 38 | "minValue": 0, 39 | "show": false, 40 | "thresholdLabels": false, 41 | "thresholdMarkers": true 42 | }, 43 | "gridPos": { 44 | "h": 4, 45 | "w": 4, 46 | "x": 0, 47 | "y": 0 48 | }, 49 | "id": 32, 50 | "interval": null, 51 | "links": [], 52 | "mappingType": 1, 53 | "mappingTypes": [ 54 | { 55 | "name": "value to text", 56 | "value": 1 57 | }, 58 | { 59 | "name": "range to text", 60 | "value": 2 61 | } 62 | ], 63 | "maxDataPoints": 100, 64 | "nullPointMode": "connected", 65 | "nullText": null, 66 | "options": {}, 67 | "postfix": "", 68 | "postfixFontSize": "50%", 69 | "prefix": "", 70 | "prefixFontSize": "50%", 71 | "rangeMaps": [ 72 | { 73 | "from": "null", 74 | "text": "N/A", 75 | "to": "null" 76 | } 77 | ], 78 | "sparkline": { 79 | "fillColor": "rgba(31, 118, 189, 0.18)", 80 | "full": true, 81 | "lineColor": "rgb(31, 120, 193)", 82 | "show": false 83 | }, 84 | "tableColumn": "", 85 | "targets": [ 86 | { 87 | "expr": "(vmware_host_product_info{host_name=~\"$esxhost\"})", 88 | "format": "time_series", 89 | "instant": false, 90 | "intervalFactor": 1, 91 | "legendFormat": "{{ version }}", 92 | "refId": "A" 93 | } 94 | ], 95 | "thresholds": "50,80", 96 | "title": "Version", 97 | "type": "singlestat", 98 | "valueFontSize": "80%", 99 | "valueMaps": [ 100 | { 101 | "op": "=", 102 | "text": "N/A", 103 | "value": "null" 104 | } 105 | ], 106 | "valueName": "name" 107 | }, 108 | { 109 | "cacheTimeout": null, 110 | "colorBackground": false, 111 | "colorValue": false, 112 | "colors": [ 113 | "#299c46", 114 | "rgba(237, 129, 40, 0.89)", 115 | "#d44a3a" 116 | ], 117 | "datasource": "$datasource", 118 | "format": "none", 119 | "gauge": { 120 | "maxValue": 100, 121 | "minValue": 0, 122 | "show": false, 123 | "thresholdLabels": false, 124 | "thresholdMarkers": true 125 | }, 126 | "gridPos": { 127 | "h": 4, 128 | "w": 4, 129 | "x": 4, 130 | "y": 0 131 | }, 132 | "id": 33, 133 | "interval": null, 134 | "links": [], 135 | "mappingType": 1, 136 | "mappingTypes": [ 137 | { 138 | "name": "value to text", 139 | "value": 1 140 | }, 141 | { 142 | "name": "range to text", 143 | "value": 2 144 | } 145 | ], 146 | "maxDataPoints": 100, 147 | "nullPointMode": "connected", 148 | "nullText": null, 149 | "options": {}, 150 | "postfix": "", 151 | "postfixFontSize": "50%", 152 | "prefix": "", 153 | "prefixFontSize": "50%", 154 | "rangeMaps": [ 155 | { 156 | "from": "null", 157 | "text": "N/A", 158 | "to": "null" 159 | } 160 | ], 161 | "sparkline": { 162 | "fillColor": "rgba(31, 118, 189, 0.18)", 163 | "full": true, 164 | "lineColor": "rgb(31, 120, 193)", 165 | "show": false 166 | }, 167 | "tableColumn": "", 168 | "targets": [ 169 | { 170 | "expr": "(vmware_host_product_info{host_name=~\"$esxhost\"})", 171 | "format": "time_series", 172 | "instant": false, 173 | "intervalFactor": 1, 174 | "legendFormat": "{{ build }}", 175 | "refId": "A" 176 | } 177 | ], 178 | "thresholds": "50,80", 179 | "title": "Build", 180 | "type": "singlestat", 181 | "valueFontSize": "80%", 182 | "valueMaps": [ 183 | { 184 | "op": "=", 185 | "text": "N/A", 186 | "value": "null" 187 | } 188 | ], 189 | "valueName": "name" 190 | }, 191 | { 192 | "cacheTimeout": null, 193 | "colorBackground": false, 194 | "colorValue": false, 195 | "colors": [ 196 | "#299c46", 197 | "rgba(237, 129, 40, 0.89)", 198 | "#d44a3a" 199 | ], 200 | "datasource": "$datasource", 201 | "format": "none", 202 | "gauge": { 203 | "maxValue": 100, 204 | "minValue": 0, 205 | "show": false, 206 | "thresholdLabels": false, 207 | "thresholdMarkers": true 208 | }, 209 | "gridPos": { 210 | "h": 4, 211 | "w": 4, 212 | "x": 8, 213 | "y": 0 214 | }, 215 | "id": 36, 216 | "interval": null, 217 | "links": [], 218 | "mappingType": 1, 219 | "mappingTypes": [ 220 | { 221 | "name": "value to text", 222 | "value": 1 223 | }, 224 | { 225 | "name": "range to text", 226 | "value": 2 227 | } 228 | ], 229 | "maxDataPoints": 100, 230 | "nullPointMode": "connected", 231 | "nullText": null, 232 | "options": {}, 233 | "postfix": "", 234 | "postfixFontSize": "50%", 235 | "prefix": "", 236 | "prefixFontSize": "50%", 237 | "rangeMaps": [ 238 | { 239 | "from": "null", 240 | "text": "N/A", 241 | "to": "null" 242 | } 243 | ], 244 | "sparkline": { 245 | "fillColor": "rgba(31, 118, 189, 0.18)", 246 | "full": true, 247 | "lineColor": "rgb(31, 120, 193)", 248 | "show": false 249 | }, 250 | "tableColumn": "", 251 | "targets": [ 252 | { 253 | "expr": "(vmware_host_hardware_info{host_name=~\"$esxhost\"}) ", 254 | "format": "time_series", 255 | "instant": false, 256 | "intervalFactor": 1, 257 | "legendFormat": "{{ hardware_model }}", 258 | "refId": "A" 259 | } 260 | ], 261 | "thresholds": "50,80", 262 | "title": "Model", 263 | "type": "singlestat", 264 | "valueFontSize": "80%", 265 | "valueMaps": [ 266 | { 267 | "op": "=", 268 | "text": "N/A", 269 | "value": "null" 270 | } 271 | ], 272 | "valueName": "name" 273 | }, 274 | { 275 | "cacheTimeout": null, 276 | "colorBackground": false, 277 | "colorValue": false, 278 | "colors": [ 279 | "#299c46", 280 | "rgba(237, 129, 40, 0.89)", 281 | "#d44a3a" 282 | ], 283 | "datasource": "$datasource", 284 | "format": "none", 285 | "gauge": { 286 | "maxValue": 100, 287 | "minValue": 0, 288 | "show": false, 289 | "thresholdLabels": false, 290 | "thresholdMarkers": true 291 | }, 292 | "gridPos": { 293 | "h": 4, 294 | "w": 4, 295 | "x": 12, 296 | "y": 0 297 | }, 298 | "id": 34, 299 | "interval": null, 300 | "links": [], 301 | "mappingType": 1, 302 | "mappingTypes": [ 303 | { 304 | "name": "value to text", 305 | "value": 1 306 | }, 307 | { 308 | "name": "range to text", 309 | "value": 2 310 | } 311 | ], 312 | "maxDataPoints": 100, 313 | "nullPointMode": "connected", 314 | "nullText": null, 315 | "options": {}, 316 | "postfix": "", 317 | "postfixFontSize": "50%", 318 | "prefix": "", 319 | "prefixFontSize": "50%", 320 | "rangeMaps": [ 321 | { 322 | "from": "null", 323 | "text": "N/A", 324 | "to": "null" 325 | } 326 | ], 327 | "sparkline": { 328 | "fillColor": "rgba(31, 118, 189, 0.18)", 329 | "full": true, 330 | "lineColor": "rgb(31, 120, 193)", 331 | "show": false 332 | }, 333 | "tableColumn": "", 334 | "targets": [ 335 | { 336 | "expr": "(vmware_host_product_info{host_name=~\"$esxhost\"})", 337 | "format": "time_series", 338 | "instant": false, 339 | "intervalFactor": 1, 340 | "legendFormat": "{{ cluster_name }}", 341 | "refId": "A" 342 | } 343 | ], 344 | "thresholds": "50,80", 345 | "title": "Cluster", 346 | "type": "singlestat", 347 | "valueFontSize": "80%", 348 | "valueMaps": [ 349 | { 350 | "op": "=", 351 | "text": "N/A", 352 | "value": "null" 353 | } 354 | ], 355 | "valueName": "name" 356 | }, 357 | { 358 | "cacheTimeout": null, 359 | "colorBackground": false, 360 | "colorValue": false, 361 | "colors": [ 362 | "#299c46", 363 | "rgba(237, 129, 40, 0.89)", 364 | "#d44a3a" 365 | ], 366 | "datasource": "$datasource", 367 | "format": "none", 368 | "gauge": { 369 | "maxValue": 100, 370 | "minValue": 0, 371 | "show": false, 372 | "thresholdLabels": false, 373 | "thresholdMarkers": true 374 | }, 375 | "gridPos": { 376 | "h": 4, 377 | "w": 4, 378 | "x": 16, 379 | "y": 0 380 | }, 381 | "id": 37, 382 | "interval": null, 383 | "links": [], 384 | "mappingType": 1, 385 | "mappingTypes": [ 386 | { 387 | "name": "value to text", 388 | "value": 1 389 | }, 390 | { 391 | "name": "range to text", 392 | "value": 2 393 | } 394 | ], 395 | "maxDataPoints": 100, 396 | "nullPointMode": "connected", 397 | "nullText": null, 398 | "options": {}, 399 | "postfix": "", 400 | "postfixFontSize": "50%", 401 | "prefix": "", 402 | "prefixFontSize": "50%", 403 | "rangeMaps": [ 404 | { 405 | "from": "null", 406 | "text": "N/A", 407 | "to": "null" 408 | } 409 | ], 410 | "sparkline": { 411 | "fillColor": "rgba(31, 118, 189, 0.18)", 412 | "full": true, 413 | "lineColor": "rgb(31, 120, 193)", 414 | "show": false 415 | }, 416 | "tableColumn": "", 417 | "targets": [ 418 | { 419 | "expr": "(vmware_host_hardware_info{host_name=~\"$esxhost\"}) ", 420 | "format": "time_series", 421 | "instant": false, 422 | "intervalFactor": 1, 423 | "legendFormat": "{{ hardware_cpu_model }}", 424 | "refId": "A" 425 | } 426 | ], 427 | "thresholds": "50,80", 428 | "title": "Cpu Model", 429 | "type": "singlestat", 430 | "valueFontSize": "80%", 431 | "valueMaps": [ 432 | { 433 | "op": "=", 434 | "text": "N/A", 435 | "value": "null" 436 | } 437 | ], 438 | "valueName": "name" 439 | }, 440 | { 441 | "cacheTimeout": null, 442 | "colorBackground": false, 443 | "colorValue": true, 444 | "colors": [ 445 | "#299c46", 446 | "rgba(237, 129, 40, 0.89)", 447 | "#d44a3a" 448 | ], 449 | "datasource": "$datasource", 450 | "format": "s", 451 | "gauge": { 452 | "maxValue": 100, 453 | "minValue": 0, 454 | "show": false, 455 | "thresholdLabels": false, 456 | "thresholdMarkers": true 457 | }, 458 | "gridPos": { 459 | "h": 4, 460 | "w": 4, 461 | "x": 20, 462 | "y": 0 463 | }, 464 | "id": 6, 465 | "interval": null, 466 | "links": [], 467 | "mappingType": 1, 468 | "mappingTypes": [ 469 | { 470 | "name": "value to text", 471 | "value": 1 472 | }, 473 | { 474 | "name": "range to text", 475 | "value": 2 476 | } 477 | ], 478 | "maxDataPoints": 100, 479 | "nullPointMode": "connected", 480 | "nullText": null, 481 | "options": {}, 482 | "postfix": "", 483 | "postfixFontSize": "50%", 484 | "prefix": "", 485 | "prefixFontSize": "50%", 486 | "rangeMaps": [ 487 | { 488 | "from": "null", 489 | "text": "N/A", 490 | "to": "null" 491 | } 492 | ], 493 | "sparkline": { 494 | "fillColor": "rgba(31, 118, 189, 0.18)", 495 | "full": false, 496 | "lineColor": "rgb(31, 120, 193)", 497 | "show": false 498 | }, 499 | "tableColumn": "", 500 | "targets": [ 501 | { 502 | "expr": "time()-vmware_host_boot_timestamp_seconds{host_name=~\"$esxhost\"} ", 503 | "format": "time_series", 504 | "instant": false, 505 | "intervalFactor": 1, 506 | "refId": "A" 507 | } 508 | ], 509 | "thresholds": "7776000, 15552000", 510 | "title": "ESXi host uptime", 511 | "type": "singlestat", 512 | "valueFontSize": "80%", 513 | "valueMaps": [ 514 | { 515 | "op": "=", 516 | "text": "N/A", 517 | "value": "null" 518 | } 519 | ], 520 | "valueName": "current" 521 | }, 522 | { 523 | "cacheTimeout": null, 524 | "colorBackground": false, 525 | "colorValue": false, 526 | "colors": [ 527 | "#299c46", 528 | "rgba(237, 129, 40, 0.89)", 529 | "#d44a3a" 530 | ], 531 | "datasource": "$datasource", 532 | "format": "short", 533 | "gauge": { 534 | "maxValue": 100, 535 | "minValue": 0, 536 | "show": false, 537 | "thresholdLabels": false, 538 | "thresholdMarkers": true 539 | }, 540 | "gridPos": { 541 | "h": 4, 542 | "w": 4, 543 | "x": 0, 544 | "y": 4 545 | }, 546 | "id": 14, 547 | "interval": null, 548 | "links": [], 549 | "mappingType": 1, 550 | "mappingTypes": [ 551 | { 552 | "name": "value to text", 553 | "value": 1 554 | }, 555 | { 556 | "name": "range to text", 557 | "value": 2 558 | } 559 | ], 560 | "maxDataPoints": 100, 561 | "nullPointMode": "connected", 562 | "nullText": null, 563 | "options": {}, 564 | "postfix": "", 565 | "postfixFontSize": "50%", 566 | "prefix": "", 567 | "prefixFontSize": "50%", 568 | "rangeMaps": [ 569 | { 570 | "from": "null", 571 | "text": "N/A", 572 | "to": "null" 573 | } 574 | ], 575 | "sparkline": { 576 | "fillColor": "rgba(31, 118, 189, 0.18)", 577 | "full": true, 578 | "lineColor": "rgb(31, 120, 193)", 579 | "show": false 580 | }, 581 | "tableColumn": "", 582 | "targets": [ 583 | { 584 | "expr": "(vmware_host_num_cpu{host_name=~\"$esxhost\"})", 585 | "format": "time_series", 586 | "instant": false, 587 | "intervalFactor": 1, 588 | "refId": "A" 589 | } 590 | ], 591 | "thresholds": "50,80", 592 | "title": "Cpu Number", 593 | "type": "singlestat", 594 | "valueFontSize": "80%", 595 | "valueMaps": [ 596 | { 597 | "op": "=", 598 | "text": "N/A", 599 | "value": "null" 600 | } 601 | ], 602 | "valueName": "avg" 603 | }, 604 | { 605 | "cacheTimeout": null, 606 | "colorBackground": false, 607 | "colorValue": false, 608 | "colors": [ 609 | "#299c46", 610 | "rgba(237, 129, 40, 0.89)", 611 | "#d44a3a" 612 | ], 613 | "datasource": "$datasource", 614 | "format": "decmbytes", 615 | "gauge": { 616 | "maxValue": 100, 617 | "minValue": 0, 618 | "show": false, 619 | "thresholdLabels": false, 620 | "thresholdMarkers": true 621 | }, 622 | "gridPos": { 623 | "h": 4, 624 | "w": 4, 625 | "x": 4, 626 | "y": 4 627 | }, 628 | "id": 15, 629 | "interval": null, 630 | "links": [], 631 | "mappingType": 1, 632 | "mappingTypes": [ 633 | { 634 | "name": "value to text", 635 | "value": 1 636 | }, 637 | { 638 | "name": "range to text", 639 | "value": 2 640 | } 641 | ], 642 | "maxDataPoints": 100, 643 | "nullPointMode": "connected", 644 | "nullText": null, 645 | "options": {}, 646 | "postfix": "", 647 | "postfixFontSize": "50%", 648 | "prefix": "", 649 | "prefixFontSize": "50%", 650 | "rangeMaps": [ 651 | { 652 | "from": "null", 653 | "text": "N/A", 654 | "to": "null" 655 | } 656 | ], 657 | "sparkline": { 658 | "fillColor": "rgba(31, 118, 189, 0.18)", 659 | "full": true, 660 | "lineColor": "rgb(31, 120, 193)", 661 | "show": false 662 | }, 663 | "tableColumn": "", 664 | "targets": [ 665 | { 666 | "expr": "(vmware_host_memory_max{host_name=~\"$esxhost\"})", 667 | "format": "time_series", 668 | "instant": false, 669 | "intervalFactor": 1, 670 | "refId": "A" 671 | } 672 | ], 673 | "thresholds": "50,80", 674 | "title": "Memory Capaciy", 675 | "type": "singlestat", 676 | "valueFontSize": "80%", 677 | "valueMaps": [ 678 | { 679 | "op": "=", 680 | "text": "N/A", 681 | "value": "null" 682 | } 683 | ], 684 | "valueName": "avg" 685 | }, 686 | { 687 | "cacheTimeout": null, 688 | "datasource": "$datasource", 689 | "gridPos": { 690 | "h": 4, 691 | "w": 4, 692 | "x": 8, 693 | "y": 4 694 | }, 695 | "id": 12, 696 | "links": [], 697 | "options": { 698 | "fieldOptions": { 699 | "calcs": [ 700 | "lastNotNull" 701 | ], 702 | "defaults": { 703 | "mappings": [ 704 | { 705 | "id": 0, 706 | "op": "=", 707 | "text": "N/A", 708 | "type": 1, 709 | "value": "null" 710 | } 711 | ], 712 | "max": 100, 713 | "min": 0, 714 | "nullValueMode": "connected", 715 | "thresholds": [ 716 | { 717 | "color": "#299c46", 718 | "value": null 719 | }, 720 | { 721 | "color": "rgba(237, 129, 40, 0.89)", 722 | "value": 50 723 | }, 724 | { 725 | "color": "#d44a3a", 726 | "value": 80 727 | } 728 | ], 729 | "unit": "percent" 730 | }, 731 | "override": {}, 732 | "values": false 733 | }, 734 | "orientation": "horizontal", 735 | "showThresholdLabels": false, 736 | "showThresholdMarkers": true 737 | }, 738 | "pluginVersion": "6.4.1", 739 | "targets": [ 740 | { 741 | "expr": "(vmware_host_cpu_usagemhz_average{host_name=~\"$esxhost\"}) * 100 / (vmware_host_cpu_max{host_name=~\"$esxhost\"})", 742 | "format": "time_series", 743 | "instant": false, 744 | "intervalFactor": 1, 745 | "refId": "A" 746 | } 747 | ], 748 | "title": "Host CPU Usage", 749 | "type": "gauge" 750 | }, 751 | { 752 | "cacheTimeout": null, 753 | "datasource": "$datasource", 754 | "gridPos": { 755 | "h": 4, 756 | "w": 4, 757 | "x": 12, 758 | "y": 4 759 | }, 760 | "id": 25, 761 | "links": [], 762 | "options": { 763 | "fieldOptions": { 764 | "calcs": [ 765 | "lastNotNull" 766 | ], 767 | "defaults": { 768 | "mappings": [ 769 | { 770 | "id": 0, 771 | "op": "=", 772 | "text": "N/A", 773 | "type": 1, 774 | "value": "null" 775 | } 776 | ], 777 | "max": 20, 778 | "min": 0, 779 | "nullValueMode": "connected", 780 | "thresholds": [ 781 | { 782 | "color": "#299c46", 783 | "value": null 784 | }, 785 | { 786 | "color": "rgba(237, 129, 40, 0.89)", 787 | "value": 5 788 | }, 789 | { 790 | "color": "#d44a3a", 791 | "value": 10 792 | } 793 | ], 794 | "unit": "percent" 795 | }, 796 | "override": {}, 797 | "values": false 798 | }, 799 | "orientation": "horizontal", 800 | "showThresholdLabels": false, 801 | "showThresholdMarkers": true 802 | }, 803 | "pluginVersion": "6.4.1", 804 | "targets": [ 805 | { 806 | "expr": "vmware_host_cpu_ready_summation{host_name=~\"$esxhost\"}/200", 807 | "legendFormat": "Cpu Ready", 808 | "refId": "B" 809 | } 810 | ], 811 | "title": "Current Cpu Ready", 812 | "type": "gauge" 813 | }, 814 | { 815 | "cacheTimeout": null, 816 | "datasource": "$datasource", 817 | "gridPos": { 818 | "h": 4, 819 | "w": 4, 820 | "x": 16, 821 | "y": 4 822 | }, 823 | "id": 26, 824 | "links": [], 825 | "options": { 826 | "fieldOptions": { 827 | "calcs": [ 828 | "lastNotNull" 829 | ], 830 | "defaults": { 831 | "mappings": [ 832 | { 833 | "id": 0, 834 | "op": "=", 835 | "text": "N/A", 836 | "type": 1, 837 | "value": "null" 838 | } 839 | ], 840 | "max": 10, 841 | "min": 0, 842 | "nullValueMode": "connected", 843 | "thresholds": [ 844 | { 845 | "color": "#299c46", 846 | "value": null 847 | }, 848 | { 849 | "color": "rgba(237, 129, 40, 0.89)", 850 | "value": 1 851 | }, 852 | { 853 | "color": "#d44a3a", 854 | "value": 3 855 | } 856 | ], 857 | "unit": "percent" 858 | }, 859 | "override": {}, 860 | "values": false 861 | }, 862 | "orientation": "horizontal", 863 | "showThresholdLabels": false, 864 | "showThresholdMarkers": true 865 | }, 866 | "pluginVersion": "6.4.1", 867 | "targets": [ 868 | { 869 | "expr": "vmware_host_cpu_costop_summation{host_name=~\"$esxhost\"}/200", 870 | "format": "time_series", 871 | "instant": false, 872 | "intervalFactor": 1, 873 | "refId": "A" 874 | } 875 | ], 876 | "title": "Current Cpu Co-Stop", 877 | "type": "gauge" 878 | }, 879 | { 880 | "cacheTimeout": null, 881 | "colorBackground": false, 882 | "colorValue": false, 883 | "colors": [ 884 | "#299c46", 885 | "rgba(237, 129, 40, 0.89)", 886 | "#d44a3a" 887 | ], 888 | "datasource": "$datasource", 889 | "format": "percent", 890 | "gauge": { 891 | "maxValue": 100, 892 | "minValue": 0, 893 | "show": true, 894 | "thresholdLabels": false, 895 | "thresholdMarkers": true 896 | }, 897 | "gridPos": { 898 | "h": 4, 899 | "w": 4, 900 | "x": 20, 901 | "y": 4 902 | }, 903 | "id": 13, 904 | "interval": null, 905 | "links": [], 906 | "mappingType": 1, 907 | "mappingTypes": [ 908 | { 909 | "name": "value to text", 910 | "value": 1 911 | }, 912 | { 913 | "name": "range to text", 914 | "value": 2 915 | } 916 | ], 917 | "maxDataPoints": 100, 918 | "nullPointMode": "connected", 919 | "nullText": null, 920 | "options": {}, 921 | "postfix": "", 922 | "postfixFontSize": "50%", 923 | "prefix": "", 924 | "prefixFontSize": "50%", 925 | "rangeMaps": [ 926 | { 927 | "from": "null", 928 | "text": "N/A", 929 | "to": "null" 930 | } 931 | ], 932 | "sparkline": { 933 | "fillColor": "rgba(31, 118, 189, 0.18)", 934 | "full": true, 935 | "lineColor": "rgb(31, 120, 193)", 936 | "show": false 937 | }, 938 | "tableColumn": "", 939 | "targets": [ 940 | { 941 | "expr": "(vmware_host_memory_usage{host_name=~\"$esxhost\"}) * 100 / (vmware_host_memory_max{host_name=~\"$esxhost\"})", 942 | "format": "time_series", 943 | "instant": true, 944 | "intervalFactor": 1, 945 | "refId": "A" 946 | } 947 | ], 948 | "thresholds": "50,80", 949 | "title": "Host Memory usage", 950 | "type": "singlestat", 951 | "valueFontSize": "80%", 952 | "valueMaps": [ 953 | { 954 | "op": "=", 955 | "text": "N/A", 956 | "value": "null" 957 | } 958 | ], 959 | "valueName": "current" 960 | }, 961 | { 962 | "aliasColors": {}, 963 | "bars": false, 964 | "cacheTimeout": null, 965 | "dashLength": 10, 966 | "dashes": false, 967 | "datasource": "$datasource", 968 | "fill": 1, 969 | "fillGradient": 0, 970 | "gridPos": { 971 | "h": 6, 972 | "w": 24, 973 | "x": 0, 974 | "y": 8 975 | }, 976 | "id": 17, 977 | "legend": { 978 | "alignAsTable": true, 979 | "avg": true, 980 | "current": false, 981 | "max": true, 982 | "min": true, 983 | "rightSide": true, 984 | "show": true, 985 | "total": false, 986 | "values": true 987 | }, 988 | "lines": true, 989 | "linewidth": 1, 990 | "links": [], 991 | "nullPointMode": "null", 992 | "options": { 993 | "dataLinks": [] 994 | }, 995 | "percentage": false, 996 | "pointradius": 2, 997 | "points": false, 998 | "renderer": "flot", 999 | "seriesOverrides": [], 1000 | "spaceLength": 10, 1001 | "stack": false, 1002 | "steppedLine": false, 1003 | "targets": [ 1004 | { 1005 | "expr": "(vmware_host_cpu_usagemhz_average{host_name=~\"$esxhost\"}) * 100 / (vmware_host_cpu_max{host_name=~\"$esxhost\"})", 1006 | "legendFormat": "Cpu Usage", 1007 | "refId": "B" 1008 | }, 1009 | { 1010 | "expr": "(vmware_host_cpu_demand_average{host_name=~\"$esxhost\"}) * 100 / (vmware_host_cpu_max{host_name=~\"$esxhost\"})", 1011 | "legendFormat": "CPU Demand", 1012 | "refId": "A" 1013 | } 1014 | ], 1015 | "thresholds": [], 1016 | "timeFrom": null, 1017 | "timeRegions": [], 1018 | "timeShift": null, 1019 | "title": "Host CPU usage", 1020 | "tooltip": { 1021 | "shared": true, 1022 | "sort": 0, 1023 | "value_type": "individual" 1024 | }, 1025 | "type": "graph", 1026 | "xaxis": { 1027 | "buckets": null, 1028 | "mode": "time", 1029 | "name": null, 1030 | "show": true, 1031 | "values": [] 1032 | }, 1033 | "yaxes": [ 1034 | { 1035 | "decimals": 1, 1036 | "format": "percent", 1037 | "label": null, 1038 | "logBase": 1, 1039 | "max": null, 1040 | "min": null, 1041 | "show": true 1042 | }, 1043 | { 1044 | "format": "short", 1045 | "label": null, 1046 | "logBase": 1, 1047 | "max": null, 1048 | "min": null, 1049 | "show": true 1050 | } 1051 | ], 1052 | "yaxis": { 1053 | "align": false, 1054 | "alignLevel": null 1055 | } 1056 | }, 1057 | { 1058 | "aliasColors": {}, 1059 | "bars": false, 1060 | "cacheTimeout": null, 1061 | "dashLength": 10, 1062 | "dashes": false, 1063 | "datasource": "$datasource", 1064 | "fill": 1, 1065 | "fillGradient": 0, 1066 | "gridPos": { 1067 | "h": 6, 1068 | "w": 24, 1069 | "x": 0, 1070 | "y": 14 1071 | }, 1072 | "id": 39, 1073 | "legend": { 1074 | "alignAsTable": true, 1075 | "avg": true, 1076 | "current": false, 1077 | "max": true, 1078 | "min": true, 1079 | "rightSide": true, 1080 | "show": true, 1081 | "total": false, 1082 | "values": true 1083 | }, 1084 | "lines": true, 1085 | "linewidth": 1, 1086 | "links": [], 1087 | "nullPointMode": "null", 1088 | "options": { 1089 | "dataLinks": [] 1090 | }, 1091 | "percentage": false, 1092 | "pointradius": 2, 1093 | "points": false, 1094 | "renderer": "flot", 1095 | "seriesOverrides": [], 1096 | "spaceLength": 10, 1097 | "stack": false, 1098 | "steppedLine": false, 1099 | "targets": [ 1100 | { 1101 | "expr": "vmware_host_cpu_ready_summation{host_name=~\"$esxhost\"}/200", 1102 | "format": "time_series", 1103 | "intervalFactor": 1, 1104 | "legendFormat": "Cpu Ready", 1105 | "refId": "A" 1106 | }, 1107 | { 1108 | "expr": "vmware_host_cpu_costop_summation{host_name=~\"$esxhost\"}/200", 1109 | "legendFormat": "Cpu Co-Stop", 1110 | "refId": "B" 1111 | }, 1112 | { 1113 | "expr": "vmware_host_cpu_swapwait_summation{host_name=~\"$esxhost\"}/200", 1114 | "legendFormat": "Cpu Swap Wait", 1115 | "refId": "C" 1116 | } 1117 | ], 1118 | "thresholds": [], 1119 | "timeFrom": null, 1120 | "timeRegions": [], 1121 | "timeShift": null, 1122 | "title": "Host Cpu Contention", 1123 | "tooltip": { 1124 | "shared": true, 1125 | "sort": 0, 1126 | "value_type": "individual" 1127 | }, 1128 | "type": "graph", 1129 | "xaxis": { 1130 | "buckets": null, 1131 | "mode": "time", 1132 | "name": null, 1133 | "show": true, 1134 | "values": [] 1135 | }, 1136 | "yaxes": [ 1137 | { 1138 | "decimals": 1, 1139 | "format": "percent", 1140 | "label": null, 1141 | "logBase": 1, 1142 | "max": null, 1143 | "min": null, 1144 | "show": true 1145 | }, 1146 | { 1147 | "format": "short", 1148 | "label": null, 1149 | "logBase": 1, 1150 | "max": null, 1151 | "min": null, 1152 | "show": true 1153 | } 1154 | ], 1155 | "yaxis": { 1156 | "align": false, 1157 | "alignLevel": null 1158 | } 1159 | }, 1160 | { 1161 | "aliasColors": {}, 1162 | "bars": false, 1163 | "cacheTimeout": null, 1164 | "dashLength": 10, 1165 | "dashes": false, 1166 | "datasource": "$datasource", 1167 | "fill": 1, 1168 | "fillGradient": 0, 1169 | "gridPos": { 1170 | "h": 6, 1171 | "w": 24, 1172 | "x": 0, 1173 | "y": 20 1174 | }, 1175 | "id": 18, 1176 | "legend": { 1177 | "alignAsTable": true, 1178 | "avg": true, 1179 | "current": false, 1180 | "max": true, 1181 | "min": true, 1182 | "rightSide": true, 1183 | "show": true, 1184 | "total": false, 1185 | "values": true 1186 | }, 1187 | "lines": true, 1188 | "linewidth": 1, 1189 | "links": [], 1190 | "nullPointMode": "null", 1191 | "options": { 1192 | "dataLinks": [] 1193 | }, 1194 | "percentage": false, 1195 | "pointradius": 2, 1196 | "points": false, 1197 | "renderer": "flot", 1198 | "seriesOverrides": [], 1199 | "spaceLength": 10, 1200 | "stack": false, 1201 | "steppedLine": false, 1202 | "targets": [ 1203 | { 1204 | "expr": "(vmware_host_mem_usage_average{host_name=~\"$esxhost\"}) * 100 / (vmware_host_memory_max{host_name=~\"$esxhost\"})", 1205 | "format": "time_series", 1206 | "intervalFactor": 1, 1207 | "legendFormat": "Memory Consumed", 1208 | "refId": "A" 1209 | }, 1210 | { 1211 | "expr": "(vmware_host_mem_active_average{host_name=~\"$esxhost\"})/1024 * 100 / (vmware_host_memory_max{host_name=~\"$esxhost\"})", 1212 | "legendFormat": "Memory Active", 1213 | "refId": "B" 1214 | } 1215 | ], 1216 | "thresholds": [], 1217 | "timeFrom": null, 1218 | "timeRegions": [], 1219 | "timeShift": null, 1220 | "title": "Host Memory usage", 1221 | "tooltip": { 1222 | "shared": true, 1223 | "sort": 0, 1224 | "value_type": "individual" 1225 | }, 1226 | "type": "graph", 1227 | "xaxis": { 1228 | "buckets": null, 1229 | "mode": "time", 1230 | "name": null, 1231 | "show": true, 1232 | "values": [] 1233 | }, 1234 | "yaxes": [ 1235 | { 1236 | "decimals": 1, 1237 | "format": "percent", 1238 | "label": null, 1239 | "logBase": 1, 1240 | "max": null, 1241 | "min": null, 1242 | "show": true 1243 | }, 1244 | { 1245 | "format": "short", 1246 | "label": null, 1247 | "logBase": 1, 1248 | "max": null, 1249 | "min": null, 1250 | "show": true 1251 | } 1252 | ], 1253 | "yaxis": { 1254 | "align": false, 1255 | "alignLevel": null 1256 | } 1257 | }, 1258 | { 1259 | "aliasColors": {}, 1260 | "bars": false, 1261 | "cacheTimeout": null, 1262 | "dashLength": 10, 1263 | "dashes": false, 1264 | "datasource": "$datasource", 1265 | "fill": 1, 1266 | "fillGradient": 0, 1267 | "gridPos": { 1268 | "h": 6, 1269 | "w": 24, 1270 | "x": 0, 1271 | "y": 26 1272 | }, 1273 | "id": 40, 1274 | "legend": { 1275 | "alignAsTable": true, 1276 | "avg": true, 1277 | "current": false, 1278 | "max": true, 1279 | "min": true, 1280 | "rightSide": true, 1281 | "show": true, 1282 | "total": false, 1283 | "values": true 1284 | }, 1285 | "lines": true, 1286 | "linewidth": 1, 1287 | "links": [], 1288 | "nullPointMode": "null", 1289 | "options": { 1290 | "dataLinks": [] 1291 | }, 1292 | "percentage": false, 1293 | "pointradius": 2, 1294 | "points": false, 1295 | "renderer": "flot", 1296 | "seriesOverrides": [], 1297 | "spaceLength": 10, 1298 | "stack": false, 1299 | "steppedLine": false, 1300 | "targets": [ 1301 | { 1302 | "expr": "vmware_host_mem_vmmemctl_average{host_name=~\"$esxhost\"}", 1303 | "legendFormat": "Memory Balloon", 1304 | "refId": "B" 1305 | }, 1306 | { 1307 | "expr": "vmware_host_mem_latency_average{host_name=~\"$esxhost\"}", 1308 | "legendFormat": "Memory Latency", 1309 | "refId": "C" 1310 | }, 1311 | { 1312 | "expr": "vmware_host_mem_swapinRate_average{host_name=~\"$esxhost\"}", 1313 | "legendFormat": "Memory SwapInRate", 1314 | "refId": "D" 1315 | }, 1316 | { 1317 | "expr": "vmware_host_mem_swapoutRate_average{host_name=~\"$esxhost\"}", 1318 | "legendFormat": "Memory SwapOutRate", 1319 | "refId": "A" 1320 | } 1321 | ], 1322 | "thresholds": [], 1323 | "timeFrom": null, 1324 | "timeRegions": [], 1325 | "timeShift": null, 1326 | "title": "Host Memory usage", 1327 | "tooltip": { 1328 | "shared": true, 1329 | "sort": 0, 1330 | "value_type": "individual" 1331 | }, 1332 | "type": "graph", 1333 | "xaxis": { 1334 | "buckets": null, 1335 | "mode": "time", 1336 | "name": null, 1337 | "show": true, 1338 | "values": [] 1339 | }, 1340 | "yaxes": [ 1341 | { 1342 | "decimals": 1, 1343 | "format": "percent", 1344 | "label": null, 1345 | "logBase": 1, 1346 | "max": null, 1347 | "min": null, 1348 | "show": true 1349 | }, 1350 | { 1351 | "format": "short", 1352 | "label": null, 1353 | "logBase": 1, 1354 | "max": null, 1355 | "min": null, 1356 | "show": true 1357 | } 1358 | ], 1359 | "yaxis": { 1360 | "align": false, 1361 | "alignLevel": null 1362 | } 1363 | }, 1364 | { 1365 | "aliasColors": {}, 1366 | "bars": false, 1367 | "cacheTimeout": null, 1368 | "dashLength": 10, 1369 | "dashes": false, 1370 | "datasource": "$datasource", 1371 | "decimals": 1, 1372 | "fill": 1, 1373 | "fillGradient": 0, 1374 | "gridPos": { 1375 | "h": 6, 1376 | "w": 24, 1377 | "x": 0, 1378 | "y": 32 1379 | }, 1380 | "id": 19, 1381 | "legend": { 1382 | "alignAsTable": true, 1383 | "avg": true, 1384 | "current": false, 1385 | "max": true, 1386 | "min": true, 1387 | "rightSide": true, 1388 | "show": true, 1389 | "total": false, 1390 | "values": true 1391 | }, 1392 | "lines": true, 1393 | "linewidth": 1, 1394 | "links": [], 1395 | "nullPointMode": "null", 1396 | "options": { 1397 | "dataLinks": [] 1398 | }, 1399 | "percentage": false, 1400 | "pointradius": 2, 1401 | "points": false, 1402 | "renderer": "flot", 1403 | "seriesOverrides": [], 1404 | "spaceLength": 10, 1405 | "stack": false, 1406 | "steppedLine": false, 1407 | "targets": [ 1408 | { 1409 | "expr": "vmware_host_net_usage_average{host_name=~\"$esxhost\"}", 1410 | "format": "time_series", 1411 | "intervalFactor": 1, 1412 | "legendFormat": "Total Usage", 1413 | "refId": "A" 1414 | }, 1415 | { 1416 | "expr": "vmware_host_net_bytesRX_average{host_name=~\"$esxhost\"}", 1417 | "legendFormat": "Usage RX", 1418 | "refId": "B" 1419 | }, 1420 | { 1421 | "expr": "vmware_host_net_bytesTX_average{host_name=~\"$esxhost\"}", 1422 | "legendFormat": "Usage TX", 1423 | "refId": "C" 1424 | }, 1425 | { 1426 | "expr": "sum(vmware_vm_net_broadcastRx_summation{host_name=~\"$esxhost\"})", 1427 | "legendFormat": "Broadcast RX", 1428 | "refId": "D" 1429 | }, 1430 | { 1431 | "expr": "sum(vmware_vm_net_broadcastTx_summation{host_name=~\"$esxhost\"})", 1432 | "legendFormat": "Broadcast TX", 1433 | "refId": "E" 1434 | }, 1435 | { 1436 | "expr": "sum(vmware_vm_net_multicastRx_summation{host_name=~\"$esxhost\"})", 1437 | "legendFormat": "Multicast RX", 1438 | "refId": "F" 1439 | }, 1440 | { 1441 | "expr": "sum(vmware_vm_net_multicastTx_summation{host_name=~\"$esxhost\"})", 1442 | "legendFormat": "Multicast TX", 1443 | "refId": "G" 1444 | } 1445 | ], 1446 | "thresholds": [], 1447 | "timeFrom": null, 1448 | "timeRegions": [], 1449 | "timeShift": null, 1450 | "title": "Host Network Usage", 1451 | "tooltip": { 1452 | "shared": true, 1453 | "sort": 0, 1454 | "value_type": "individual" 1455 | }, 1456 | "type": "graph", 1457 | "xaxis": { 1458 | "buckets": null, 1459 | "mode": "time", 1460 | "name": null, 1461 | "show": true, 1462 | "values": [] 1463 | }, 1464 | "yaxes": [ 1465 | { 1466 | "decimals": 1, 1467 | "format": "KBs", 1468 | "label": null, 1469 | "logBase": 1, 1470 | "max": null, 1471 | "min": null, 1472 | "show": true 1473 | }, 1474 | { 1475 | "format": "short", 1476 | "label": null, 1477 | "logBase": 1, 1478 | "max": null, 1479 | "min": null, 1480 | "show": true 1481 | } 1482 | ], 1483 | "yaxis": { 1484 | "align": false, 1485 | "alignLevel": null 1486 | } 1487 | }, 1488 | { 1489 | "aliasColors": {}, 1490 | "bars": false, 1491 | "cacheTimeout": null, 1492 | "dashLength": 10, 1493 | "dashes": false, 1494 | "datasource": "$datasource", 1495 | "decimals": 1, 1496 | "fill": 1, 1497 | "fillGradient": 0, 1498 | "gridPos": { 1499 | "h": 6, 1500 | "w": 24, 1501 | "x": 0, 1502 | "y": 38 1503 | }, 1504 | "id": 38, 1505 | "legend": { 1506 | "alignAsTable": true, 1507 | "avg": true, 1508 | "current": false, 1509 | "max": true, 1510 | "min": true, 1511 | "rightSide": true, 1512 | "show": true, 1513 | "total": false, 1514 | "values": true 1515 | }, 1516 | "lines": true, 1517 | "linewidth": 1, 1518 | "links": [], 1519 | "nullPointMode": "null", 1520 | "options": { 1521 | "dataLinks": [] 1522 | }, 1523 | "percentage": false, 1524 | "pointradius": 2, 1525 | "points": false, 1526 | "renderer": "flot", 1527 | "seriesOverrides": [], 1528 | "spaceLength": 10, 1529 | "stack": false, 1530 | "steppedLine": false, 1531 | "targets": [ 1532 | { 1533 | "expr": "vmware_host_net_errorRX_summation{host_name=~\"$esxhost\"} OR vector(0)", 1534 | "format": "time_series", 1535 | "intervalFactor": 1, 1536 | "legendFormat": "Error RX", 1537 | "refId": "A" 1538 | }, 1539 | { 1540 | "expr": "vmware_host_net_errorTX_summation{host_name=~\"$esxhost\"} OR vector(0) ", 1541 | "legendFormat": "Error TX", 1542 | "refId": "B" 1543 | }, 1544 | { 1545 | "expr": "vmware_host_net_droppedTX_summation{host_name=~\"$esxhost\"} OR vector(0)", 1546 | "legendFormat": "Dropped TX", 1547 | "refId": "C" 1548 | }, 1549 | { 1550 | "expr": "vmware_host_net_droppedRX_summation{host_name=~\"$esxhost\"} OR vector(0)", 1551 | "legendFormat": "Dropped RX", 1552 | "refId": "D" 1553 | } 1554 | ], 1555 | "thresholds": [], 1556 | "timeFrom": null, 1557 | "timeRegions": [], 1558 | "timeShift": null, 1559 | "title": "Host Network Contention", 1560 | "tooltip": { 1561 | "shared": true, 1562 | "sort": 0, 1563 | "value_type": "individual" 1564 | }, 1565 | "type": "graph", 1566 | "xaxis": { 1567 | "buckets": null, 1568 | "mode": "time", 1569 | "name": null, 1570 | "show": true, 1571 | "values": [] 1572 | }, 1573 | "yaxes": [ 1574 | { 1575 | "decimals": 1, 1576 | "format": "short", 1577 | "label": null, 1578 | "logBase": 1, 1579 | "max": null, 1580 | "min": null, 1581 | "show": true 1582 | }, 1583 | { 1584 | "format": "short", 1585 | "label": null, 1586 | "logBase": 1, 1587 | "max": null, 1588 | "min": null, 1589 | "show": true 1590 | } 1591 | ], 1592 | "yaxis": { 1593 | "align": false, 1594 | "alignLevel": null 1595 | } 1596 | }, 1597 | { 1598 | "aliasColors": {}, 1599 | "bars": false, 1600 | "cacheTimeout": null, 1601 | "dashLength": 10, 1602 | "dashes": false, 1603 | "datasource": "$datasource", 1604 | "fill": 1, 1605 | "fillGradient": 0, 1606 | "gridPos": { 1607 | "h": 6, 1608 | "w": 24, 1609 | "x": 0, 1610 | "y": 44 1611 | }, 1612 | "id": 20, 1613 | "legend": { 1614 | "alignAsTable": true, 1615 | "avg": true, 1616 | "current": false, 1617 | "max": true, 1618 | "min": true, 1619 | "rightSide": true, 1620 | "show": true, 1621 | "total": false, 1622 | "values": true 1623 | }, 1624 | "lines": true, 1625 | "linewidth": 1, 1626 | "links": [], 1627 | "nullPointMode": "null", 1628 | "options": { 1629 | "dataLinks": [] 1630 | }, 1631 | "percentage": false, 1632 | "pointradius": 2, 1633 | "points": false, 1634 | "renderer": "flot", 1635 | "seriesOverrides": [], 1636 | "spaceLength": 10, 1637 | "stack": false, 1638 | "steppedLine": false, 1639 | "targets": [ 1640 | { 1641 | "expr": "vmware_host_disk_read_average{host_name=~\"$esxhost\"}+vmware_host_disk_write_average{host_name=~\"$esxhost\"}", 1642 | "format": "time_series", 1643 | "intervalFactor": 1, 1644 | "legendFormat": "Disk Read and Write", 1645 | "refId": "A" 1646 | }, 1647 | { 1648 | "expr": "vmware_host_disk_read_average{host_name=~\"$esxhost\"}", 1649 | "legendFormat": "Disk Read", 1650 | "refId": "B" 1651 | }, 1652 | { 1653 | "expr": "vmware_host_disk_write_average{host_name=~\"$esxhost\"}", 1654 | "legendFormat": "Disk Write", 1655 | "refId": "C" 1656 | } 1657 | ], 1658 | "thresholds": [], 1659 | "timeFrom": null, 1660 | "timeRegions": [], 1661 | "timeShift": null, 1662 | "title": "Disk R/W Rate", 1663 | "tooltip": { 1664 | "shared": true, 1665 | "sort": 0, 1666 | "value_type": "individual" 1667 | }, 1668 | "type": "graph", 1669 | "xaxis": { 1670 | "buckets": null, 1671 | "mode": "time", 1672 | "name": null, 1673 | "show": true, 1674 | "values": [] 1675 | }, 1676 | "yaxes": [ 1677 | { 1678 | "decimals": 1, 1679 | "format": "KBs", 1680 | "label": null, 1681 | "logBase": 1, 1682 | "max": null, 1683 | "min": null, 1684 | "show": true 1685 | }, 1686 | { 1687 | "format": "short", 1688 | "label": null, 1689 | "logBase": 1, 1690 | "max": null, 1691 | "min": null, 1692 | "show": true 1693 | } 1694 | ], 1695 | "yaxis": { 1696 | "align": false, 1697 | "alignLevel": null 1698 | } 1699 | } 1700 | ], 1701 | "schemaVersion": 20, 1702 | "style": "dark", 1703 | "tags": [ 1704 | "vmware", 1705 | "esxi" 1706 | ], 1707 | "templating": { 1708 | "list": [ 1709 | { 1710 | "current": { 1711 | "text": "Prometheus", 1712 | "value": "Prometheus" 1713 | }, 1714 | "hide": 0, 1715 | "includeAll": false, 1716 | "label": "Datasource", 1717 | "multi": false, 1718 | "name": "datasource", 1719 | "options": [], 1720 | "query": "prometheus", 1721 | "refresh": 1, 1722 | "regex": "", 1723 | "skipUrlSync": false, 1724 | "type": "datasource" 1725 | }, 1726 | { 1727 | "allValue": null, 1728 | "current": { 1729 | "text": "192.168.0.27", 1730 | "value": "192.168.0.27" 1731 | }, 1732 | "datasource": "$datasource", 1733 | "definition": "", 1734 | "hide": 0, 1735 | "includeAll": false, 1736 | "label": "esxhost", 1737 | "multi": true, 1738 | "name": "esxhost", 1739 | "options": [], 1740 | "query": "label_values(vmware_host_boot_timestamp_seconds,host_name)", 1741 | "refresh": 1, 1742 | "regex": "", 1743 | "skipUrlSync": false, 1744 | "sort": 0, 1745 | "tagValuesQuery": "", 1746 | "tags": [], 1747 | "tagsQuery": "", 1748 | "type": "query", 1749 | "useTags": false 1750 | } 1751 | ] 1752 | }, 1753 | "time": { 1754 | "from": "now-15m", 1755 | "to": "now" 1756 | }, 1757 | "timepicker": { 1758 | "hidden": false, 1759 | "refresh_intervals": [ 1760 | "5s", 1761 | "10s", 1762 | "30s", 1763 | "1m", 1764 | "5m", 1765 | "15m", 1766 | "30m", 1767 | "1h", 1768 | "2h", 1769 | "1d" 1770 | ], 1771 | "time_options": [ 1772 | "5m", 1773 | "15m", 1774 | "1h", 1775 | "6h", 1776 | "12h", 1777 | "24h", 1778 | "2d", 1779 | "7d", 1780 | "30d" 1781 | ] 1782 | }, 1783 | "timezone": "browser", 1784 | "title": "VMware ESXi Import", 1785 | "uid": "_gg9LEqmk", 1786 | "version": 15 1787 | } 1788 | -------------------------------------------------------------------------------- /dashboards/virtualmachine.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "limit": 100, 11 | "name": "Annotations & Alerts", 12 | "showIn": 0, 13 | "type": "dashboard" 14 | } 15 | ] 16 | }, 17 | "description": "VMware ESXi single instance graphs.", 18 | "editable": true, 19 | "gnetId": 10076, 20 | "graphTooltip": 1, 21 | "id": 4, 22 | "iteration": 1574197942675, 23 | "links": [], 24 | "panels": [ 25 | { 26 | "cacheTimeout": null, 27 | "colorBackground": false, 28 | "colorValue": false, 29 | "colors": [ 30 | "#299c46", 31 | "rgba(237, 129, 40, 0.89)", 32 | "#d44a3a" 33 | ], 34 | "datasource": "$datasource", 35 | "format": "none", 36 | "gauge": { 37 | "maxValue": 100, 38 | "minValue": 0, 39 | "show": false, 40 | "thresholdLabels": false, 41 | "thresholdMarkers": true 42 | }, 43 | "gridPos": { 44 | "h": 3, 45 | "w": 4, 46 | "x": 0, 47 | "y": 0 48 | }, 49 | "id": 34, 50 | "interval": null, 51 | "links": [], 52 | "mappingType": 1, 53 | "mappingTypes": [ 54 | { 55 | "name": "value to text", 56 | "value": 1 57 | }, 58 | { 59 | "name": "range to text", 60 | "value": 2 61 | } 62 | ], 63 | "maxDataPoints": 100, 64 | "nullPointMode": "connected", 65 | "nullText": null, 66 | "options": {}, 67 | "postfix": "", 68 | "postfixFontSize": "50%", 69 | "prefix": "", 70 | "prefixFontSize": "50%", 71 | "rangeMaps": [ 72 | { 73 | "from": "null", 74 | "text": "N/A", 75 | "to": "null" 76 | } 77 | ], 78 | "sparkline": { 79 | "fillColor": "rgba(31, 118, 189, 0.18)", 80 | "full": true, 81 | "lineColor": "rgb(31, 120, 193)", 82 | "show": false 83 | }, 84 | "tableColumn": "", 85 | "targets": [ 86 | { 87 | "expr": "(vmware_vm_boot_timestamp_seconds{vm_name=~\"$vm\"}) ", 88 | "format": "time_series", 89 | "instant": false, 90 | "intervalFactor": 1, 91 | "legendFormat": "{{ cluster_name }}", 92 | "refId": "A" 93 | } 94 | ], 95 | "thresholds": "50,80", 96 | "title": "Cluster", 97 | "type": "singlestat", 98 | "valueFontSize": "80%", 99 | "valueMaps": [ 100 | { 101 | "op": "=", 102 | "text": "N/A", 103 | "value": "null" 104 | } 105 | ], 106 | "valueName": "name" 107 | }, 108 | { 109 | "cacheTimeout": null, 110 | "colorBackground": false, 111 | "colorValue": false, 112 | "colors": [ 113 | "#299c46", 114 | "rgba(237, 129, 40, 0.89)", 115 | "#d44a3a" 116 | ], 117 | "datasource": "$datasource", 118 | "format": "none", 119 | "gauge": { 120 | "maxValue": 100, 121 | "minValue": 0, 122 | "show": false, 123 | "thresholdLabels": false, 124 | "thresholdMarkers": true 125 | }, 126 | "gridPos": { 127 | "h": 3, 128 | "w": 4, 129 | "x": 4, 130 | "y": 0 131 | }, 132 | "id": 36, 133 | "interval": null, 134 | "links": [], 135 | "mappingType": 1, 136 | "mappingTypes": [ 137 | { 138 | "name": "value to text", 139 | "value": 1 140 | }, 141 | { 142 | "name": "range to text", 143 | "value": 2 144 | } 145 | ], 146 | "maxDataPoints": 100, 147 | "nullPointMode": "connected", 148 | "nullText": null, 149 | "options": {}, 150 | "postfix": "", 151 | "postfixFontSize": "50%", 152 | "prefix": "", 153 | "prefixFontSize": "50%", 154 | "rangeMaps": [ 155 | { 156 | "from": "null", 157 | "text": "N/A", 158 | "to": "null" 159 | } 160 | ], 161 | "sparkline": { 162 | "fillColor": "rgba(31, 118, 189, 0.18)", 163 | "full": true, 164 | "lineColor": "rgb(31, 120, 193)", 165 | "show": false 166 | }, 167 | "tableColumn": "", 168 | "targets": [ 169 | { 170 | "expr": "(vmware_vm_boot_timestamp_seconds{vm_name=~\"$vm\"}) ", 171 | "format": "time_series", 172 | "instant": false, 173 | "intervalFactor": 1, 174 | "legendFormat": "{{ host_name }}", 175 | "refId": "A" 176 | } 177 | ], 178 | "thresholds": "50,80", 179 | "title": "Host", 180 | "type": "singlestat", 181 | "valueFontSize": "80%", 182 | "valueMaps": [ 183 | { 184 | "op": "=", 185 | "text": "N/A", 186 | "value": "null" 187 | } 188 | ], 189 | "valueName": "name" 190 | }, 191 | { 192 | "cacheTimeout": null, 193 | "colorBackground": false, 194 | "colorValue": true, 195 | "colors": [ 196 | "#299c46", 197 | "rgba(237, 129, 40, 0.89)", 198 | "#d44a3a" 199 | ], 200 | "datasource": "$datasource", 201 | "format": "none", 202 | "gauge": { 203 | "maxValue": 100, 204 | "minValue": 0, 205 | "show": false, 206 | "thresholdLabels": false, 207 | "thresholdMarkers": true 208 | }, 209 | "gridPos": { 210 | "h": 3, 211 | "w": 4, 212 | "x": 8, 213 | "y": 0 214 | }, 215 | "id": 6, 216 | "interval": null, 217 | "links": [], 218 | "mappingType": 1, 219 | "mappingTypes": [ 220 | { 221 | "name": "value to text", 222 | "value": 1 223 | }, 224 | { 225 | "name": "range to text", 226 | "value": 2 227 | } 228 | ], 229 | "maxDataPoints": 100, 230 | "nullPointMode": "connected", 231 | "nullText": null, 232 | "options": {}, 233 | "postfix": "", 234 | "postfixFontSize": "50%", 235 | "prefix": "", 236 | "prefixFontSize": "50%", 237 | "rangeMaps": [ 238 | { 239 | "from": "null", 240 | "text": "N/A", 241 | "to": "null" 242 | } 243 | ], 244 | "sparkline": { 245 | "fillColor": "rgba(31, 118, 189, 0.18)", 246 | "full": false, 247 | "lineColor": "rgb(31, 120, 193)", 248 | "show": false 249 | }, 250 | "tableColumn": "", 251 | "targets": [ 252 | { 253 | "expr": "vmware_vm_template{vm_name=~\"$vm\"}", 254 | "format": "time_series", 255 | "instant": false, 256 | "intervalFactor": 1, 257 | "refId": "A" 258 | } 259 | ], 260 | "thresholds": "VM,Template", 261 | "title": "VM Type", 262 | "type": "singlestat", 263 | "valueFontSize": "80%", 264 | "valueMaps": [ 265 | { 266 | "op": "=", 267 | "text": "Template", 268 | "value": "1" 269 | }, 270 | { 271 | "op": "=", 272 | "text": "VM", 273 | "value": "0" 274 | } 275 | ], 276 | "valueName": "current" 277 | }, 278 | { 279 | "cacheTimeout": null, 280 | "colorBackground": false, 281 | "colorValue": true, 282 | "colors": [ 283 | "#d44a3a", 284 | "rgba(237, 129, 40, 0.89)", 285 | "#299c46" 286 | ], 287 | "datasource": "$datasource", 288 | "format": "none", 289 | "gauge": { 290 | "maxValue": 100, 291 | "minValue": 0, 292 | "show": false, 293 | "thresholdLabels": false, 294 | "thresholdMarkers": true 295 | }, 296 | "gridPos": { 297 | "h": 3, 298 | "w": 4, 299 | "x": 12, 300 | "y": 0 301 | }, 302 | "id": 38, 303 | "interval": null, 304 | "links": [], 305 | "mappingType": 1, 306 | "mappingTypes": [ 307 | { 308 | "name": "value to text", 309 | "value": 1 310 | }, 311 | { 312 | "name": "range to text", 313 | "value": 2 314 | } 315 | ], 316 | "maxDataPoints": 100, 317 | "nullPointMode": "connected", 318 | "nullText": null, 319 | "options": {}, 320 | "postfix": "", 321 | "postfixFontSize": "50%", 322 | "prefix": "", 323 | "prefixFontSize": "50%", 324 | "rangeMaps": [ 325 | { 326 | "from": "null", 327 | "text": "N/A", 328 | "to": "null" 329 | } 330 | ], 331 | "sparkline": { 332 | "fillColor": "rgba(31, 118, 189, 0.18)", 333 | "full": false, 334 | "lineColor": "rgb(31, 120, 193)", 335 | "show": false 336 | }, 337 | "tableColumn": "", 338 | "targets": [ 339 | { 340 | "expr": "vmware_vm_power_state{vm_name=~\"$vm\"}==1", 341 | "format": "time_series", 342 | "instant": false, 343 | "intervalFactor": 1, 344 | "refId": "A" 345 | } 346 | ], 347 | "thresholds": "0.1,0.2", 348 | "title": "VM State", 349 | "type": "singlestat", 350 | "valueFontSize": "80%", 351 | "valueMaps": [ 352 | { 353 | "op": "=", 354 | "text": "PoweredOn", 355 | "value": "1" 356 | }, 357 | { 358 | "op": "=", 359 | "text": "PoweredOff", 360 | "value": "0" 361 | } 362 | ], 363 | "valueName": "current" 364 | }, 365 | { 366 | "cacheTimeout": null, 367 | "colorBackground": false, 368 | "colorValue": true, 369 | "colors": [ 370 | "#d44a3a", 371 | "rgba(237, 129, 40, 0.89)", 372 | "#299c46" 373 | ], 374 | "datasource": "$datasource", 375 | "format": "short", 376 | "gauge": { 377 | "maxValue": 100, 378 | "minValue": 0, 379 | "show": false, 380 | "thresholdLabels": false, 381 | "thresholdMarkers": true 382 | }, 383 | "gridPos": { 384 | "h": 3, 385 | "w": 4, 386 | "x": 16, 387 | "y": 0 388 | }, 389 | "id": 32, 390 | "interval": null, 391 | "links": [], 392 | "mappingType": 1, 393 | "mappingTypes": [ 394 | { 395 | "name": "value to text", 396 | "value": 1 397 | }, 398 | { 399 | "name": "range to text", 400 | "value": 2 401 | } 402 | ], 403 | "maxDataPoints": 100, 404 | "nullPointMode": "connected", 405 | "nullText": null, 406 | "options": {}, 407 | "postfix": "", 408 | "postfixFontSize": "50%", 409 | "prefix": "", 410 | "prefixFontSize": "50%", 411 | "rangeMaps": [ 412 | { 413 | "from": "null", 414 | "text": "N/A", 415 | "to": "null" 416 | } 417 | ], 418 | "sparkline": { 419 | "fillColor": "rgba(31, 118, 189, 0.18)", 420 | "full": true, 421 | "lineColor": "rgb(31, 120, 193)", 422 | "show": false 423 | }, 424 | "tableColumn": "", 425 | "targets": [ 426 | { 427 | "expr": "(vmware_vm_guest_tools_running_status{vm_name=~\"$vm\"})", 428 | "format": "time_series", 429 | "instant": false, 430 | "intervalFactor": 1, 431 | "legendFormat": "{{ tools_status }}", 432 | "refId": "A" 433 | } 434 | ], 435 | "thresholds": "0.1,0.2", 436 | "title": "Tools Status", 437 | "type": "singlestat", 438 | "valueFontSize": "80%", 439 | "valueMaps": [ 440 | { 441 | "op": "=", 442 | "text": "OK", 443 | "value": "1" 444 | }, 445 | { 446 | "op": "=", 447 | "text": "NOK", 448 | "value": "0" 449 | } 450 | ], 451 | "valueName": "current" 452 | }, 453 | { 454 | "cacheTimeout": null, 455 | "colorBackground": false, 456 | "colorValue": false, 457 | "colors": [ 458 | "#299c46", 459 | "rgba(237, 129, 40, 0.89)", 460 | "#d44a3a" 461 | ], 462 | "datasource": "$datasource", 463 | "format": "none", 464 | "gauge": { 465 | "maxValue": 100, 466 | "minValue": 0, 467 | "show": false, 468 | "thresholdLabels": false, 469 | "thresholdMarkers": true 470 | }, 471 | "gridPos": { 472 | "h": 3, 473 | "w": 4, 474 | "x": 20, 475 | "y": 0 476 | }, 477 | "id": 37, 478 | "interval": null, 479 | "links": [], 480 | "mappingType": 1, 481 | "mappingTypes": [ 482 | { 483 | "name": "value to text", 484 | "value": 1 485 | }, 486 | { 487 | "name": "range to text", 488 | "value": 2 489 | } 490 | ], 491 | "maxDataPoints": 100, 492 | "nullPointMode": "connected", 493 | "nullText": null, 494 | "options": {}, 495 | "postfix": "", 496 | "postfixFontSize": "50%", 497 | "prefix": "", 498 | "prefixFontSize": "50%", 499 | "rangeMaps": [ 500 | { 501 | "from": "null", 502 | "text": "N/A", 503 | "to": "null" 504 | } 505 | ], 506 | "sparkline": { 507 | "fillColor": "rgba(31, 118, 189, 0.18)", 508 | "full": true, 509 | "lineColor": "rgb(31, 120, 193)", 510 | "show": false 511 | }, 512 | "tableColumn": "", 513 | "targets": [ 514 | { 515 | "expr": "(vmware_vm_guest_tools_version{vm_name=~\"$vm\"})", 516 | "format": "time_series", 517 | "instant": false, 518 | "intervalFactor": 1, 519 | "legendFormat": "{{ tools_version}}", 520 | "refId": "A" 521 | } 522 | ], 523 | "thresholds": "50,80", 524 | "title": "Tools Version", 525 | "type": "singlestat", 526 | "valueFontSize": "80%", 527 | "valueMaps": [ 528 | { 529 | "op": "=", 530 | "text": "N/A", 531 | "value": "null" 532 | } 533 | ], 534 | "valueName": "name" 535 | }, 536 | { 537 | "cacheTimeout": null, 538 | "colorBackground": false, 539 | "colorValue": false, 540 | "colors": [ 541 | "#299c46", 542 | "rgba(237, 129, 40, 0.89)", 543 | "#d44a3a" 544 | ], 545 | "datasource": "$datasource", 546 | "format": "short", 547 | "gauge": { 548 | "maxValue": 100, 549 | "minValue": 0, 550 | "show": false, 551 | "thresholdLabels": false, 552 | "thresholdMarkers": true 553 | }, 554 | "gridPos": { 555 | "h": 5, 556 | "w": 3, 557 | "x": 0, 558 | "y": 3 559 | }, 560 | "id": 14, 561 | "interval": null, 562 | "links": [], 563 | "mappingType": 1, 564 | "mappingTypes": [ 565 | { 566 | "name": "value to text", 567 | "value": 1 568 | }, 569 | { 570 | "name": "range to text", 571 | "value": 2 572 | } 573 | ], 574 | "maxDataPoints": 100, 575 | "nullPointMode": "connected", 576 | "nullText": null, 577 | "options": {}, 578 | "postfix": "", 579 | "postfixFontSize": "50%", 580 | "prefix": "", 581 | "prefixFontSize": "50%", 582 | "rangeMaps": [ 583 | { 584 | "from": "null", 585 | "text": "N/A", 586 | "to": "null" 587 | } 588 | ], 589 | "sparkline": { 590 | "fillColor": "rgba(31, 118, 189, 0.18)", 591 | "full": true, 592 | "lineColor": "rgb(31, 120, 193)", 593 | "show": false 594 | }, 595 | "tableColumn": "", 596 | "targets": [ 597 | { 598 | "expr": "(vmware_vm_num_cpu{vm_name=~\"$vm\"}) ", 599 | "format": "time_series", 600 | "instant": false, 601 | "intervalFactor": 1, 602 | "refId": "A" 603 | } 604 | ], 605 | "thresholds": "50,80", 606 | "title": "Cpu Number", 607 | "type": "singlestat", 608 | "valueFontSize": "80%", 609 | "valueMaps": [ 610 | { 611 | "op": "=", 612 | "text": "N/A", 613 | "value": "null" 614 | } 615 | ], 616 | "valueName": "avg" 617 | }, 618 | { 619 | "cacheTimeout": null, 620 | "datasource": "$datasource", 621 | "gridPos": { 622 | "h": 5, 623 | "w": 3, 624 | "x": 3, 625 | "y": 3 626 | }, 627 | "id": 12, 628 | "links": [], 629 | "options": { 630 | "fieldOptions": { 631 | "calcs": [ 632 | "lastNotNull" 633 | ], 634 | "defaults": { 635 | "mappings": [ 636 | { 637 | "id": 0, 638 | "op": "=", 639 | "text": "N/A", 640 | "type": 1, 641 | "value": "null" 642 | } 643 | ], 644 | "max": 100, 645 | "min": 0, 646 | "nullValueMode": "connected", 647 | "thresholds": [ 648 | { 649 | "color": "#299c46", 650 | "value": null 651 | }, 652 | { 653 | "color": "rgba(237, 129, 40, 0.89)", 654 | "value": 90 655 | }, 656 | { 657 | "color": "#d44a3a", 658 | "value": 95 659 | } 660 | ], 661 | "unit": "percent" 662 | }, 663 | "override": {}, 664 | "values": false 665 | }, 666 | "orientation": "horizontal", 667 | "showThresholdLabels": false, 668 | "showThresholdMarkers": true 669 | }, 670 | "pluginVersion": "6.4.1", 671 | "targets": [ 672 | { 673 | "expr": "vmware_vm_cpu_usagemhz_average{vm_name=~\"$vm\"}/vmware_vm_max_cpu_usage{vm_name=~\"$vm\"}*100", 674 | "format": "time_series", 675 | "instant": false, 676 | "intervalFactor": 1, 677 | "refId": "A" 678 | } 679 | ], 680 | "title": "VM CPU Usage", 681 | "type": "gauge" 682 | }, 683 | { 684 | "cacheTimeout": null, 685 | "datasource": "$datasource", 686 | "gridPos": { 687 | "h": 5, 688 | "w": 3, 689 | "x": 6, 690 | "y": 3 691 | }, 692 | "id": 25, 693 | "links": [], 694 | "options": { 695 | "fieldOptions": { 696 | "calcs": [ 697 | "lastNotNull" 698 | ], 699 | "defaults": { 700 | "mappings": [ 701 | { 702 | "id": 0, 703 | "op": "=", 704 | "text": "N/A", 705 | "type": 1, 706 | "value": "null" 707 | } 708 | ], 709 | "max": 20, 710 | "min": 0, 711 | "nullValueMode": "connected", 712 | "thresholds": [ 713 | { 714 | "color": "#299c46", 715 | "value": null 716 | }, 717 | { 718 | "color": "rgba(237, 129, 40, 0.89)", 719 | "value": 5 720 | }, 721 | { 722 | "color": "#d44a3a", 723 | "value": 10 724 | } 725 | ], 726 | "unit": "percent" 727 | }, 728 | "override": {}, 729 | "values": false 730 | }, 731 | "orientation": "horizontal", 732 | "showThresholdLabels": false, 733 | "showThresholdMarkers": true 734 | }, 735 | "pluginVersion": "6.4.1", 736 | "targets": [ 737 | { 738 | "expr": "(vmware_vm_cpu_ready_summation{vm_name=~\"$vm\"})/200", 739 | "format": "time_series", 740 | "instant": false, 741 | "intervalFactor": 1, 742 | "refId": "A" 743 | } 744 | ], 745 | "title": "VM Cpu Ready", 746 | "type": "gauge" 747 | }, 748 | { 749 | "cacheTimeout": null, 750 | "datasource": "$datasource", 751 | "gridPos": { 752 | "h": 5, 753 | "w": 3, 754 | "x": 9, 755 | "y": 3 756 | }, 757 | "id": 26, 758 | "links": [], 759 | "options": { 760 | "fieldOptions": { 761 | "calcs": [ 762 | "lastNotNull" 763 | ], 764 | "defaults": { 765 | "mappings": [ 766 | { 767 | "id": 0, 768 | "op": "=", 769 | "text": "N/A", 770 | "type": 1, 771 | "value": "null" 772 | } 773 | ], 774 | "max": 10, 775 | "min": 0, 776 | "nullValueMode": "connected", 777 | "thresholds": [ 778 | { 779 | "color": "#299c46", 780 | "value": null 781 | }, 782 | { 783 | "color": "rgba(237, 129, 40, 0.89)", 784 | "value": 1 785 | }, 786 | { 787 | "color": "#d44a3a", 788 | "value": 3 789 | } 790 | ], 791 | "unit": "percent" 792 | }, 793 | "override": {}, 794 | "values": false 795 | }, 796 | "orientation": "horizontal", 797 | "showThresholdLabels": false, 798 | "showThresholdMarkers": true 799 | }, 800 | "pluginVersion": "6.4.1", 801 | "targets": [ 802 | { 803 | "expr": "vmware_vm_cpu_costop_summation{vm_name=~\"$vm\"}/200", 804 | "format": "time_series", 805 | "instant": false, 806 | "intervalFactor": 1, 807 | "refId": "A" 808 | } 809 | ], 810 | "title": "VM Cpu Co-Stop", 811 | "type": "gauge" 812 | }, 813 | { 814 | "cacheTimeout": null, 815 | "colorBackground": false, 816 | "colorValue": false, 817 | "colors": [ 818 | "#299c46", 819 | "rgba(237, 129, 40, 0.89)", 820 | "#d44a3a" 821 | ], 822 | "datasource": "$datasource", 823 | "format": "decmbytes", 824 | "gauge": { 825 | "maxValue": 100, 826 | "minValue": 0, 827 | "show": false, 828 | "thresholdLabels": false, 829 | "thresholdMarkers": true 830 | }, 831 | "gridPos": { 832 | "h": 5, 833 | "w": 3, 834 | "x": 12, 835 | "y": 3 836 | }, 837 | "id": 15, 838 | "interval": null, 839 | "links": [], 840 | "mappingType": 1, 841 | "mappingTypes": [ 842 | { 843 | "name": "value to text", 844 | "value": 1 845 | }, 846 | { 847 | "name": "range to text", 848 | "value": 2 849 | } 850 | ], 851 | "maxDataPoints": 100, 852 | "nullPointMode": "connected", 853 | "nullText": null, 854 | "options": {}, 855 | "postfix": "", 856 | "postfixFontSize": "50%", 857 | "prefix": "", 858 | "prefixFontSize": "50%", 859 | "rangeMaps": [ 860 | { 861 | "from": "null", 862 | "text": "N/A", 863 | "to": "null" 864 | } 865 | ], 866 | "sparkline": { 867 | "fillColor": "rgba(31, 118, 189, 0.18)", 868 | "full": true, 869 | "lineColor": "rgb(31, 120, 193)", 870 | "show": false 871 | }, 872 | "tableColumn": "", 873 | "targets": [ 874 | { 875 | "expr": "(vmware_vm_memory_max{vm_name=~\"$vm\"}) ", 876 | "format": "time_series", 877 | "instant": false, 878 | "intervalFactor": 1, 879 | "refId": "A" 880 | } 881 | ], 882 | "thresholds": "50,80", 883 | "title": "Memory Capacity", 884 | "type": "singlestat", 885 | "valueFontSize": "80%", 886 | "valueMaps": [ 887 | { 888 | "op": "=", 889 | "text": "N/A", 890 | "value": "null" 891 | } 892 | ], 893 | "valueName": "current" 894 | }, 895 | { 896 | "cacheTimeout": null, 897 | "colorBackground": false, 898 | "colorValue": false, 899 | "colors": [ 900 | "#299c46", 901 | "rgba(237, 129, 40, 0.89)", 902 | "#d44a3a" 903 | ], 904 | "datasource": "$datasource", 905 | "format": "percent", 906 | "gauge": { 907 | "maxValue": 100, 908 | "minValue": 0, 909 | "show": true, 910 | "thresholdLabels": false, 911 | "thresholdMarkers": true 912 | }, 913 | "gridPos": { 914 | "h": 5, 915 | "w": 3, 916 | "x": 15, 917 | "y": 3 918 | }, 919 | "id": 13, 920 | "interval": null, 921 | "links": [], 922 | "mappingType": 1, 923 | "mappingTypes": [ 924 | { 925 | "name": "value to text", 926 | "value": 1 927 | }, 928 | { 929 | "name": "range to text", 930 | "value": 2 931 | } 932 | ], 933 | "maxDataPoints": 100, 934 | "nullPointMode": "connected", 935 | "nullText": null, 936 | "options": {}, 937 | "postfix": "", 938 | "postfixFontSize": "50%", 939 | "prefix": "", 940 | "prefixFontSize": "50%", 941 | "rangeMaps": [ 942 | { 943 | "from": "null", 944 | "text": "N/A", 945 | "to": "null" 946 | } 947 | ], 948 | "sparkline": { 949 | "fillColor": "rgba(31, 118, 189, 0.18)", 950 | "full": true, 951 | "lineColor": "rgb(31, 120, 193)", 952 | "show": false 953 | }, 954 | "tableColumn": "", 955 | "targets": [ 956 | { 957 | "expr": "(vmware_vm_mem_usage_average{vm_name=~\"$vm\"}) * 100 / (vmware_vm_memory_max{vm_name=~\"$vm\"})", 958 | "format": "time_series", 959 | "instant": false, 960 | "intervalFactor": 1, 961 | "refId": "A" 962 | } 963 | ], 964 | "thresholds": "90,95", 965 | "title": "VM Memory usage", 966 | "type": "singlestat", 967 | "valueFontSize": "80%", 968 | "valueMaps": [ 969 | { 970 | "op": "=", 971 | "text": "N/A", 972 | "value": "null" 973 | } 974 | ], 975 | "valueName": "current" 976 | }, 977 | { 978 | "cacheTimeout": null, 979 | "datasource": "$datasource", 980 | "gridPos": { 981 | "h": 5, 982 | "w": 3, 983 | "x": 18, 984 | "y": 3 985 | }, 986 | "id": 31, 987 | "links": [], 988 | "options": { 989 | "fieldOptions": { 990 | "calcs": [ 991 | "lastNotNull" 992 | ], 993 | "defaults": { 994 | "decimals": 1, 995 | "mappings": [ 996 | { 997 | "id": 0, 998 | "op": "=", 999 | "text": "N/A", 1000 | "type": 1, 1001 | "value": "null" 1002 | } 1003 | ], 1004 | "max": 100, 1005 | "min": 0, 1006 | "nullValueMode": "connected", 1007 | "thresholds": [ 1008 | { 1009 | "color": "#299c46", 1010 | "value": null 1011 | }, 1012 | { 1013 | "color": "rgba(237, 129, 40, 0.89)", 1014 | "value": 1024 1015 | }, 1016 | { 1017 | "color": "#d44a3a", 1018 | "value": 2048 1019 | } 1020 | ], 1021 | "unit": "deckbytes" 1022 | }, 1023 | "override": {}, 1024 | "values": false 1025 | }, 1026 | "orientation": "horizontal", 1027 | "showThresholdLabels": false, 1028 | "showThresholdMarkers": true 1029 | }, 1030 | "pluginVersion": "6.4.1", 1031 | "targets": [ 1032 | { 1033 | "expr": "vmware_vm_mem_vmmemctl_average{vm_name=~\"$vm\"}", 1034 | "format": "time_series", 1035 | "instant": false, 1036 | "intervalFactor": 1, 1037 | "refId": "A" 1038 | } 1039 | ], 1040 | "title": "VM Ballooning", 1041 | "type": "gauge" 1042 | }, 1043 | { 1044 | "cacheTimeout": null, 1045 | "datasource": "$datasource", 1046 | "gridPos": { 1047 | "h": 5, 1048 | "w": 3, 1049 | "x": 21, 1050 | "y": 3 1051 | }, 1052 | "id": 35, 1053 | "links": [], 1054 | "options": { 1055 | "fieldOptions": { 1056 | "calcs": [ 1057 | "lastNotNull" 1058 | ], 1059 | "defaults": { 1060 | "decimals": 2, 1061 | "mappings": [ 1062 | { 1063 | "id": 0, 1064 | "op": "=", 1065 | "text": "N/A", 1066 | "type": 1, 1067 | "value": "null" 1068 | } 1069 | ], 1070 | "max": 100, 1071 | "min": 0, 1072 | "nullValueMode": "connected", 1073 | "thresholds": [ 1074 | { 1075 | "color": "#299c46", 1076 | "value": null 1077 | }, 1078 | { 1079 | "color": "rgba(237, 129, 40, 0.89)", 1080 | "value": 0.01 1081 | }, 1082 | { 1083 | "color": "#d44a3a", 1084 | "value": 0.1 1085 | } 1086 | ], 1087 | "unit": "deckbytes" 1088 | }, 1089 | "override": {}, 1090 | "values": false 1091 | }, 1092 | "orientation": "horizontal", 1093 | "showThresholdLabels": false, 1094 | "showThresholdMarkers": true 1095 | }, 1096 | "pluginVersion": "6.4.1", 1097 | "targets": [ 1098 | { 1099 | "expr": "vmware_vm_mem_swapped_average{vm_name=~\"$vm\"}", 1100 | "format": "time_series", 1101 | "instant": false, 1102 | "intervalFactor": 1, 1103 | "refId": "A" 1104 | } 1105 | ], 1106 | "title": "VM Swapped", 1107 | "type": "gauge" 1108 | }, 1109 | { 1110 | "aliasColors": {}, 1111 | "bars": false, 1112 | "cacheTimeout": null, 1113 | "dashLength": 10, 1114 | "dashes": false, 1115 | "datasource": "$datasource", 1116 | "fill": 1, 1117 | "fillGradient": 0, 1118 | "gridPos": { 1119 | "h": 5, 1120 | "w": 12, 1121 | "x": 0, 1122 | "y": 8 1123 | }, 1124 | "id": 17, 1125 | "legend": { 1126 | "avg": true, 1127 | "current": false, 1128 | "max": true, 1129 | "min": true, 1130 | "show": true, 1131 | "total": false, 1132 | "values": true 1133 | }, 1134 | "lines": true, 1135 | "linewidth": 1, 1136 | "links": [], 1137 | "nullPointMode": "null", 1138 | "options": { 1139 | "dataLinks": [] 1140 | }, 1141 | "percentage": false, 1142 | "pointradius": 2, 1143 | "points": false, 1144 | "renderer": "flot", 1145 | "seriesOverrides": [], 1146 | "spaceLength": 10, 1147 | "stack": false, 1148 | "steppedLine": false, 1149 | "targets": [ 1150 | { 1151 | "expr": "vmware_vm_cpu_usagemhz_average{vm_name=~\"$vm\"}/vmware_vm_max_cpu_usage{vm_name=~\"$vm\"}*100", 1152 | "format": "time_series", 1153 | "intervalFactor": 1, 1154 | "legendFormat": "Cpu Usage", 1155 | "refId": "A" 1156 | }, 1157 | { 1158 | "expr": "vmware_vm_cpu_demand_average{vm_name=~\"$vm\"}/vmware_vm_max_cpu_usage{vm_name=~\"$vm\"}*100", 1159 | "legendFormat": "Cpu Demand", 1160 | "refId": "B" 1161 | } 1162 | ], 1163 | "thresholds": [], 1164 | "timeFrom": null, 1165 | "timeRegions": [], 1166 | "timeShift": null, 1167 | "title": "VM CPU Usage", 1168 | "tooltip": { 1169 | "shared": true, 1170 | "sort": 0, 1171 | "value_type": "individual" 1172 | }, 1173 | "type": "graph", 1174 | "xaxis": { 1175 | "buckets": null, 1176 | "mode": "time", 1177 | "name": null, 1178 | "show": true, 1179 | "values": [] 1180 | }, 1181 | "yaxes": [ 1182 | { 1183 | "decimals": 1, 1184 | "format": "percent", 1185 | "label": null, 1186 | "logBase": 1, 1187 | "max": null, 1188 | "min": null, 1189 | "show": true 1190 | }, 1191 | { 1192 | "format": "short", 1193 | "label": null, 1194 | "logBase": 1, 1195 | "max": null, 1196 | "min": null, 1197 | "show": true 1198 | } 1199 | ], 1200 | "yaxis": { 1201 | "align": false, 1202 | "alignLevel": null 1203 | } 1204 | }, 1205 | { 1206 | "aliasColors": {}, 1207 | "bars": false, 1208 | "cacheTimeout": null, 1209 | "dashLength": 10, 1210 | "dashes": false, 1211 | "datasource": "$datasource", 1212 | "fill": 1, 1213 | "fillGradient": 0, 1214 | "gridPos": { 1215 | "h": 5, 1216 | "w": 12, 1217 | "x": 12, 1218 | "y": 8 1219 | }, 1220 | "id": 39, 1221 | "legend": { 1222 | "avg": true, 1223 | "current": false, 1224 | "max": true, 1225 | "min": true, 1226 | "show": true, 1227 | "total": false, 1228 | "values": true 1229 | }, 1230 | "lines": true, 1231 | "linewidth": 1, 1232 | "links": [], 1233 | "nullPointMode": "null", 1234 | "options": { 1235 | "dataLinks": [] 1236 | }, 1237 | "percentage": false, 1238 | "pointradius": 2, 1239 | "points": false, 1240 | "renderer": "flot", 1241 | "seriesOverrides": [], 1242 | "spaceLength": 10, 1243 | "stack": false, 1244 | "steppedLine": false, 1245 | "targets": [ 1246 | { 1247 | "expr": "(vmware_vm_cpu_ready_summation{vm_name=~\"$vm\"})/200", 1248 | "format": "time_series", 1249 | "intervalFactor": 1, 1250 | "legendFormat": "Cpu Ready", 1251 | "refId": "A" 1252 | }, 1253 | { 1254 | "expr": "vmware_vm_cpu_costop_summation{vm_name=~\"$vm\"}/200", 1255 | "legendFormat": "Co-Stop", 1256 | "refId": "B" 1257 | } 1258 | ], 1259 | "thresholds": [], 1260 | "timeFrom": null, 1261 | "timeRegions": [], 1262 | "timeShift": null, 1263 | "title": "VM CPU Contention", 1264 | "tooltip": { 1265 | "shared": true, 1266 | "sort": 0, 1267 | "value_type": "individual" 1268 | }, 1269 | "type": "graph", 1270 | "xaxis": { 1271 | "buckets": null, 1272 | "mode": "time", 1273 | "name": null, 1274 | "show": true, 1275 | "values": [] 1276 | }, 1277 | "yaxes": [ 1278 | { 1279 | "decimals": 1, 1280 | "format": "percent", 1281 | "label": null, 1282 | "logBase": 1, 1283 | "max": null, 1284 | "min": null, 1285 | "show": true 1286 | }, 1287 | { 1288 | "format": "short", 1289 | "label": null, 1290 | "logBase": 1, 1291 | "max": null, 1292 | "min": null, 1293 | "show": true 1294 | } 1295 | ], 1296 | "yaxis": { 1297 | "align": false, 1298 | "alignLevel": null 1299 | } 1300 | }, 1301 | { 1302 | "aliasColors": {}, 1303 | "bars": false, 1304 | "cacheTimeout": null, 1305 | "dashLength": 10, 1306 | "dashes": false, 1307 | "datasource": "$datasource", 1308 | "fill": 1, 1309 | "fillGradient": 0, 1310 | "gridPos": { 1311 | "h": 5, 1312 | "w": 12, 1313 | "x": 0, 1314 | "y": 13 1315 | }, 1316 | "id": 18, 1317 | "legend": { 1318 | "avg": true, 1319 | "current": false, 1320 | "max": true, 1321 | "min": true, 1322 | "show": true, 1323 | "total": false, 1324 | "values": true 1325 | }, 1326 | "lines": true, 1327 | "linewidth": 1, 1328 | "links": [], 1329 | "nullPointMode": "null", 1330 | "options": { 1331 | "dataLinks": [] 1332 | }, 1333 | "percentage": false, 1334 | "pointradius": 2, 1335 | "points": false, 1336 | "renderer": "flot", 1337 | "seriesOverrides": [], 1338 | "spaceLength": 10, 1339 | "stack": false, 1340 | "steppedLine": false, 1341 | "targets": [ 1342 | { 1343 | "expr": "(vmware_vm_mem_usage_average{vm_name=~\"$vm\"}) * 100 / (vmware_vm_memory_max{vm_name=~\"$vm\"})", 1344 | "format": "time_series", 1345 | "intervalFactor": 1, 1346 | "legendFormat": "Memory Usage", 1347 | "refId": "A" 1348 | } 1349 | ], 1350 | "thresholds": [], 1351 | "timeFrom": null, 1352 | "timeRegions": [], 1353 | "timeShift": null, 1354 | "title": "VM Memory usage", 1355 | "tooltip": { 1356 | "shared": true, 1357 | "sort": 0, 1358 | "value_type": "individual" 1359 | }, 1360 | "type": "graph", 1361 | "xaxis": { 1362 | "buckets": null, 1363 | "mode": "time", 1364 | "name": null, 1365 | "show": true, 1366 | "values": [] 1367 | }, 1368 | "yaxes": [ 1369 | { 1370 | "decimals": 1, 1371 | "format": "percent", 1372 | "label": null, 1373 | "logBase": 1, 1374 | "max": null, 1375 | "min": null, 1376 | "show": true 1377 | }, 1378 | { 1379 | "format": "short", 1380 | "label": null, 1381 | "logBase": 1, 1382 | "max": null, 1383 | "min": null, 1384 | "show": true 1385 | } 1386 | ], 1387 | "yaxis": { 1388 | "align": false, 1389 | "alignLevel": null 1390 | } 1391 | }, 1392 | { 1393 | "aliasColors": {}, 1394 | "bars": false, 1395 | "cacheTimeout": null, 1396 | "dashLength": 10, 1397 | "dashes": false, 1398 | "datasource": "$datasource", 1399 | "fill": 1, 1400 | "fillGradient": 0, 1401 | "gridPos": { 1402 | "h": 5, 1403 | "w": 12, 1404 | "x": 12, 1405 | "y": 13 1406 | }, 1407 | "id": 41, 1408 | "legend": { 1409 | "avg": true, 1410 | "current": false, 1411 | "max": true, 1412 | "min": true, 1413 | "show": true, 1414 | "total": false, 1415 | "values": true 1416 | }, 1417 | "lines": true, 1418 | "linewidth": 1, 1419 | "links": [], 1420 | "nullPointMode": "null", 1421 | "options": { 1422 | "dataLinks": [] 1423 | }, 1424 | "percentage": false, 1425 | "pointradius": 2, 1426 | "points": false, 1427 | "renderer": "flot", 1428 | "seriesOverrides": [], 1429 | "spaceLength": 10, 1430 | "stack": false, 1431 | "steppedLine": false, 1432 | "targets": [ 1433 | { 1434 | "expr": "vmware_vm_mem_vmmemctl_average{vm_name=~\"$vm\"}", 1435 | "format": "time_series", 1436 | "intervalFactor": 1, 1437 | "legendFormat": "Ballooning", 1438 | "refId": "A" 1439 | }, 1440 | { 1441 | "expr": "vmware_vm_mem_swapped_average{vm_name=~\"$vm\"}", 1442 | "legendFormat": "Swap", 1443 | "refId": "B" 1444 | } 1445 | ], 1446 | "thresholds": [], 1447 | "timeFrom": null, 1448 | "timeRegions": [], 1449 | "timeShift": null, 1450 | "title": "VM Memory Contention", 1451 | "tooltip": { 1452 | "shared": true, 1453 | "sort": 0, 1454 | "value_type": "individual" 1455 | }, 1456 | "type": "graph", 1457 | "xaxis": { 1458 | "buckets": null, 1459 | "mode": "time", 1460 | "name": null, 1461 | "show": true, 1462 | "values": [] 1463 | }, 1464 | "yaxes": [ 1465 | { 1466 | "decimals": 1, 1467 | "format": "percent", 1468 | "label": null, 1469 | "logBase": 1, 1470 | "max": null, 1471 | "min": null, 1472 | "show": true 1473 | }, 1474 | { 1475 | "format": "short", 1476 | "label": null, 1477 | "logBase": 1, 1478 | "max": null, 1479 | "min": null, 1480 | "show": true 1481 | } 1482 | ], 1483 | "yaxis": { 1484 | "align": false, 1485 | "alignLevel": null 1486 | } 1487 | }, 1488 | { 1489 | "aliasColors": {}, 1490 | "bars": false, 1491 | "cacheTimeout": null, 1492 | "dashLength": 10, 1493 | "dashes": false, 1494 | "datasource": "$datasource", 1495 | "decimals": 1, 1496 | "fill": 1, 1497 | "fillGradient": 0, 1498 | "gridPos": { 1499 | "h": 5, 1500 | "w": 24, 1501 | "x": 0, 1502 | "y": 18 1503 | }, 1504 | "id": 19, 1505 | "legend": { 1506 | "avg": true, 1507 | "current": false, 1508 | "max": true, 1509 | "min": true, 1510 | "show": true, 1511 | "total": false, 1512 | "values": true 1513 | }, 1514 | "lines": true, 1515 | "linewidth": 1, 1516 | "links": [], 1517 | "nullPointMode": "null", 1518 | "options": { 1519 | "dataLinks": [] 1520 | }, 1521 | "percentage": false, 1522 | "pointradius": 2, 1523 | "points": false, 1524 | "renderer": "flot", 1525 | "seriesOverrides": [], 1526 | "spaceLength": 10, 1527 | "stack": false, 1528 | "steppedLine": false, 1529 | "targets": [ 1530 | { 1531 | "expr": "vmware_vm_net_received_average{vm_name=~\"$vm\"}+vmware_vm_net_transmitted_average{vm_name=~\"$vm\"}", 1532 | "format": "time_series", 1533 | "intervalFactor": 1, 1534 | "legendFormat": "Total Usage", 1535 | "refId": "A" 1536 | }, 1537 | { 1538 | "expr": "vmware_vm_net_received_average{vm_name=~\"$vm\"}", 1539 | "legendFormat": "Read Usage", 1540 | "refId": "B" 1541 | }, 1542 | { 1543 | "expr": "vmware_vm_net_transmitted_average{vm_name=~\"$vm\"}", 1544 | "legendFormat": "Transmit Usage", 1545 | "refId": "C" 1546 | }, 1547 | { 1548 | "expr": "vmware_vm_net_broadcastTx_summation{vm_name=~\"$vm\"}", 1549 | "legendFormat": "Broadcast TX", 1550 | "refId": "D" 1551 | }, 1552 | { 1553 | "expr": "vmware_vm_net_broadcastRx_summation{vm_name=~\"$vm\"}", 1554 | "legendFormat": "Broadcast RX", 1555 | "refId": "E" 1556 | }, 1557 | { 1558 | "expr": "vmware_vm_net_multicastTx_summation{vm_name=~\"$vm\"}", 1559 | "legendFormat": "Multicast TX", 1560 | "refId": "F" 1561 | }, 1562 | { 1563 | "expr": "vmware_vm_net_multicastRx_summation{vm_name=~\"$vm\"}", 1564 | "legendFormat": "Multicast RX", 1565 | "refId": "G" 1566 | } 1567 | ], 1568 | "thresholds": [], 1569 | "timeFrom": null, 1570 | "timeRegions": [], 1571 | "timeShift": null, 1572 | "title": "VM Network Usage", 1573 | "tooltip": { 1574 | "shared": true, 1575 | "sort": 0, 1576 | "value_type": "individual" 1577 | }, 1578 | "type": "graph", 1579 | "xaxis": { 1580 | "buckets": null, 1581 | "mode": "time", 1582 | "name": null, 1583 | "show": true, 1584 | "values": [] 1585 | }, 1586 | "yaxes": [ 1587 | { 1588 | "decimals": 1, 1589 | "format": "KBs", 1590 | "label": null, 1591 | "logBase": 1, 1592 | "max": null, 1593 | "min": null, 1594 | "show": true 1595 | }, 1596 | { 1597 | "format": "short", 1598 | "label": null, 1599 | "logBase": 1, 1600 | "max": null, 1601 | "min": null, 1602 | "show": true 1603 | } 1604 | ], 1605 | "yaxis": { 1606 | "align": false, 1607 | "alignLevel": null 1608 | } 1609 | }, 1610 | { 1611 | "aliasColors": {}, 1612 | "bars": false, 1613 | "cacheTimeout": null, 1614 | "dashLength": 10, 1615 | "dashes": false, 1616 | "datasource": "$datasource", 1617 | "decimals": 1, 1618 | "fill": 1, 1619 | "fillGradient": 0, 1620 | "gridPos": { 1621 | "h": 5, 1622 | "w": 24, 1623 | "x": 0, 1624 | "y": 23 1625 | }, 1626 | "id": 42, 1627 | "legend": { 1628 | "avg": true, 1629 | "current": false, 1630 | "max": true, 1631 | "min": true, 1632 | "show": true, 1633 | "total": false, 1634 | "values": true 1635 | }, 1636 | "lines": true, 1637 | "linewidth": 1, 1638 | "links": [], 1639 | "nullPointMode": "null", 1640 | "options": { 1641 | "dataLinks": [] 1642 | }, 1643 | "percentage": false, 1644 | "pointradius": 2, 1645 | "points": false, 1646 | "renderer": "flot", 1647 | "seriesOverrides": [], 1648 | "spaceLength": 10, 1649 | "stack": false, 1650 | "steppedLine": false, 1651 | "targets": [ 1652 | { 1653 | "expr": "vmware_vm_net_droppedTx_summation{vm_name=~\"$vm\"}", 1654 | "format": "time_series", 1655 | "intervalFactor": 1, 1656 | "legendFormat": "Packet Dropped TX", 1657 | "refId": "A" 1658 | }, 1659 | { 1660 | "expr": "vmware_vm_net_droppedRx_summation{vm_name=~\"$vm\"}", 1661 | "legendFormat": "Packet Dropped RX", 1662 | "refId": "B" 1663 | } 1664 | ], 1665 | "thresholds": [], 1666 | "timeFrom": null, 1667 | "timeRegions": [], 1668 | "timeShift": null, 1669 | "title": "VM Network Packet Dropped", 1670 | "tooltip": { 1671 | "shared": true, 1672 | "sort": 0, 1673 | "value_type": "individual" 1674 | }, 1675 | "type": "graph", 1676 | "xaxis": { 1677 | "buckets": null, 1678 | "mode": "time", 1679 | "name": null, 1680 | "show": true, 1681 | "values": [] 1682 | }, 1683 | "yaxes": [ 1684 | { 1685 | "decimals": 1, 1686 | "format": "KBs", 1687 | "label": null, 1688 | "logBase": 1, 1689 | "max": null, 1690 | "min": null, 1691 | "show": true 1692 | }, 1693 | { 1694 | "format": "short", 1695 | "label": null, 1696 | "logBase": 1, 1697 | "max": null, 1698 | "min": null, 1699 | "show": true 1700 | } 1701 | ], 1702 | "yaxis": { 1703 | "align": false, 1704 | "alignLevel": null 1705 | } 1706 | }, 1707 | { 1708 | "aliasColors": {}, 1709 | "bars": false, 1710 | "cacheTimeout": null, 1711 | "dashLength": 10, 1712 | "dashes": false, 1713 | "datasource": "$datasource", 1714 | "fill": 1, 1715 | "fillGradient": 0, 1716 | "gridPos": { 1717 | "h": 5, 1718 | "w": 24, 1719 | "x": 0, 1720 | "y": 28 1721 | }, 1722 | "id": 20, 1723 | "legend": { 1724 | "avg": true, 1725 | "current": false, 1726 | "max": true, 1727 | "min": true, 1728 | "show": true, 1729 | "total": false, 1730 | "values": true 1731 | }, 1732 | "lines": true, 1733 | "linewidth": 1, 1734 | "links": [], 1735 | "nullPointMode": "null", 1736 | "options": { 1737 | "dataLinks": [] 1738 | }, 1739 | "percentage": false, 1740 | "pointradius": 2, 1741 | "points": false, 1742 | "renderer": "flot", 1743 | "seriesOverrides": [], 1744 | "spaceLength": 10, 1745 | "stack": false, 1746 | "steppedLine": false, 1747 | "targets": [ 1748 | { 1749 | "expr": "vmware_vm_disk_read_average{vm_name=~\"$vm\"}+vmware_vm_disk_write_average{vm_name=~\"$vm\"}", 1750 | "format": "time_series", 1751 | "intervalFactor": 1, 1752 | "legendFormat": "Total Usage", 1753 | "refId": "A" 1754 | }, 1755 | { 1756 | "expr": "vmware_vm_disk_read_average{vm_name=~\"$vm\"}", 1757 | "legendFormat": "Read Usage", 1758 | "refId": "B" 1759 | }, 1760 | { 1761 | "expr": "vmware_vm_disk_write_average{vm_name=~\"$vm\"}", 1762 | "legendFormat": "Write Usage", 1763 | "refId": "C" 1764 | } 1765 | ], 1766 | "thresholds": [], 1767 | "timeFrom": null, 1768 | "timeRegions": [], 1769 | "timeShift": null, 1770 | "title": "VM Disk Read And Write", 1771 | "tooltip": { 1772 | "shared": true, 1773 | "sort": 0, 1774 | "value_type": "individual" 1775 | }, 1776 | "type": "graph", 1777 | "xaxis": { 1778 | "buckets": null, 1779 | "mode": "time", 1780 | "name": null, 1781 | "show": true, 1782 | "values": [] 1783 | }, 1784 | "yaxes": [ 1785 | { 1786 | "decimals": 1, 1787 | "format": "KBs", 1788 | "label": null, 1789 | "logBase": 1, 1790 | "max": null, 1791 | "min": null, 1792 | "show": true 1793 | }, 1794 | { 1795 | "format": "short", 1796 | "label": null, 1797 | "logBase": 1, 1798 | "max": null, 1799 | "min": null, 1800 | "show": true 1801 | } 1802 | ], 1803 | "yaxis": { 1804 | "align": false, 1805 | "alignLevel": null 1806 | } 1807 | }, 1808 | { 1809 | "aliasColors": {}, 1810 | "bars": false, 1811 | "cacheTimeout": null, 1812 | "dashLength": 10, 1813 | "dashes": false, 1814 | "datasource": "$datasource", 1815 | "fill": 1, 1816 | "fillGradient": 0, 1817 | "gridPos": { 1818 | "h": 5, 1819 | "w": 24, 1820 | "x": 0, 1821 | "y": 33 1822 | }, 1823 | "id": 43, 1824 | "legend": { 1825 | "avg": true, 1826 | "current": false, 1827 | "max": true, 1828 | "min": true, 1829 | "show": true, 1830 | "total": false, 1831 | "values": true 1832 | }, 1833 | "lines": true, 1834 | "linewidth": 1, 1835 | "links": [], 1836 | "nullPointMode": "null", 1837 | "options": { 1838 | "dataLinks": [] 1839 | }, 1840 | "percentage": false, 1841 | "pointradius": 2, 1842 | "points": false, 1843 | "renderer": "flot", 1844 | "seriesOverrides": [], 1845 | "spaceLength": 10, 1846 | "stack": false, 1847 | "steppedLine": false, 1848 | "targets": [ 1849 | { 1850 | "expr": "vmware_vm_disk_maxTotalLatency_latest{vm_name=~\"$vm\"}", 1851 | "format": "time_series", 1852 | "intervalFactor": 1, 1853 | "legendFormat": "Disk Latency", 1854 | "refId": "A" 1855 | } 1856 | ], 1857 | "thresholds": [], 1858 | "timeFrom": null, 1859 | "timeRegions": [], 1860 | "timeShift": null, 1861 | "title": "VM Disk Latency", 1862 | "tooltip": { 1863 | "shared": true, 1864 | "sort": 0, 1865 | "value_type": "individual" 1866 | }, 1867 | "type": "graph", 1868 | "xaxis": { 1869 | "buckets": null, 1870 | "mode": "time", 1871 | "name": null, 1872 | "show": true, 1873 | "values": [] 1874 | }, 1875 | "yaxes": [ 1876 | { 1877 | "decimals": 0, 1878 | "format": "dtdurationms", 1879 | "label": null, 1880 | "logBase": 1, 1881 | "max": null, 1882 | "min": null, 1883 | "show": true 1884 | }, 1885 | { 1886 | "format": "short", 1887 | "label": null, 1888 | "logBase": 1, 1889 | "max": null, 1890 | "min": null, 1891 | "show": true 1892 | } 1893 | ], 1894 | "yaxis": { 1895 | "align": false, 1896 | "alignLevel": null 1897 | } 1898 | } 1899 | ], 1900 | "schemaVersion": 20, 1901 | "style": "dark", 1902 | "tags": [ 1903 | "vmware" 1904 | ], 1905 | "templating": { 1906 | "list": [ 1907 | { 1908 | "current": { 1909 | "text": "Prometheus", 1910 | "value": "Prometheus" 1911 | }, 1912 | "hide": 0, 1913 | "includeAll": false, 1914 | "label": "Datasource", 1915 | "multi": false, 1916 | "name": "datasource", 1917 | "options": [], 1918 | "query": "prometheus", 1919 | "refresh": 1, 1920 | "regex": "", 1921 | "skipUrlSync": false, 1922 | "type": "datasource" 1923 | }, 1924 | { 1925 | "allValue": null, 1926 | "current": { 1927 | "text": "centos-dhcp", 1928 | "value": "centos-dhcp" 1929 | }, 1930 | "datasource": "$datasource", 1931 | "definition": "label_values(vm_name)", 1932 | "hide": 0, 1933 | "includeAll": false, 1934 | "label": "vm", 1935 | "multi": true, 1936 | "name": "vm", 1937 | "options": [], 1938 | "query": "label_values(vm_name)", 1939 | "refresh": 1, 1940 | "regex": "", 1941 | "skipUrlSync": false, 1942 | "sort": 0, 1943 | "tagValuesQuery": "", 1944 | "tags": [], 1945 | "tagsQuery": "", 1946 | "type": "query", 1947 | "useTags": false 1948 | } 1949 | ] 1950 | }, 1951 | "time": { 1952 | "from": "now-5m", 1953 | "to": "now" 1954 | }, 1955 | "timepicker": { 1956 | "hidden": false, 1957 | "refresh_intervals": [ 1958 | "5s", 1959 | "10s", 1960 | "30s", 1961 | "1m", 1962 | "5m", 1963 | "15m", 1964 | "30m", 1965 | "1h", 1966 | "2h", 1967 | "1d" 1968 | ], 1969 | "time_options": [ 1970 | "5m", 1971 | "15m", 1972 | "1h", 1973 | "6h", 1974 | "12h", 1975 | "24h", 1976 | "2d", 1977 | "7d", 1978 | "30d" 1979 | ] 1980 | }, 1981 | "timezone": "browser", 1982 | "title": "VMware VM", 1983 | "uid": "Sl3uaY2Zk", 1984 | "version": 11 1985 | } 1986 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | vmware_exporter: 4 | # Using the latest tag, but you can use vers(v0.9.5 for example 5 | image: pryorda/vmware_exporter:latest 6 | ports: 7 | - "9275:9272" 8 | environment: 9 | VSPHERE_HOST: "vcenter-host" 10 | VSPHERE_USER: "username" 11 | VSPHERE_PASSWORD: "P@ssw0rd" 12 | VSPHERE_IGNORE_SSL: "True" 13 | VSPHERE_COLLECT_VMS: "False" 14 | VSPHERE_COLLECT_VMGUESTS: "False" 15 | restart: always 16 | #FOR DEBUG UNCOMMENT NEXT LINE 17 | #command: ["-l","DEBUG"] 18 | -------------------------------------------------------------------------------- /kubernetes/config.yml: -------------------------------------------------------------------------------- 1 | kind: ConfigMap 2 | metadata: 3 | labels: 4 | app: vmware-exporter 5 | name: vmware-exporter-config 6 | apiVersion: v1 7 | data: 8 | VSPHERE_USER: "" 9 | VSPHERE_HOST: "" 10 | VSPHERE_IGNORE_SSL: "True" 11 | VSPHERE_COLLECT_HOSTS: "True" 12 | VSPHERE_COLLECT_DATASTORES: "True" 13 | VSPHERE_COLLECT_VMS: "True" -------------------------------------------------------------------------------- /kubernetes/readme.md: -------------------------------------------------------------------------------- 1 | 2 | # Vmware node exporter on kubernetes 3 | 4 | First edit the config.yml file to match your setup. 5 | Afterwards, using the read command interactively type in your password, 6 | then run the command to create your secret on the cluster. 7 | And finally deploy the exporter container. 8 | 9 | The pod has prometheus annotations so when there's a prometheus on the cluster it will auto scrape the pod. 10 | 11 | ``` 12 | read -s VSPHERE_PASSWORD 13 | kubectl create secret generic vmware-exporter-password --from-literal=VSPHERE_PASSWORD=$VSPHERE_PASSWORD 14 | kubectl apply -f . 15 | ``` -------------------------------------------------------------------------------- /kubernetes/vmware-exporter.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: vmware-exporter 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: vmware-exporter 9 | template: 10 | metadata: 11 | labels: 12 | app: vmware-exporter 13 | release: vmware-exporter 14 | annotations: 15 | prometheus.io/path: "/metrics" 16 | prometheus.io/port: "9272" 17 | prometheus.io/scrape: "true" 18 | spec: 19 | containers: 20 | - name: vmware-exporter 21 | image: "pryorda/vmware_exporter:latest" 22 | imagePullPolicy: Always 23 | ports: 24 | - containerPort: 9272 25 | name: http 26 | envFrom: 27 | - configMapRef: 28 | name: vmware-exporter-config 29 | - secretRef: 30 | name: vmware-exporter-password 31 | -------------------------------------------------------------------------------- /openshift/README.md: -------------------------------------------------------------------------------- 1 | ### Installing vmware_exporter in OpenShift 2 | 3 | Create the secret as described in the kubernetes documentation 4 | 5 | TODO: Use existing secret 6 | ``` 7 | read -s VSPHERE_PASSWORD 8 | oc create secret generic -n openshift-vsphere-infra vmware-exporter-password --from-literal=VSPHERE_PASSWORD=$VSPHERE_PASSWORD 9 | ``` 10 | 11 | Modify the `configmap.yaml` for your configuration and apply. 12 | 13 | ``` 14 | oc apply -f configmap.yaml 15 | ``` 16 | 17 | Apply the role, rolebinding, service, deployment and ServiceMonitor 18 | 19 | ``` 20 | oc apply -f rolebinding.yaml 21 | oc apply -f service.yaml 22 | oc apply -f deployment.yaml 23 | oc apply -f servicemonitor.yaml 24 | ``` 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /openshift/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | data: 3 | VSPHERE_COLLECT_DATASTORES: "True" 4 | VSPHERE_COLLECT_HOSTS: "True" 5 | VSPHERE_COLLECT_SNAPSHOTS: "False" 6 | VSPHERE_COLLECT_VMGUESTS: "True" 7 | VSPHERE_COLLECT_VMS: "True" 8 | VSPHERE_FETCH_ALARMS: "True" 9 | VSPHERE_FETCH_CUSTOM_ATTRIBUTES: "True" 10 | VSPHERE_FETCH_TAGS: "True" 11 | VSPHERE_HOST: vcenter 12 | VSPHERE_IGNORE_SSL: "True" 13 | VSPHERE_USER: user 14 | kind: ConfigMap 15 | metadata: 16 | labels: 17 | app: vmware-exporter 18 | name: vmware-exporter-config 19 | namespace: openshift-vsphere-infra 20 | -------------------------------------------------------------------------------- /openshift/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: vmware-exporter 5 | namespace: openshift-vsphere-infra 6 | spec: 7 | progressDeadlineSeconds: 600 8 | replicas: 1 9 | revisionHistoryLimit: 10 10 | selector: 11 | matchLabels: 12 | app: vmware-exporter 13 | k8s-app: vmware-exporter 14 | strategy: 15 | rollingUpdate: 16 | maxSurge: 25% 17 | maxUnavailable: 25% 18 | type: RollingUpdate 19 | template: 20 | metadata: 21 | creationTimestamp: null 22 | labels: 23 | app: vmware-exporter 24 | k8s-app: vmware-exporter 25 | release: vmware-exporter 26 | spec: 27 | containers: 28 | - envFrom: 29 | - configMapRef: 30 | name: vmware-exporter-config 31 | - secretRef: 32 | name: vmware-exporter-password 33 | image: quay.io/jcallen/vmware_exporter:add_metrics 34 | imagePullPolicy: Always 35 | name: vmware-exporter 36 | ports: 37 | - containerPort: 9272 38 | name: http 39 | protocol: TCP 40 | resources: {} 41 | terminationMessagePath: /dev/termination-log 42 | terminationMessagePolicy: File 43 | dnsPolicy: ClusterFirst 44 | restartPolicy: Always 45 | schedulerName: default-scheduler 46 | securityContext: {} 47 | terminationGracePeriodSeconds: 30 48 | -------------------------------------------------------------------------------- /openshift/rolebinding.yaml: -------------------------------------------------------------------------------- 1 | kind: Role 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | metadata: 4 | name: prometheus-k8s 5 | namespace: openshift-vsphere-infra 6 | rules: 7 | - verbs: 8 | - get 9 | - list 10 | - watch 11 | apiGroups: 12 | - '' 13 | resources: 14 | - services 15 | - endpoints 16 | - pods 17 | --- 18 | kind: RoleBinding 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | metadata: 21 | name: prometheus-k8s 22 | namespace: openshift-vsphere-infra 23 | subjects: 24 | - kind: ServiceAccount 25 | name: prometheus-k8s 26 | namespace: openshift-monitoring 27 | roleRef: 28 | apiGroup: rbac.authorization.k8s.io 29 | kind: Role 30 | name: prometheus-k8s 31 | -------------------------------------------------------------------------------- /openshift/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | k8s-app: vmware-exporter 6 | name: metrics 7 | namespace: openshift-vsphere-infra 8 | spec: 9 | ports: 10 | - name: metrics 11 | port: 9272 12 | protocol: TCP 13 | targetPort: 9272 14 | selector: 15 | k8s-app: vmware-exporter 16 | sessionAffinity: None 17 | type: ClusterIP 18 | -------------------------------------------------------------------------------- /openshift/servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: monitoring.coreos.com/v1 2 | kind: ServiceMonitor 3 | metadata: 4 | labels: 5 | k8s-app: vmware-exporter 6 | name: vmware 7 | namespace: openshift-monitoring 8 | spec: 9 | endpoints: 10 | - interval: 30s 11 | port: metrics 12 | scheme: http 13 | jobLabel: app 14 | namespaceSelector: 15 | matchNames: 16 | - openshift-vsphere-infra 17 | selector: 18 | matchLabels: 19 | k8s-app: vmware-exporter 20 | -------------------------------------------------------------------------------- /requirements-tests.txt: -------------------------------------------------------------------------------- 1 | pytest_docker_tools==0.2.0 2 | pytest==5.4.1 3 | pytest-cov==2.8.1 4 | pytest-twisted==1.12 5 | codecov==2.0.17 6 | flake8>=3.6.0 7 | pyflakes>=1.5.0 8 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | prometheus-client==0.0.19 2 | pytz 3 | pyvmomi>=6.5 4 | twisted>=14.0.2 5 | pyyaml>=5.1 6 | service-identity 7 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [semantic_release] 2 | version_variable = vmware_exporter/__init__.py:__version__ 3 | branch = main 4 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | import vmware_exporter 3 | 4 | setup( 5 | name='vmware_exporter', 6 | version=vmware_exporter.__version__, 7 | author=vmware_exporter.__author__, 8 | description='VMWare VCenter Exporter for Prometheus', 9 | long_description=open('README.md').read(), 10 | long_description_content_type="text/markdown", 11 | url='https://github.com/pryorda/vmware_exporter', 12 | download_url=("https://github.com/pryorda/vmware_exporter/tarball/%s" % 13 | vmware_exporter.__version__), 14 | keywords=['VMWare', 'VCenter', 'Prometheus'], 15 | license=vmware_exporter.__license__, 16 | packages=find_packages(exclude=['*.test', '*.test.*']), 17 | include_package_data=True, 18 | install_requires=open('requirements.txt').readlines(), 19 | entry_points={ 20 | 'console_scripts': [ 21 | 'vmware_exporter=vmware_exporter.vmware_exporter:main' 22 | ] 23 | } 24 | ) 25 | -------------------------------------------------------------------------------- /systemd/vmware_exporter.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus VMWare Exporter 3 | After=network.target 4 | 5 | [Service] 6 | User=prometheus 7 | Group=prometheus 8 | WorkingDirectory=/opt/prometheus/vmware_exporter/ 9 | ExecStart=/opt/prometheus/vmware_exporter/vmware_exporter.py 10 | Type=simple 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /tests/integration/test_container_health.py: -------------------------------------------------------------------------------- 1 | from pytest_docker_tools import container, build 2 | import requests 3 | 4 | 5 | vmware_exporter_image = build(path='.') 6 | 7 | vmware_exporter = container( 8 | image='{vmware_exporter_image.id}', 9 | ports={ 10 | '9272/tcp': None, 11 | }, 12 | ) 13 | 14 | 15 | def test_container_starts(vmware_exporter): 16 | container_addr = vmware_exporter.get_addr('9272/tcp') 17 | assert requests.get('http://{}:{}/healthz'.format(*container_addr)).status_code == 200 18 | 19 | 20 | def test_container_404(vmware_exporter): 21 | container_addr = vmware_exporter.get_addr('9272/tcp') 22 | assert requests.get('http://{}:{}/meetrics'.format(*container_addr)).status_code == 404 23 | -------------------------------------------------------------------------------- /tests/unit/test_helpers.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from unittest import mock 4 | 5 | from pyVmomi import vim 6 | 7 | from vmware_exporter.helpers import batch_fetch_properties, get_bool_env 8 | 9 | 10 | class FakeView(vim.ManagedObject): 11 | 12 | def __init__(self): 13 | super().__init__('dummy-moid') 14 | 15 | def Destroy(self): 16 | pass 17 | 18 | 19 | def test_get_bool_env(): 20 | # Expected behaviour 21 | assert get_bool_env('NON_EXISTENT_ENV', True) 22 | 23 | # #102 'bool("False") will evaluate to True in Python' 24 | os.environ['VSPHERE_COLLECT_VMS'] = "False" 25 | assert not get_bool_env('VSPHERE_COLLECT_VMS', True) 26 | 27 | # Environment is higher prio than defaults 28 | os.environ['ENVHIGHERPRIO'] = "True" 29 | assert get_bool_env('ENVHIGHERPRIO', False) 30 | assert get_bool_env('ENVHIGHERPRIO', True) 31 | 32 | os.environ['ENVHIGHERPRIO_F'] = "False" 33 | assert not get_bool_env('ENVHIGHERPRIO_F', False) 34 | assert not get_bool_env('ENVHIGHERPRIO_F', True) 35 | 36 | # Accent upper and lower case in env vars 37 | os.environ['ENVHIGHERPRIO_F'] = "false" 38 | assert not get_bool_env('ENVHIGHERPRIO_F', True) 39 | 40 | 41 | def test_batch_fetch_properties(): 42 | content = mock.Mock() 43 | 44 | # There is strict parameter checking - this must be a ManagedObject, not a mock, 45 | # but the real return value has methods with side effects. So we need to use a fake. 46 | content.viewManager.CreateContainerView.return_value = FakeView() 47 | 48 | mockCustomField1 = mock.Mock() 49 | mockCustomField1.key = 1 50 | mockCustomField1.name = 'customAttribute1' 51 | mockCustomField1.managedObjectType = vim.Datastore 52 | 53 | mockCustomField2 = mock.Mock() 54 | mockCustomField2.key = 2 55 | mockCustomField2.name = 'customAttribute2' 56 | mockCustomField1.managedObjectType = vim.VirtualMachine 57 | 58 | content.customFieldsManager.field = [ 59 | mockCustomField1, 60 | mockCustomField2, 61 | ] 62 | 63 | prop1 = mock.Mock() 64 | prop1.name = 'someprop' 65 | prop1.val = 1 66 | 67 | prop2 = mock.Mock() 68 | prop2.name = 'someotherprop' 69 | prop2.val = 2 70 | 71 | mock_props = mock.Mock() 72 | mock_props.obj._moId = 'vm:1' 73 | mock_props.propSet = [prop1, prop2] 74 | 75 | content.propertyCollector.RetrieveContents.return_value = [mock_props] 76 | 77 | results = batch_fetch_properties( 78 | content, 79 | vim.Datastore, 80 | ['someprop', 'someotherprop'], 81 | ) 82 | 83 | assert results == { 84 | 'vm:1': { 85 | 'obj': mock_props.obj, 86 | 'id': 'vm:1', 87 | 'someprop': 1, 88 | 'someotherprop': 2, 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /validate-signature.rb: -------------------------------------------------------------------------------- 1 | #!/bin/ruby 2 | require 'pre-commit-sign' 3 | if ARGV.length >= 1 4 | puts 'Validating signature' 5 | commit_message = ARGV[0] 6 | message_body = commit_message.split("\n").select { |l| l.start_with?(' ') }.join("\n").gsub(/^ /, '') 7 | pcs = PrecommitSign.from_message(message_body) 8 | pcs.date = DateTime.strptime(/^Date:\s+(.*)$/.match(commit_message).captures.first, '%a %b %d %T %Y %z').to_time 9 | puts "Commit Message: #{message_body}" 10 | if pcs.valid_signature? 11 | puts 'Perfect' 12 | else 13 | puts 'Not valid' 14 | exit 1 15 | end 16 | else 17 | puts "Need a commit message to validate signature from. Try pre-commit install -f && pre-commit install --install-hooks -t commit-msg -f before commiting your code." 18 | exit 1 19 | end 20 | -------------------------------------------------------------------------------- /vmware_exporter/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = '0.18.4' 2 | __author__ = "Daniel Pryor" 3 | __license__ = "BSD 3-Clause License" 4 | -------------------------------------------------------------------------------- /vmware_exporter/defer.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Helpers for writing efficient twisted code, optimized for coroutine scheduling efficiency 3 | ''' 4 | # autopep8'd 5 | 6 | from twisted.internet import defer 7 | from twisted.python import failure 8 | 9 | 10 | class BranchingDeferred(defer.Deferred): 11 | 12 | ''' 13 | This is meant for code where you are doing something like this: 14 | 15 | content = yield self.get_connection_content() 16 | results = yield defer.DeferredList([ 17 | self.get_hosts(content), 18 | self.get_datastores(content), 19 | ]) 20 | 21 | This allows get_hosts and get_datastores to run in parallel, which is good. 22 | But what if you don't want the whole of get_hosts to wait for 23 | get_connection_content() to be complete? 24 | 25 | We have a bunch of places where it would be better for scheduling if we did this: 26 | 27 | content = self.get_connection_content() 28 | results = yield defer.DeferredList([ 29 | self.get_hosts(content), 30 | self.get_datastores(content), 31 | ]) 32 | 33 | Now we don't have to wait for content to be finished before get_hosts etc 34 | starts running. It is up to get_hosts to block on the content deferred itself. 35 | 36 | (Thats a contrived example, the real win is allowing host_labels and 37 | vm_inventory to run in parallel). 38 | 39 | Unfortunately you can't have parallel branches blocking on the same deferred 40 | like this with a standard Twisted deferred. 41 | 42 | This is a deferred that enables the parallel branching use case. 43 | ''' 44 | 45 | def __init__(self): 46 | self.callbacks = [] 47 | self.result = None 48 | 49 | def callback(self, result): 50 | self.result = result 51 | while self.callbacks: 52 | self.callbacks.pop(0).callback(result) 53 | 54 | def errback(self, err): 55 | self.result = err 56 | while self.callbacks: 57 | self.callbacks.pop(0).errback(err) 58 | 59 | def addCallbacks(self, *args, **kwargs): 60 | if self.result is None: 61 | d = defer.Deferred() 62 | d.addCallbacks(*args, **kwargs) 63 | self.callbacks.append(d) 64 | return 65 | 66 | if isinstance(self.result, failure.Failure): 67 | defer.fail(self.result).addCallbacks(*args, **kwargs) 68 | return 69 | 70 | defer.succeed(self.result).addCallbacks(*args, **kwargs) 71 | 72 | 73 | class run_once_property(object): 74 | 75 | ''' 76 | This is a property descriptor that caches the first result it retrieves. It 77 | does this by setting keys in self.__dict__ on the parent class instance. 78 | This is fast - python won't even bother running our descriptor next time 79 | because attributes in self.__dict__ on a class instance trump descriptors 80 | on the class. 81 | 82 | This is intended to be used with the Collector class which has a request 83 | bound lifecycle (this isn't going to cache stuff forever and cause memory 84 | leaks). 85 | ''' 86 | 87 | def __init__(self, callable): 88 | self.callable = callable 89 | 90 | def __get__(self, obj, cls): 91 | if obj is None: 92 | return self 93 | result = obj.__dict__[self.callable.__name__] = BranchingDeferred() 94 | self.callable(obj).chainDeferred(result) 95 | return result 96 | 97 | 98 | @defer.inlineCallbacks 99 | def parallelize(*args): 100 | results = yield defer.DeferredList(args, fireOnOneErrback=True) 101 | return tuple(r[1] for r in results) 102 | -------------------------------------------------------------------------------- /vmware_exporter/helpers.py: -------------------------------------------------------------------------------- 1 | # autopep8'd 2 | import os 3 | from pyVmomi import vmodl 4 | 5 | 6 | def get_bool_env(key: str, default: bool): 7 | value = os.environ.get(key, default) 8 | return value if type(value) == bool else value.lower() == 'true' 9 | 10 | 11 | def batch_fetch_properties(content, obj_type, properties): 12 | view_ref = content.viewManager.CreateContainerView( 13 | container=content.rootFolder, 14 | type=[obj_type], 15 | recursive=True 16 | ) 17 | 18 | """ 19 | Gathering all custom attibutes names are stored as key (integer) in CustomFieldsManager 20 | We do not want those keys, but the names. So here the names and keys are gathered to 21 | be translated later 22 | """ 23 | if ('customValue' in properties) or ('summary.customValue' in properties): 24 | 25 | allCustomAttributesNames = {} 26 | 27 | if content.customFieldsManager and content.customFieldsManager.field: 28 | allCustomAttributesNames.update( 29 | dict( 30 | [ 31 | (f.key, f.name) 32 | for f in content.customFieldsManager.field 33 | if f.managedObjectType in (obj_type, None) 34 | ] 35 | ) 36 | ) 37 | 38 | try: 39 | PropertyCollector = vmodl.query.PropertyCollector 40 | 41 | # Describe the list of properties we want to fetch for obj_type 42 | property_spec = PropertyCollector.PropertySpec() 43 | property_spec.type = obj_type 44 | property_spec.pathSet = properties 45 | 46 | # Describe where we want to look for obj_type 47 | traversal_spec = PropertyCollector.TraversalSpec() 48 | traversal_spec.name = 'traverseEntities' 49 | traversal_spec.path = 'view' 50 | traversal_spec.skip = False 51 | traversal_spec.type = view_ref.__class__ 52 | 53 | obj_spec = PropertyCollector.ObjectSpec() 54 | obj_spec.obj = view_ref 55 | obj_spec.skip = True 56 | obj_spec.selectSet = [traversal_spec] 57 | 58 | filter_spec = PropertyCollector.FilterSpec() 59 | filter_spec.objectSet = [obj_spec] 60 | filter_spec.propSet = [property_spec] 61 | 62 | props = content.propertyCollector.RetrieveContents([filter_spec]) 63 | 64 | finally: 65 | view_ref.Destroy() 66 | 67 | results = {} 68 | for obj in props: 69 | properties = {} 70 | properties['obj'] = obj.obj 71 | properties['id'] = obj.obj._moId 72 | 73 | for prop in obj.propSet: 74 | 75 | """ 76 | if it's a custom value property for vms (summary.customValue), hosts (summary.customValue) 77 | or datastores (customValue) - we store all attributes together in a python dict and 78 | translate its name key to name 79 | """ 80 | if 'customValue' in prop.name: 81 | 82 | properties[prop.name] = {} 83 | 84 | if allCustomAttributesNames: 85 | 86 | properties[prop.name] = dict( 87 | [ 88 | (allCustomAttributesNames[attribute.key], attribute.value) 89 | for attribute in prop.val 90 | if attribute.key in allCustomAttributesNames 91 | ] 92 | ) 93 | 94 | elif 'triggeredAlarmState' == prop.name: 95 | """ 96 | triggered alarms 97 | """ 98 | try: 99 | alarms = list( 100 | 'triggeredAlarm:{}:{}'.format(item.alarm.info.systemName.split('.')[1], item.overallStatus) 101 | for item in prop.val 102 | ) 103 | except Exception: 104 | alarms = ['triggeredAlarm:AlarmsUnavailable:yellow'] 105 | 106 | properties[prop.name] = ','.join(alarms) 107 | 108 | elif 'runtime.healthSystemRuntime.systemHealthInfo.numericSensorInfo' == prop.name: 109 | """ 110 | handle numericSensorInfo 111 | """ 112 | sensors = list( 113 | 'numericSensorInfo:name={}:type={}:sensorStatus={}:value={}:unitModifier={}:unit={}'.format( 114 | item.name, 115 | item.sensorType, 116 | item.healthState.key, 117 | item.currentReading, 118 | item.unitModifier, 119 | item.baseUnits.lower() 120 | ) 121 | for item in prop.val 122 | ) 123 | properties[prop.name] = ','.join(sensors) 124 | 125 | elif prop.name in [ 126 | 'runtime.healthSystemRuntime.hardwareStatusInfo.cpuStatusInfo', 127 | 'runtime.healthSystemRuntime.hardwareStatusInfo.memoryStatusInfo', 128 | ]: 129 | """ 130 | handle hardwareStatusInfo 131 | """ 132 | sensors = list( 133 | 'numericSensorInfo:name={}:type={}:sensorStatus={}:value={}:unitModifier={}:unit={}'.format( 134 | item.name, 135 | "n/a", 136 | item.status.key, 137 | "n/a", 138 | "n/a", 139 | "n/a", 140 | ) 141 | for item in prop.val 142 | ) 143 | properties[prop.name] = ','.join(sensors) 144 | 145 | else: 146 | properties[prop.name] = prop.val 147 | 148 | results[obj.obj._moId] = properties 149 | 150 | return results 151 | --------------------------------------------------------------------------------