Skip to content

Instantly share code, notes, and snippets.

View jspaleta's full-sized avatar
🥌
🥌 🥌 🥌 🥌

Jef Spaleta jspaleta

🥌
🥌 🥌 🥌 🥌
View GitHub Profile
@jspaleta
jspaleta / asset_example
Last active June 18, 2019 22:02
Multiple Build Asset Strawman
---
type: Asset
api_version: core/v2
metadata:
name: jspaleta/monitoring-plugins
namespace: default
spec:
# Existing attributes -> added as build entry for backwards compatibility
sha512: asdasdas
url: http/what.up/asset.tar.gz
@jspaleta
jspaleta / namespace-RBAC-setup.yaml
Last active June 26, 2020 18:38
Generic Sensu Namespace RBAC Configuration
---
type: Namespace
api_version: core/v2
metadata: {}
spec:
name: <<namespace>>
---
type: Role
api_version: core/v2
metadata:
@jspaleta
jspaleta / sensu_go_ruby_assets_in_containers.md
Last active April 19, 2019 22:43
Quick Start for Sensu Ruby Plugin Checks in Sensu Go Agent containers using Sensu Assets

Quick Start

Setup Sensu Containers

Start Sensu Backend Container

docker run -v /tmp/sensu:/var/lib/sensu -d --name sensu-backend -p 2380:2380 -p 3000:3000 -p 8080:8080 -p 8081:8081 sensu/sensu:latest sensu-backend start

Note 1: this will mount your hosts /tmp/sensu directory into the container's /var/lib/sensu. Replace the host directory as needed for your environment. I use /tmp/sensu here to make it easy to clean up and get back to an unconfigured state.

Note 2: The sensu-backend service exposes all necessary ports to the local host so that you can interact with it as if it were running as a local service instead of a container.

@jspaleta
jspaleta / sensu_sudo_remediate.md
Last active March 28, 2019 19:32
Using sudo with sensu user for Sensu Go handlers

1. Setup sudoer using visudo on system hosting sensu-go backend

sudo visudo

2. Add sudo directives to allow sensu group to use a command without password

Ex: control nginx service

### Allow sensu group to control nginx service without requiring a password
%sensu ALL=NOPASSWD:/usr/bin/systemctl stop  nginx.service
%sensu ALL=NOPASSWD:/usr/bin/systemctl stop  nginx
server {
listen 8080 default_server;
listen [::]:8080 default_server;
server_name _;
root /usr/share/nginx/html;
# enable ssl encryption
ssl on;
ssl_certificate /etc/ssl/certs/nginx-proxy-selfsigned.crt;
@jspaleta
jspaleta / simple_proxy_example
Created June 17, 2018 18:29
simple_sensu_proxy_check_example
Very simple staticly defined sensu proxy check using ping command.
source attribute value be used in the check result to replace the client name.
replace <<HOST>> with hostname want
{
"checks": {
"ping-<<HOST>>": {
"command": "ping <<HOST>>",
"subscribers": [
"ping-proxy"