Skip to content

Instantly share code, notes, and snippets.

View junaid18183's full-sized avatar

Juned Memon junaid18183

View GitHub Profile
@junaid18183
junaid18183 / jenkins_check.py
Last active August 29, 2015 14:06
Nagios Plugin for Jenkins Overall Job's
#! /usr/bin/env python
#---------------------------------------------------------------------------------------------------------------
# Author:
# Juned Memon <[email protected]>
# This is a simple Nagios plugin to check if any of the defined Jenkins Job is getting failed.
#---------------------------------------------------------------------------------------------------------------
#Imports
import urllib2,sys,re,simplejson
#---------------------------------------------------------------------------------------------------------------
#Variables
@junaid18183
junaid18183 / haproxy_socat
Last active November 4, 2020 09:29
Haproxy stats with Socat
#Source - http://www.haproxy.org/download/1.5/doc/configuration.txt
# Section - 9.2. Unix Socket commands
#show stat [<iid> <type> <sid>]
# Dump statistics in the CSV format. By passing <id>, <type> and <sid>, it is
# possible to dump only selected items :
# - <iid> is a proxy ID, -1 to dump everything
# - <type> selects the type of dumpable objects : 1 for frontends, 2 for
# backends, 4 for servers, -1 for everything. These values can be ORed,
# for example:
@junaid18183
junaid18183 / hadoop-jobs.erb
Last active August 29, 2015 14:05
Dashing Widget for hadoop_job_tracker_stats
<% content_for :title do %>Hadoop dashboard<% end %>
<div class="gridster">
<ul>
<li data-row="1" data-col="1" data-sizex="2" data-sizey="1">
<div data-view="Clock"></div>
<i class="icon-time icon-background"></i>
</li>
<li data-row="2" data-col="1" data-sizex="1" data-sizey="1">
@junaid18183
junaid18183 / Readme
Last active August 22, 2019 16:25
Dashing Widget For Hadoop DFS Stats
This widget creats the dashing dashboard for Hadoop DFS stats.
There is Job which parses the hadoop DFS status page and provides the below widget_event_id's
#Configured_Capacity
#DFS_Used
#Non_DFS_Used
#DFS_Remaining
#DFS_Used%
#DFS_Remaining%
#Block_Pool_Used
@junaid18183
junaid18183 / Fabric-Setup.md
Last active November 16, 2016 09:56
Fabric-Setup

A Brief Introduction to Fabric

Fabric is a deployment management framework written in Python which makes remotely managing multiple servers incredibly easy. If you've ever had to issue a change to a group servers, this should look pretty familiar:

for s in $(cat servers.txt); do ssh $s service httpd graceful; done

Fabric improves on this process by providing a suite of functions to run commands on the servers, as well as a number of other features which just aren't possible in a simple for loop. While a working knowledge of Python is helpful when using Fabric, it certainly isn't necessary. This tutorial will cover the steps necessary to get started with the framework and introduce how it can be used to improve on administering groups of servers.

#!/usr/bin/python
#Author: Juned Memon
#Base for this script was created by: Andrew McDonald [email protected] http://mcdee.com.au and Jelle Bekker
# Example: config file
#[client]
#host = localhost
#user = root
#password = root-pass
@junaid18183
junaid18183 / jenkins_check.py
Last active August 29, 2015 14:03
jenkins_check.py
#! /usr/bin/env python
#---------------------------------------------------------------------------------------------------------------
# Author:
# Juned Memon <[email protected]>
# This is a simple Nagios plugin to check if any of the defined Jenkins Job is getting failed.
#---------------------------------------------------------------------------------------------------------------
#Imports
import urllib,sys,re
#import ast # using simplejson or json insted of ast
import simplejson
#!/bin/sh
#
# ## Plugin for Nagios to monitor the count of files in directory
# ## Written by Juned Memon
# ##
# ## - 20140312 Tested on Centos
#
#
# ## You are free to use this script under the terms of the Gnu Public License.
# ## No guarantee - use at your own risc.
#!/usr/bin/python
# +----------------------------------------------------------------------+
# | |
# | _ _ __ __ |
# | | | | | | \/ | |
# | | |_ _ _ __ ___ __| | | \ / | ___ _ __ ___ ___ _ __ |
# | _ | | | | | '_ \ / _ \/ _` | | |\/| |/ _ \ '_ ` _ \ / _ \| '_ \ |
# | | |__| | |_| | | | | __/ (_| | | | | | __/ | | | | | (_) | | | | |
# | \____/ \__,_|_| |_|\___|\__,_| |_| |_|\___|_| |_| |_|\___/|_| |_| |
# | |
@junaid18183
junaid18183 / Jenkins-install.info
Last active June 10, 2016 10:23
Install Jenkins and Tron on Centos
Important Pluging for Jenkins
Jenkins SSH plugin : https://wiki.jenkins-ci.org/display/JENKINS/SSH+plugin
Basic Configurarion : cat /var/lib/jenkins/config.xml
Jobs configuration : cat /var/lib/jenkins/jobs/<job-name>/config.xml