Giter Site home page Giter Site logo

frdmn / vmware-idle-snapshot-notifier Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 33 KB

Python script to send out (Rocket.Chat, Slack, Microsoft Teams, Telegram, mail) notifications for unused/idle VM snapshots found on vCenter/ESXi

License: MIT License

Python 100.00%
python pyvmomi vmware vcenter

vmware-idle-snapshot-notifier's Introduction

vmware-idle-snapshot-notifier

Simple Python script to connect to a vCenter/ESXi system and check any existing VMs for idle snapshots that are older than n days. If there are any matches it will send out a notification (to almost any platform whether its Rocket.Chat, Slack, Mattermost, Microsoft Teams, Telegram, E-Mail or HTTP) to a configurable recipient.

Installation

  1. Make sure you've installed all requirements

  2. Clone this repository:

    git clone https://github.com/frdmn/vmware-idle-snapshot-notifier
    cd vmware-idle-snapshot-notifier
  3. Install the project using pip:

    pip install -r requirements.txt
  4. Copy and adjust the default configuration file:

    cp config.json.sample config.json
    vi config.json

Usage / Arguments

$ python snapshots.py -h
usage: snapshots.py [-h] [--min-age-in-days MIN_AGE_IN_DAYS] [--config CONFIG]
                    [--debug]

Report idle VMware snapshots

optional arguments:
  -h, --help            show this help message and exit
  --min-age-in-days MIN_AGE_IN_DAYS
                        The minimum age in days of snapshots to report
  --config CONFIG       Path to configuration file
  --debug               Enable debug mode (optional)

Notification configuration

Below you can find a few (apprise) configuration examples:

Rocket.Chat

"rockets://ADmrL3CmetjNcBbn3/r8RKc9m4gcaS5xMwLf3NfnPArDPJBrLQMbqM7hyParFYP7t8@rocketchat.iwelt.de/?avatar=No"

E-Mail

mailtos://userid:[email protected]?smtp=smtp.server.com

Contributing

  1. Fork it

  2. Create your feature branch:

    git checkout -b feature/my-new-feature
  3. Commit your changes:

    git commit -am 'Add some feature'
  4. Push to the branch:

    git push origin feature/my-new-feature
  5. Submit a pull request

Requirements / Dependencies

  • Python 2/3
  • vCenter credentials

Version

1.0.0

License

MIT

vmware-idle-snapshot-notifier's People

Contributors

frdmn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vmware-idle-snapshot-notifier's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.