Micro Focus Expert
Micro Focus Expert
558 views

Monitor MC devices status with Jenkins

Hi,

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.

Enjoy!

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.