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
# -*- coding: utf-8 -*- | |
''' | |
Returns state event data for state.sls and state.highstate execution only using a tcp socket, this method of | |
returning data can be used for Splunk or ELK. | |
Each event sent represents a single state executed. | |
It is strongly recommended to use the ``event_return_whitelist`` so not all | |
events call this returner, for example: |
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
# We want to "install" | |
install | |
cdrom | |
# Set the language | |
lang en_US.UTF-8 | |
keyboard us |
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
$Server = $args[0] | |
$StartOfEpoch=New-Object DateTime(1900,1,1,0,0,0,[DateTimeKind]::Utc) | |
[Byte[]]$NtpData = ,0 * 48 | |
$NtpData[0] = 0x1B # NTP Request header in first byte | |
$Socket = New-Object Net.Sockets.Socket([Net.Sockets.AddressFamily]::InterNetwork, | |
[Net.Sockets.SocketType]::Dgram, | |
[Net.Sockets.ProtocolType]::Udp) | |
$Socket.Connect($Server,123) |
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
$execute = $args[0] | |
$argmuent = $args[1] | |
$working_directory = $args[2] | |
$task_name = $args[3] | |
$description = $args[4] | |
$get_task = Get-ScheduledTask $task_name -ErrorAction SilentlyContinue | |
if ($get_task) { | |
Write-Output "changed=no comment='Task name already exists, task not added.'" | |
} |
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
from subprocess import Popen, PIPE | |
from argparse import ArgumentParser | |
from pprint import pprint | |
import logging | |
import sys | |
import salt.client | |
import json | |
logging.basicConfig(stream=sys.stdout, |
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
__author__ = 'ryan currah' | |
import requests | |
from argparse import ArgumentParser | |
import csv | |
import logging | |
logging.basicConfig(filename=__file__.replace('.py', '.log'), | |
format='%(asctime)s %(levelname)s: %(message)s', | |
level=logging.DEBUG) |
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
import ast | |
from salt.config import minion_config, master_config | |
from argparse import ArgumentParser | |
from common.sensu import Sensu | |
sensu = Sensu() | |
def main(): | |
""" |
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
from os import listdir | |
from os.path import isfile | |
from argparse import ArgumentParser | |
from common.sensu import Sensu | |
from common.proc import Proc | |
sensu = Sensu() | |
def main(): |
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
import salt.client | |
from salt.config import apply_minion_config | |
from argparse import ArgumentParser | |
from common.sensu import Sensu | |
sensu = Sensu() | |
def main(): | |
""" |
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
import getpass | |
import logging | |
from keystoneclient.v2_0 import client | |
from keystoneclient import utils | |
from keystoneclient.openstack.common.apiclient import exceptions | |
from argparse import ArgumentParser | |
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.INFO) | |