Posts Tagged ‘supérvision’



17
mar

Envoyé les notifications Munin par mail, au Syslog, a un compte Twitter

/etc/munin/munin.conf

Configuration des commandes d’envoie :

contact.mail1.command |mail -s "Munin-notification for ${var:group} :: ${var:host}" mail1@foo.com
contact.mail2.command |mail -s "Munin-notification for ${var:group} :: ${var:host}" mail2@foo.com

Pour envoyé les notifications a chaque check au contact « mail1″:

contact.mail1.always_send warning critical

Envoyé une alerte sur un compte Twitter

contact.twitter.command /etc/munin/send2twitter.sh

Script send2twitter.sh

#!/bin/sh
DATASTDIN=$(tr '[:upper:]' '[:lower:]' < /dev/stdin)
RESULT=`curl -s --basic -u votrelogin:votremotdepasse -d status="$DATASTDIN" http://twitter.com/statuses/update.json`

Le script send2twitter.sh doit avoir les droits d’exécution avec le compte utilisé par Munin.

Envoyé au syslog

contact.syslog.command logger -p user.crit -t "Munin-Alert"

plugin de test

Ce plugin munin sera toujours en état critique.

!/usr/bin/ruby

if ARGV[0] == 'config'
  puts "value.label Some Label"
  puts "value.warning 100"
  puts "value.critical 150"
else
  puts "value.value 200"
end
7
août

Superviser l’état d’une réplication MySQL

Vous pouvez utiliser la commande suivante pour superviser l’état d’une réplication MySQL :

# mysql -E -h 192.168.1.1 -usupervision -pmotdepasse -e « show slave status » | grep -i slave | grep -vi log

  • -E : Affiche le résultat en colone
  • -h : adresse du serveur MySQL
  • -u : Utilisateur
  • -p : Mot de passe
  • -e : Commande

Si la replication est active, cela vous affichera cela :

Slave_IO_State: Waiting for master to send event
Slave_IO_Running: Yes
Slave_SQL_Running: Yes

Celadon theme by the Themes Boutique