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 'nokogiri' | |
| require 'open-uri' | |
| print "How many cards? " | |
| CARDS_IN_CUBE = gets.strip.to_i | |
| print "What format? " | |
| LEGAL_IN_FORMAT = gets.strip | |
| card_count = 1 | |
| # Create or open a text file in the same directory as this file and stores the card names there. |
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
| 1. Download the plugin from: https://github.com/sensu/sensu-community-plugins/blob/master/handlers/remediation/sensu.rb | |
| 2. Create the handler definition: | |
| { | |
| "handlers": { | |
| "remediator": { | |
| "type": "pipe", | |
| "command": "/etc/sensu/handlers/remediator.rb" | |
| } | |
| } | |
| } |
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
| - name: Update cpucrit threshold | |
| lineinfile: 'dest=/etc/sensu/conf.d/standalone/user/thresholds_client.json regexp=(.*)cpucrit(.*) line=\"cpucrit\":{{ item }},' | |
| with_items: | |
| - "{{ cpucrit }}" | |
| when: cpucrit is defined | |
| tags: | |
| - mbt |
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 | |
| # Make sure we have the dev tools | |
| yum groupinstall "Development Tools" | |
| # Just in case you started installing dependencies from yum | |
| yum -y remove libnfnetlink | |
| # lets put the source code here | |
| mkdir -p ~/.src |
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
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| # GNU General Public License for more details. | |
| # |
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 |
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
| # 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
| #!/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
| #! /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: |