Monitor MC devices status with Jenkins
To monitor MC devices status, the following can be done as very easy setup. You will need:
1. Jenkins server (Linux or Windows)
2. Install Python 3.X (https://www.python.org/downloads/) on Jenkins server
3. Install Python Requests (http://docs.python-requests.org) on Jenkins server
4. Install Jenkins Python plugin (https://wiki.jenkins-ci.org/display/JENKINS/Python+Plugin)
5. Configure email notifications in Jenkins (if you are interested in receiving email alerts)
Now we are ready to roll...
1. Create Freestyle project
2. In Build Triggers add "Build Periodically" : H/10 * * * * (this will run the job every 10 minutes)
3. Add "Execute Pyton script" step and paste the attached code (right-click -> save link as ->rename it back to TXT -> copy the code -> update SERVER, USER and PASSWORD parameters)
4. In Post Build Actifons add Add Email notification (in case you are interested to get the failed notification)
5. Yay! Run the job - in case the disconnected device will be detected, the job will fail and you will get a status of all devices in the log (all connected and disconnected devices).
The script is leveraging Mobile Center REST API to get the information about current status of the devices.