This project includes two part: one is Python program to do the monitoring work, another is C# program to send email automatically to group peers.
The project is used to check the potential rule errors on the machine VAH06 and VAH20, and generate daily report.
Here are simple introductions of project hierarchy:
-
.idea
folder created by PyCharm IDE. You can ignore it for the most of time. -
csv_report
folder filled with data file extracted from server web page. They are all .csv files, which can be easily opened by Microsoft Office Excel. And some of them will be sent as email attachments. -
EmailSender
C# project folder created with Visual Studio 2012 to generate EmailSender.exe. You may modify it for your own needs. -
chromedriver.exe
chrome plugin for selenium. In my example, I use the chrome browser to do the automation test, so this plugin must be included. -
config.txt
main configuration file used by main.py and EmailSender.exe. It defines some custom variables with its own format to meet dynamic changes. -
EmailSender.exe
program created by EmailSender project and invoked by main.py to send emails automatically to group peers, since the email-sending code wrote by main.py didn't work well. -
errors.txt
error file generated by main.py to show the possible rule errors. -
main.py
core module script called by Python -
report.html
final report HTML file generated by main.py and sent by EmailSender.exe. Final example -
run.bat
bat helper file to launch the whole program. Executed by Windows Task Scheduler.
Main installation process is as follows:
- Install Chrome browser
- Install python2.7.9 and add locations "Python27","Python27\Scripts" to environment variable PATH
- Install python-selenium library. Use the following command in Command Prompt:
pip install -U selenium - Copy chromedriver.exe to PATH, you may choose to copy it to C:\windows\system32
- To run EmailSender.exe, .Net Framework 4.0 should be installed
- Copy the root directory to a location and create a basic task in Task Scheduler. Let the task points to run.bat and set the trigger time, then program will be runnng at the given time every day. Furthermore, if exceptions occur, email will be sent to the sender.
Maintainer: Lewis Chan
Mail: [email protected]