This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Pavan Kumar Sunkara | |
email = [email protected] | |
username = pksunkara | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[sendemail] | |
smtpencryption = tls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
EXIT_CODE=0 | |
STATUS_FILE=/tmp/drbd.status | |
STATUS=$(sed -e 's/.* state:\(.*\)$/\1/' $STATUS_FILE) | |
if [ "${STATUS}" != "MASTER" ]; then | |
echo "current status is ${STATUS}. skip" | |
exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
An example of how to remove comments and trailing commas from JSON before | |
parsing. You only need the two functions below, `remove_comments()` and | |
`remove_trailing_commas()` to accomplish this. This script serves as an | |
example of how to use them but feel free to just copy & paste them into your | |
own code/projects. Usage:: | |
json_cleaner.py some_file.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checking disks behind RAID controllers | |
RAID controllers typically simulate a (logical) disk for each array of (physical) disks to the OS. Access to SMART functionality relies on ATA or SCSI pass through I/O controls providing direct access to each physical disk. But the standard I/O controls available are usually not designed to make this distinction between logical and physical disks. Therefore, smartmontools has to use vendor specific I/O controls. Support for disks behind RAID controllers is highly dependent on both platform and controller type. | |
RAID-Controller Linux FreeBSD NetBSD OpenBSD MacOS Solaris Windows | |
LSI 3ware SATA RAID controller -d 3ware,N /dev/twX 1. -d 3ware,N /dev/twX 2. - - - - /dev/sdX,N 3. | |
Areca SATA[/SAS] RAID controller -d areca,N[/E] /dev/sgX 4. -d areca,N[/E] /dev/arcmsrX 11. - - - - -d areca,N[/E] /dev/arcmsrX 12. | |
HighPoint RocketRAID SATA RAID controller -d hpt,L/M/N /dev/sdX 5. -d hpt,L/M/N /dev/hptX 6. - - - - - | |
CCISS (HP/Compaq Smart Array Controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/sensu/embedded/bin/ruby | |
# Author: Hanine.H - magicOnline | |
# January 2018 | |
# Rudimentary Remediation For Sensu Client | |
# | |
# WARNING: Please do not forget to added permissions for user sensu | |
# in sudoers file. Example: | |
# sensu ALL=(root) NOPASSWD:/usr/sbin/service httpd reload | |
# sensu ALL=(root) NOPASSWD:/usr/sbin/service httpd restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# | |
# metrics-netstat-tcp | |
# | |
# DESCRIPTION: | |
# Fetch metrics on TCP socket states from netstat. This is particularly useful | |
# on high-traffic web or proxy servers with large numbers of short-lived TCP | |
# connections coming and going. | |
# | |
# OUTPUT: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Magic Online 2016 | |
# # This extension mutator is supposed to format sensu events to InfluxDb line format | |
#! /usr/bin/env ruby | |
# | |
# mutator-influxdb-line-protocol | |
# | |
# DESCRIPTION: | |
# Mutates check results to conform to InfluxDB's line protocol format | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A few examples about how to use Ruby for parsing files as we could do | |
# with Awk or Grep. This is based on what I learn fro this post: | |
# http://code.joejag.com/2009/using-ruby-as-an-awk-replacement/ | |
# Split each line with ':' and print the first $F[0] field | |
awk -F: '{ print $1 }' /etc/passwd | |
ruby -F: -nae 'puts $F[0]' /etc/passwd | |
# Parse the 'ps aux' output | |
# It'll print the ID process for the 'jojeda' user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "sensu/extension" | |
require 'redis' | |
require 'json' | |
require 'socket' | |
require 'time' | |
# Author: MOL - November 2016 | |
# Sensu: Tested on 0.26.5 | |
# License: MIT | |
# This Sensu extension handler sends sensu events to a logstash instance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: selected is undefined | |
this.getSelected@https://monitor.magic.fr/bower_components/uchiwa-web/js/common.js?rel=1479176171587:54:5 | |
this.silence@https://monitor.magic.fr/bower_components/uchiwa-web/js/services.js?rel=1479176171588:255:26 | |
$scope.silence@https://monitor.magic.fr/bower_components/uchiwa-web/js/controllers.js?rel=1479176171587:273:7 | |
anonymous/fn@https://monitor.magic.fr/bower_components/angular/angular.min.js?rel=1479176171588 line 218 > Function:2:409 | |
b@https://monitor.magic.fr/bower_components/angular/angular.min.js?rel=1479176171588:116:148 | |
Ic[b]</<.compile/</</e@https://monitor.magic.fr/bower_components/angular/angular.min.js?rel=1479176171588:259:195 | |
sf/this.$get</n.prototype.$eval@https://monitor.magic.fr/bower_components/angular/angular.min.js?rel=1479176171588:135:215 | |
sf/this.$get</n.prototype.$apply@https://monitor.magic.fr/bower_components/angular/angular.min.js?rel=1479176171588:135:447 | |
Ic[b]</<.compile/</<@https://monitor.magic.fr/bower_components/angular/angular.min.js?rel=1479176 |
NewerOlder