Skip to content

Instantly share code, notes, and snippets.

View s-hironobu's full-sized avatar

Hironobu Suzuki s-hironobu

View GitHub Profile
@s-hironobu
s-hironobu / getConfParams.go
Created December 1, 2015 13:15
This program extracts all parameters in the specified PostgreSQL's configuration file which are located under the specified base directory.
package main
import (
"bufio"
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
)
@s-hironobu
s-hironobu / zabbix_argent.conf
Created July 17, 2014 00:41
zabbix UserParameter for MySQL slave status
UserParameter=mysql.slave,mysql --defaults-extra-file=/var/lib/zabbix/.my.cnf -e "SHOW SLAVE STATUS\G"|awk 'BEGIN{io="None";sql="None"}{if($1 ~/^Slave_IO_Running:$/){io=$2}else if($1 ~/^Slave_SQL_Running:$/){sql=$2}}END{if(io=="Yes" && sql=="Yes"){ret=0}else if(io=="No" && sql=="Yes"){ret=2}else if(io=="Yes" && sql=="No"){ret=3}else if(io=="No" && sql=="No"){ret=4}else if(io=="Connecting"){ret=1}else{ret=5};print ret}'