Skip to content

Instantly share code, notes, and snippets.

View theeye-io's full-sized avatar

TheEye.io theeye-io

View GitHub Profile
@theeye-io
theeye-io / checkResponseTime.js
Created May 10, 2017 03:40
Response Time Check using curl and nodejs
var exec = require('child_process').exec;
var url = process.argv[2];
var threshold = parseFloat(process.argv[3]);
var eventName;
var state;
var cmd = 'curl -o /dev/null -s -w %{time_total} ' + url;
@theeye-io
theeye-io / mailqueuemonitor.sh
Created April 19, 2017 23:50
This Script Monitors Linux mail queue
#!/bin/bash
mailq_count=`/usr/bin/mailq | /usr/bin/tail -n1 | /usr/bin/gawk '{print $5}'`
mailq_count=`expr $mailq_count + 0`
echo "Mail count on Server is $mailq_count"
result="normal"
if [ $mailq_count -gt $1 ]; then
result="failure"
fi
echo $result
@theeye-io
theeye-io / checkIfThereAreRemoteChangesOnGit.sh
Last active February 11, 2017 16:16
script for check if there are remote changes on git comparing to your local directory
#!/bin/bash
cd $1
#For enforce local changes removal, uncomment the following line
#git reset --hard HEAD;git clean -fd
diffs=$(git diff origin |wc -l)
result="NORMAL"
echo "Verifying changes at $1, Differences between local and remote are $diffs"
if [ "$diffs" -gt 0 ]
then
result="FAILURE"
@theeye-io
theeye-io / checkDriveFreeSpaceWMIC.bat
Last active December 21, 2016 15:14
checkDriveFreeSpaceWMIC.bat
rem compatible from windows version 2003. Ejemplo C:,3000000 (bytes)
@echo off
set drive=%1
shift
set threshold=%1
shift
rem woooojojojo! todo esto solo para obtener el espacio libre .
for /f "usebackq delims== tokens=2" %%x in (`wmic logicaldisk where "DeviceID='%drive%'" get FreeSpace /format:value`) do set FreeSpace=%%x
@theeye-io
theeye-io / F5_getTotalAvailableMembersForAPool.sh
Created December 1, 2016 20:30
get total available members from an old F5 LoadBalancer's pool. V.0.10.x
#!/bin/bash
which expect > /dev/null
if [ "$?" -eq "1" ];then echo FAILURE
else
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];then echo FAILURE Some var are undefined set PASS $1 POOL $2 MEMBERS $3;exit;fi
PASS=$1
POOL=$2
MEMBERS=$3
tempFile=/tmp/resultado$POOL
sudo rm $tempFile
@theeye-io
theeye-io / F5_addHost.sh
Last active December 1, 2016 20:25
Bash / Expect script for add a node into an old F5 LoadBalancer's pool.
#!/bin/bash
which expect > /dev/null
if [ "$?" -eq "1" ];then echo FAILURE
else
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];then echo FAILURE Some var is undefined set PASS $1 POOL $2 ipAndPort $3;exit;fi
PASS=$1
POOL=$2
ipAndPort=$3
tempFile=/tmp/resultado
#Variable
@theeye-io
theeye-io / F5_disableHost.sh
Last active December 1, 2016 20:24
Bash / Expect script for disable a node from an old F5 LoadBalancer's pool.
#!/bin/bash
which expect > /dev/null
if [ "$?" -eq "1" ];then echo FAILURE
else
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];then echo FAILURE Some var is undefined set PASS $1 POOL $2 ipAndPort $3;exit;fi
PASS=$1
POOL=$2
ipAndPort=$3
tempFile=/tmp/resultado
#Variable
@theeye-io
theeye-io / F5_addAndEnableHost.sh
Last active December 1, 2016 20:17
Bash / Expect script for add And enable a node into an old F5 LoadBalancer's pool.
#!/bin/bash
which expect > /dev/null
if [ "$?" -eq "1" ];then echo FAILURE
else
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];then echo FAILURE Some var is undefined set PASS $1 POOL $2 ipAndPort $3;exit;fi
PASS=$1
POOL=$2
ipAndPort=$3
tempFile=/tmp/resultado
#Variable
@theeye-io
theeye-io / F5_enableHost.sh
Last active December 1, 2016 20:17
This script enables a node into a pool from an old F5 LoadBalancer's pool.
#!/bin/bash
which expect > /dev/null
if [ "$?" -eq "1" ];then echo FAILURE
else
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];then echo FAILURE Some var is undefined set PASS $1 POOL $2 ipAndPort $3;exit;fi
PASS=$1
POOL=$2
ipAndPort=$3
tempFile=/tmp/resultado
#Variable