Skip to content

Instantly share code, notes, and snippets.

@djs52
djs52 / check_salt_state.py
Last active January 28, 2023 10:28
Nagios Salt check which tests the highstate
#!/usr/bin/env python
# Copyright © 2016 Dan Sheridan <dan.sheridan@postman.org.uk>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
import salt.client
import argparse
import sys
import fnmatch
@djs52
djs52 / check_salt.py
Created October 13, 2014 10:56
Simple Nagios Salt check
#!/usr/bin/env python
import salt.client
import argparse
import sys
parser = argparse.ArgumentParser(description='Check if minions are online.')
parser.add_argument('hostname', help='The name of the minion to be checked')
args = parser.parse_args()
@djs52
djs52 / gist:6380998
Created August 29, 2013 17:30
Output of sc /? on Windows Server 2003
ERROR: Unrecognized command
DESCRIPTION:
SC is a command line program used for communicating with the
Service Control Manager and services.
USAGE:
sc <server> [command] [service name] <option1> <option2>...
The option <server> has the form "\\ServerName"
@djs52
djs52 / spideroak-default.sh
Created September 24, 2012 16:30
Init script (/etc/init.d/spideroak) and default (/etc/default/spideroak) for SpiderOak from https://launchpad.net/~tonio
# defaults file for spideroak daemon headless mode
# SpiderOak does not currently support handling the initial setup of
# an account, or setup of a new device within an account entirely from
# the command line. This is because the new user setup process requires
# the user to answer a CAPTCHA and some other validation processes.
#
# Instead, we recommend connecting to the headless server using "ssh -X"
# to forward X11 connections back to your local desktop machine with X11
# running. Within your ssh session to the headless server, run SpiderOak