Skip to content

Instantly share code, notes, and snippets.

View darioblanco's full-sized avatar

Darío Blanco Iturriaga darioblanco

View GitHub Profile
@darioblanco
darioblanco / remediator.json
Created May 30, 2018 08:33
Example of remediation handler config in /etc/sensu/conf.d/handlers/remediator.json
{
"handlers": {
"remediator": {
"command": "/etc/sensu/handlers/sensu.rb",
"type": "pipe",
"severities": ["critical"]
}
}
}
@darioblanco
darioblanco / check-zookeeper-proc.json
Created May 30, 2018 08:34
Zookeeper check with remediation
{
"checks": {
"check-zookeeper-proc": {
"command": "/etc/sensu/plugins/check-procs.rb -p '/usr/share/java/zookeeper.jar'",
"interval": 60,
"occurrences": 2,
"handlers": ["default", "remediator"],
"subscribers": ["zookeeper"],
"standalone": false,
"remediation": {
@darioblanco
darioblanco / remediate-zookeeper-proc.json
Created May 30, 2018 08:35
Unpublished remediation check
{
"checks": {
"remediate-zookeeper-proc": {
"command": "sudo supervisorctl restart zookeeper",
"handlers": [],
"subscribers": ["zookeper"],
"standalone": false,
"publish": false
}
}
@darioblanco
darioblanco / pod-with-anti-affinity.yaml
Created March 21, 2019 17:25
Example of pod anti affinity with label
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mypod
labels:
app: mypod-app
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution: