[munin]アラートメールを送る

muninでしきい値を超えた時にメールを送れるようなので設定してみました。

<環境>
Centos 6.3
Munin version 2.0

ハードディスク容量でテストしてみます

今の状態は


# munin-run df
_dev_vda3.value 2.72093653752988
_dev_shm.value 0.0282237832413447
_dev_vda1.value 21.9097563361532

設定を確認


# munin-run df config
graph_title Disk usage in percent
graph_args --upper-limit 100 -l 0
graph_vlabel %
graph_scale no
graph_category disk
_dev_vda3.label /
_dev_vda3.warning 92
_dev_vda3.critical 98
_dev_shm.label /dev/shm
_dev_shm.warning 92
_dev_shm.critical 98
_dev_vda1.label /boot
_dev_vda1.warning 92
_dev_vda1.critical 98

設定を変えます


# vim /etc/munin/munin.config

+ contact.email.command mail -s "Munin ${var:host}" sample@example.com
+ contact.email.max_messages 10
+ contact.email.always_send warning critical

[localhost]
    address 127.0.0.1
    use_node_name yes
+    df._dev_vda3.warning 1
+    df._dev_vda3.critical 2

テストメールを送ってみる


sudo -u munin sh -c "/usr/share/munin/munin-limits --contact email --force"

下記のようなメールが届きます


localhost :: localhost :: Disk usage in percent
	OKs: /boot is 21.91, /dev/shm is 0.03, / is 2.72.

localhost :: localhost :: Connections through firewall
	OKs: Total is 14.00.

localhost :: localhost :: Inode usage in percent
	OKs: /boot is 0.07, /dev/shm is 0.04, / is 1.62.

localhost :: localhost :: File table usage
	OKs: open files is 1184.00.

localhost :: localhost :: Disk latency per device :: Average latency for /dev/vda
	OKs: Read IO Wait time is 0.02, Write IO Wait time is 0.00.

localhost :: localhost :: eth0 errors
	OKs: errors is 0.00, errors is 0.00.

しきい値は、いい値に変更してください

[eccube]このウェブページにはリダイレクト ループが含まれていますのエラー

eccubeの環境を、ローカル構築中できた
と思って、管理画面にアクセスするとエラー発生

「このウェブページにはリダイレクト ループが含まれています」
.htaccessをみたけど、異常無し

調べてみると


vim data/config/config.php

define('ADMIN_FORCE_SSL', true);
↓
define('ADMIN_FORCE_SSL', false);

で直りました

「sudoers ファイル内にありません」のエラー

sudo 実行時にエラーが出た


testuser は sudoers ファイル内にありません。この事象は記録・報告されます。

突然、どうした。

id コマンドをうつと
uid=500(testuser) gid=500(testuser) 所属グループ=500(testuser),48(apache)

wheelグループがいない…

rootで入って
su root

グループを追加する
usermod -G apache,wheel testuser

複数グループのときは、カンマで区切って登録しないと
一つになってしまいます

testuserに戻って
exit;

sudoできたら直りました