Facilitate monitoring of Jenkins servers in your enterprise organisation.
- System running CentOS v7.x (this is your monitoring agent)
- Additional system Packages
- netcat (preferred 7.50)
- Python v2.7.x
- Additional Python packages
- paramiko (preferred 2.6.0)
- In the server running the Jenkins service, SSH service should be enabled, to accept incoming connection requests at port #22.
- For the user's login id, that shall execute this script, enable passwordless authentication (from the monitoring agent) to connect to the server running the Jenkins service.
- Jenkins is installed as system package (using, for example,
yum install ...
)
Iterate through the entries in servers.yaml
, and for each Jenkins host
that's in production (active: true
), perform series of health checks.
a. Initial Health Checks
- ICMP response
- Scan ports,
- SSH (22)
- HTTPS (8443) [ as set in
servers.yaml
]
b. Extended Health Checks
- Capability of the Server, running the Jenkins service, to accept incoming SSH connection requests.
- Status of Jenkins process in the Jenkins server.
- Measure (thrice) the HTTP response with decreasing
timeout
.
- Clone this repository
- To monitor the Jenkins instance, update these entries in
servers.yaml
. All of these entries together constitute the server info block that's used by the tool.- active:
true
- host:
jenkins-hostname
- url:
"URL-to-jenkins"
- port:
jenkins-port
- active:
- Execute the script, like this,
cd <repo-cloned-dir>
python bin/monitor.py
For every execution of the script, the output is,
- Directed to terminal console.
- Also saved in, jenkins_monitor_<date_time>.log
- Retain the server in
servers.yaml
but do not consider for monitoring. Is it possible?
- YES, in
servers.yaml
, set the server as inactive, in the the info block for the desired server, like this.active: false
- What's the plan to support platforms other than CentOS? Please see this issue