Monitor Failed Jenkins Job

We use Jenkins quite differently 🙂 ( I will write it the use case later ) , And although the Jenkins provides the Email alerting if the Job is unstable. But  in our scenario we wanted an aggregate Job monitoring for the jenkins job so that as soon as any of the Jenkins Job failed our level team got hold of it.

Below is the simple Python plugin I have written  to achieve this. This python script gets all jobs stats using the Jenkins API and then parses for the stability of the Job.

Advertisements

NRPE: Unable to read output

In my recent assignment I wanted to monitor the contents of a particular file and basis on that contents Nagios should send an alert. Pretty straight forward job 🙂

But there was a catch !!! the file that I wanted to monitor is actually owned by root user.

So my custom written plugin  was working very well when I am running manually (using root user ) but failing  when nagios was trying to run it via NRPE it was not working.

Solution :   Use Sudo to run the custom plugin , so that when NRPE tries to execute the script it is actually running as a root user.

For that , add a very restrictive entry in sudoers file , giving access to the Nagios user only for that single command as below,

nagios ALL=(ALL) NOPASSWD: /usr/local/nagios/libexec/check_my_file

and in the nrpe.cfg use sudo to run the command , as shown below

command[check_my_file]=sudo /usr/local/nagios/libexec/check_my_file

and its done 🙂

Note :  On Centos and Redhat Machines you also need to turn off the requiretty option in your suoders file

Comment out the line,

#Defaults requiretty

Monitoring Windows Servers Agentlessly – WMI plugin

Tech Down Under: Part 1: Monitoring Windows Servers Agentlessly via…:

This how to will show how to install the open source software NAGIOS to monitor network devices such as switches, routers, servers, firewall…etc.

The detail instruction for installing WMI is found here

A good detail of installing wmi client and wmi plugin is available at interwebplus.com

Note : if your few of the perl modules were outdated, The check_wmi plugin will not work.

in that case you can use –IgnoreMyOutDatedPerlModuleVersions  case.