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.
-
Make sure you've installed all requirements
-
Clone this repository:
git clone https://github.com/frdmn/vmware-idle-snapshot-notifier cd vmware-idle-snapshot-notifier
-
Install the project using
pip
:pip install -r requirements.txt
-
Copy and adjust the default configuration file:
cp config.json.sample config.json vi config.json
$ 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)
Below you can find a few (apprise) configuration examples:
"rockets://ADmrL3CmetjNcBbn3/r8RKc9m4gcaS5xMwLf3NfnPArDPJBrLQMbqM7hyParFYP7t8@rocketchat.iwelt.de/?avatar=No"
mailtos://userid:password@server.com?smtp=smtp.server.com
-
Fork it
-
Create your feature branch:
git checkout -b feature/my-new-feature
-
Commit your changes:
git commit -am 'Add some feature'
-
Push to the branch:
git push origin feature/my-new-feature
-
Submit a pull request
- Python 2/3
- vCenter credentials
1.0.0