munin on FreeBSD 9.0 munin2

CPU

http://wiki.nothing.sh/page/NEC%20Express5800%A1%BFGT110b#cpu

https://www.cpubenchmark.net/CPU_mega_page.html

https://www.google.co.jp/#q=Xeon+X3470+%E4%BE%A1%E6%A0%BC

Xeon X3470

BIOS

F2 BIOS

F10 Boot選択

F12 NetworkBoot

not a reference at /usr/local/lib/perl5/site_perl/5.14/Munin/Master/Utils.pm line 863

/usr/local/lib/perl5/site_perl/5.14/Munin/Master/Utils.pm line 863 はここ

	# Write datafile.storable, in network order to be architecture indep
       Storable::nstore($data, $storable_filename_tmp);

locate storable して、

portupgrade -f p5-Storable-2.39

のあと、

portupgrade -f munin-common-2.0.17
portupgrade -f munin-master-2.0.17
portupgrade -f munin-node-2.0.17

で、OK /usr/local/etc/munin/munin.conf

htmldir /usr/local/www/apache22/data/munin

Magic number checking on storable file failed

なにか(は、忘れた)をportupgrade したあと(と思うw)から、munin が・・・エラーを吐いて、Web更新がとまった。

Magic number checking on storable file failed at /usr/local/lib/perl5/site_perl/5.14/mach/Storable.pm line 399,
at /usr/local/lib/perl5/site_perl/5.14/Munin/Master/Utils.pm line 279
Magic number checking on storable file failed at /usr/local/lib/perl5/site_perl/5.14/mach/Storable.pm line 399,
at /usr/local/lib/perl5/site_perl/5.14/Munin/Master/Utils.pm line 279

あまり聞いたことが無いエラー・・・なにそれ?

まぁ、ググってあれこれ迷うことしばし。で、これに行き当たる。

http://munin-monitoring.org/ticket/1364#no1

Solution: Locate munin/limits.storable and remove it. 
maybe add this to the startup, or shutdown script?

うちの環境だと、munin/limits.storable があるのは、/var/munin/limits.storable なので、コレを削除。

更新が再開されました。ふぅ。

Base class package "Net::Server::Fork" is empty.

root@piano2nd:/root # /usr/local/sbin/munin-node restart
Base class package "Net::Server::Fork" is empty.
   (Perhaps you need to 'use' the module which defines that package first,
    or make that module available in @INC (@INC contains: /usr/local/lib/perl5/5.12/BSDPAN
 /usr/local/lib/perl5/site_perl/5.12/mach /usr/local/lib/perl5/site_perl/5.12 
 /usr/local/lib/perl5/5.12/mach /usr/local/lib/perl5/5.12).
at /usr/local/lib/perl5/site_perl/5.12/Munin/Node/Server.pm line 5
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.12/Munin/Node/Server.pm line 5.
Compilation failed in require at /usr/local/sbin/munin-node line 36.
BEGIN failed--compilation aborted at /usr/local/sbin/munin-node line 36.
root@piano2nd:/root #
root@piano2nd:/root # portupgrade -fr p5-Net-Server-2.007
Can't locate IO/Socket/INET6.pm in @INC (@INC contains: 
portupgrade -f p5-IO-Socket-INET6-2.69

Can't locate Socket6.pm in @INC

root@piano2nd:/root # portupgrade -rf p5-Socket6-0.23

Can't locate URI.pm in @INC

portupgrade -fr p5-URI-1.60

piano2nd@FreeBSD 8.2-RELEASE

muninのインストール

piano2nd# portinstall sysutils/munin-node
piano2nd# portinstall sysutils/munin-master
piano2nd# rehash

設定

/usr/local/etc/munin/munin.conf

# htmldir /usr/local/www/munin
htmldir /usr/local/www/apache22/data/munin  ←コレを追加
piano2nd# mkdir /usr/local/www/apache22/data/munin
piano2nd# chown -R munin:munin /usr/local/www/apache22/data/munin
piano2nd# cd /usr/local/www
piano2nd# cp cgi-bin/munin-cgi-graph apache22/cgi-bin
piano2nd# cp -rp munin apache22/data
piano2nd# echo munin_node_enable="YES" >> /etc/rc.conf

munin-node 起動

piano2nd# /usr/local/sbin/munin-node restart

ログ確認

piano2nd# cat /var/log/munin/munin-node.log
Process Backgrounded
2012/08/11-08:56:24 Munin::Node::Server (type Net::Server::Fork) starting! pid(56004)
Resolved [*]:4949 to [0.0.0.0]:4949, IPv4
Binding to TCP port 4949 on host 0.0.0.0 with IPv4
Setting gid to "0 0"
piano2nd#

使えるプラグインを確認

http://techno-st.net/2009/12/10/munin-munin-node-configure.html

piano2nd# munin-node-configure -suggest
Plugin                     | Used | Suggestions
------                     | ---- | -----------
amavis                     | no   | no
apache_accesses            | no   | no [LWP::UserAgent not found]
apache_processes           | no   | no
apache_volume              | no   | no [LWP::UserAgent not found]
apc_envunit_               | no   | no [no units to monitor]
courier_mta_mailqueue      | no   | no [spooldir not found]
courier_mta_mailstats      | no   | no [could not find executable]
courier_mta_mailvolume     | no   | no [could not find executable]
cpu                        | no   | yes
cupsys_pages               | no   | no [could not find logdir]
dev_cpu_                   | no   | no [function not supported by kernel]
df                         | no   | yes
df_inode                   | no   | yes
exim_mailqueue             | no   | no [no exiqgrep]
exim_mailstats             | no   | no ['/usr/local/sbin/exim -bP log_file_path' returned an error]
fail2ban                   | no   | no [/usr/bin/fail2ban-client not found]
hddtemp_smartctl           | no   | no [first drive not supported, configure the plugin]
http_loadtime              | no   | no [need time and wget programs]
if_                        | no   | yes (+em0)
if_errcoll_                | no   | yes (+em0)
iostat                     | no   | yes
jmx_                       | no   | no [java runtime not found at /usr/bin/java]
load                       | no   | yes
lpstat                     | no   | no [lpstat not found]
memory                     | no   | yes
munin_stats                | no   | yes
mysql_                     | no   | no
netstat                    | no   | yes
nginx_request              | no   | no [LWP::UserAgent not found]
nginx_status               | no   | no [LWP::UserAgent not found]
ntp_kernel_err             | no   | yes
ntp_kernel_pll_freq        | no   | yes
ntp_kernel_pll_off         | no   | yes
ntp_offset                 | no   | yes
nvidia_                    | no   | no [no nvclock executable at /usr/bin/nvclock, please configure]
open_files                 | no   | yes
postfix_mailqueue          | no   | yes
postfix_mailvolume         | no   | yes
postgres_bgwriter          | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_cache_            | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_checkpoints       | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_connections_      | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_connections_db    | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_locks_            | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_querylength_      | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_scans_            | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_size_             | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_transactions_     | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_tuples_           | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_users             | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_xlog              | no   | no [DBD::Pg not found, and cannot do psql yet]
processes                  | no   | yes
ps_                        | no   | no
qmailqstat                 | no   | no
sendmail_mailqueue         | no   | yes
sendmail_mailstats         | no   | yes
sendmail_mailtraffic       | no   | yes
slapd_                     | no   | no [Net::LDAP not found]
slapd_bdb_cache_           | no   | no [Can't execute db_stat file '/usr/bin/db4.6_stat']
slony_lag_                 | no   | no [DBD::Pg not found, and cannot do psql yet]
smart_                     | no   | no [smartmontools not found]
snort_alerts               | no   | no [/var/snort/snort.stats not readable]
snort_bytes_pkt            | no   | no [/var/snort/snort.stats not readable]
snort_drop_rate            | no   | no [/var/snort/snort.stats not readable]
snort_pattern_match        | no   | no [/var/snort/snort.stats not readable]
snort_pkts                 | no   | no [/var/snort/snort.stats not readable]
snort_traffic              | no   | no [/var/snort/snort.stats not readable]
squeezebox_                | no   | no [no connection on localhost port 9090]
squid_cache                | no   | no [could not connect: Invalid argument]
squid_objectsize           | no   | no [could not connect: Connection refused]
squid_requests             | no   | no [could not connect: Invalid argument]
squid_traffic              | no   | no [could not connect: Invalid argument]
swap                       | no   | yes
systat                     | no   | yes
tomcat_                    | no   | no
users                      | no   | yes
varnish_                   | no   | no [which varnishstat returns blank]
vmstat                     | no   | yes
zimbra_                    | no   | no [No Text::CSV_XS]
# The following plugins caused errors:
# apache_processes:
#       Junk printed to stderr
# mysql_:
#       Non-zero exit during autoconf (2)

--shell を使ってプラグイン追加

piano2nd# munin-node-configure --shell
ln -s '/usr/local/share/munin/plugins/cpu' '/usr/local/etc/munin/plugins/cpu'
ln -s '/usr/local/share/munin/plugins/df' '/usr/local/etc/munin/plugins/df'
ln -s '/usr/local/share/munin/plugins/df_inode' '/usr/local/etc/munin/plugins/df_inode'
ln -s '/usr/local/share/munin/plugins/if_' '/usr/local/etc/munin/plugins/if_em0'
ln -s '/usr/local/share/munin/plugins/if_errcoll_' '/usr/local/etc/munin/plugins/if_errcoll_em0'
ln -s '/usr/local/share/munin/plugins/iostat' '/usr/local/etc/munin/plugins/iostat'
ln -s '/usr/local/share/munin/plugins/load' '/usr/local/etc/munin/plugins/load'
ln -s '/usr/local/share/munin/plugins/memory' '/usr/local/etc/munin/plugins/memory'
ln -s '/usr/local/share/munin/plugins/munin_stats' '/usr/local/etc/munin/plugins/munin_stats'
ln -s '/usr/local/share/munin/plugins/netstat' '/usr/local/etc/munin/plugins/netstat'
ln -s '/usr/local/share/munin/plugins/ntp_kernel_err' '/usr/local/etc/munin/plugins/ntp_kernel_err'
ln -s '/usr/local/share/munin/plugins/ntp_kernel_pll_freq' '/usr/local/etc/munin/plugins/ntp_kernel_pll_freq'
ln -s '/usr/local/share/munin/plugins/ntp_kernel_pll_off' '/usr/local/etc/munin/plugins/ntp_kernel_pll_off'
ln -s '/usr/local/share/munin/plugins/ntp_offset' '/usr/local/etc/munin/plugins/ntp_offset'
ln -s '/usr/local/share/munin/plugins/open_files' '/usr/local/etc/munin/plugins/open_files'
ln -s '/usr/local/share/munin/plugins/postfix_mailqueue' '/usr/local/etc/munin/plugins/postfix_mailqueue'
ln -s '/usr/local/share/munin/plugins/postfix_mailvolume' '/usr/local/etc/munin/plugins/postfix_mailvolume'
ln -s '/usr/local/share/munin/plugins/processes' '/usr/local/etc/munin/plugins/processes'
ln -s '/usr/local/share/munin/plugins/sendmail_mailqueue' '/usr/local/etc/munin/plugins/sendmail_mailqueue'
ln -s '/usr/local/share/munin/plugins/sendmail_mailstats' '/usr/local/etc/munin/plugins/sendmail_mailstats'
ln -s '/usr/local/share/munin/plugins/sendmail_mailtraffic' '/usr/local/etc/munin/plugins/sendmail_mailtraffic'
ln -s '/usr/local/share/munin/plugins/swap' '/usr/local/etc/munin/plugins/swap'
ln -s '/usr/local/share/munin/plugins/systat' '/usr/local/etc/munin/plugins/systat'
ln -s '/usr/local/share/munin/plugins/users' '/usr/local/etc/munin/plugins/users'
ln -s '/usr/local/share/munin/plugins/vmstat' '/usr/local/etc/munin/plugins/vmstat'
# The following plugins caused errors:
# apache_processes:
#       Junk printed to stderr
# mysql_:
#       Non-zero exit during autoconf (2)

プラグイン登録

piano2nd# munin-node-configure --shell | sh
# The following plugins caused errors:
# apache_processes:
#       Junk printed to stderr
# mysql_:
#       Non-zero exit during autoconf (2)

素の状態の5800/GT110bを見る

素の状態だとこんな感じ。出来ればハードウエア・ソフトウエアモニタは取れるだけ取ってみたいので、

piano2nd# munin-node-configure
Plugin                     | Used | Extra information
------                     | ---- | -----------------
amavis                     | no   |●
apache_accesses            | no   |●
apache_processes           | no   |●
apache_volume              | no   |●
apc_envunit_               | no   |
apc_nis                    | no   |
asterisk_channels          | no   |
asterisk_channelstypes     | no   |
asterisk_codecs            | no   |
asterisk_meetme            | no   |
asterisk_meetmeusers       | no   |
asterisk_sipchannels       | no   |
asterisk_sippeers          | no   |
asterisk_voicemail         | no   |
bind9                      | no   |●
bind9_rndc                 | no   |●
cmc_tc_sensor_             | no   |
colour_tester              | no   |
coretemp                   | no   |
courier_                   | no   |
courier_mta_mailqueue      | no   |
courier_mta_mailstats      | no   |
courier_mta_mailvolume     | no   |
cpu                        | yes  |
cupsys_pages               | no   |
dev_cpu_                   | no   |
df                         | yes  |
df_inode                   | yes  |
dhcpd3                     | no   |
digitemp_                  | no   |
ejabberd_                  | no   |
exim_mailqueue             | no   |
exim_mailqueue_alt         | no   |
exim_mailstats             | no   |
fail2ban                   | no   |
foldingathome              | no   |
foldingathome_rank         | no   |
foldingathome_wu           | no   |
freeradius_acct            | no   |
freeradius_auth            | no   |
freeradius_proxy_acct      | no   |
freeradius_proxy_auth      | no   |
haproxy_                   | no   |
hddtemp                    | no   |
hddtemp2                   | no   |
hddtemp_smartctl           | no   |
hddtempd                   | no   |
http_loadtime              | no   |
if_                        | yes  | em0
if_errcoll_                | yes  | em0
ifx_concurrent_sessions_   | no   |
iostat                     | yes  |
ipac-ng                    | no   |
ipmi_sensor_               | no   |◎
ircu                       | no   |
jmx_                       | no   |
load                       | yes  |
loggrep                    | no   |
lpstat                     | no   |
mailman                    | no   |●
mailscanner                | no   |
mbmon_                     | no   |◎
memcached_                 | no   |
memory                     | yes  |
mhttping                   | no   |
multiping                  | no   |
multips                    | no   |
multips_memory             | no   |
munin_stats                | yes  |
munin_update               | no   |
mysql_                     | no   |●
mysql_bytes                | no   |
mysql_innodb               | no   |
mysql_isam_space_          | no   |
mysql_queries              | no   |
mysql_slowqueries          | no   |
mysql_threads              | no   |
named                      | no   |●
netopia                    | no   |
netstat                    | yes  |
nginx_request              | no   |
nginx_status               | no   |
nomadix_users_             | no   |
ntp_                       | no   |
ntp_kernel_err             | yes  |
ntp_kernel_pll_freq        | yes  |
ntp_kernel_pll_off         | yes  |
ntp_offset                 | yes  |
ntp_states                 | no   |
nut_misc                   | no   |
nut_volts                  | no   |
nutups_                    | no   |
nvidia_                    | no   |
open_files                 | yes  |
openvpn                    | no   |
perdition                  | no   |
ping_                      | no   |
pm3users_                  | no   |
pop_stats                  | no   |
postfix_mailqueue          | yes  |
postfix_mailstats          | no   |
postfix_mailvolume         | yes  |
postgres_bgwriter          | no   |
postgres_cache_            | no   |
postgres_checkpoints       | no   |
postgres_connections_      | no   |
postgres_connections_db    | no   |
postgres_locks_            | no   |
postgres_querylength_      | no   |
postgres_scans_            | no   |
postgres_size_             | no   |
postgres_transactions_     | no   |
postgres_tuples_           | no   |
postgres_users             | no   |
postgres_xlog              | no   |
processes                  | yes  |
proxy_plugin               | no   |
ps_                        | no   |
psu_                       | no   |
qmailqstat                 | no   |
qmailscan                  | no   |
qmailscan-simple           | no   |
samba                      | no   |
sendmail_mailqueue         | yes  |
sendmail_mailstats         | yes  |
sendmail_mailtraffic       | yes  |
slapd_                     | no   |
slapd_bdb_cache_           | no   |
slony_lag_                 | no   |
smart_                     | no   |
snort_alerts               | no   |
snort_bytes_pkt            | no   |
snort_drop_rate            | no   |
snort_pattern_match        | no   |
snort_pkts                 | no   |
snort_traffic              | no   |
spamstats                  | no   |
squeezebox_                | no   |
squid_cache                | no   |
squid_icp                  | no   |
squid_objectsize           | no   |
squid_requests             | no   |
squid_traffic              | no   |
surfboard                  | no   |
swap                       | yes  |
sybase_space               | no   |
systat                     | yes  |
tomcat_                    | no   |
tomcat_access              | no   |
tomcat_jvm                 | no   |
tomcat_threads             | no   |
tomcat_volume              | no   |
uptime                     | no   |
users                      | yes  |
varnish_                   | no   |
vmstat                     | yes  |
zimbra_                    | no   |
piano2nd#

◎取りたい項目●取れれば取りたい項目

ということで、

ipmi関連

ipmiドライバがあるかどうかdmessageを確認

piano2nd# dmesg |grep ipmi
piano2nd# 

ということで、ドライバを入れる。

# kldload ipmi

/boot/loader.confに

 ipmi_load="YES" 

とか入れておけばよさそうです。

ipmiはsmbusに依存しているようなので、ipmiとsmbusが組み込まれます。

# kldstat
Id Refs Address            Size     Name
 1   11 0xffffffff80100000 c9fe20   kernel
 2    1 0xffffffff80da0000 15e0     accf_http.ko
 3    1 0xffffffff80e22000 6dc1     ipmi.ko
 4    1 0xffffffff80e29000 881      smbus.ko

再起動して

piano2nd# kldstat
Id Refs Address            Size     Name
 1   11 0xffffffff80100000 c9fe20   kernel
 2    1 0xffffffff80da0000 15e0     accf_http.ko
 3    1 0xffffffff80da2000 fba8     ipmi.ko
 4    2 0xffffffff80db2000 24c0     smbus.ko
piano2nd# dmesg | grep ipmi
piano2nd# dmesg | grep ipmi

ありゃ~、Express5800/GT110bには、ipmiは無い(゚◇゚)ガーン

mbmon 関連

portinstall sysutils/mbmon して、

piano2nd# mbmon
 No Hardware Monitor found!!
 InitMBInfo: Unknown error: 0

ありゃ(゜◇゜)ガーン。てことで・・・

piano2nd# kldload coretemp
piano2nd# kldstat
Id Refs Address            Size     Name
 1   13 0xffffffff80100000 c9fe20   kernel
 2    1 0xffffffff80da0000 15e0     accf_http.ko
 3    1 0xffffffff80da2000 fba8     ipmi.ko
 4    2 0xffffffff80db2000 24c0     smbus.ko
 5    1 0xffffffff80e22000 871      coretemp.ko
piano2nd# sysctl -a | grep temper
dev.cpu.0.temperature: 29.0C
dev.cpu.1.temperature: 28.0C

もいっかい

piano2nd# mbmon -D
Probe Request: none
>>> Testing Reg's at ISA-IO <<<
[ISA Port IO-Base:0x290]
Probing Winbond/Asus/LM78/79 chip:
 CR40:0x03,  CR41:0x00,  CR42:0x00,  CR43:0xFF
 CR44:0xFF,  CR45:0x00,  CR46:0x3F,  CR47:0x55
 CR48:0x2D,  CR49:0x00,  CR4A:0x20,  CR4B:0x44
 CR4C:0x90,  CR4D:0x95,  CR4E:0x80,  CR4F:0x5C
 CR56:0x00,  CR58:0xC1,  CR59:0x71,  CR5D:0x25
 CR3E:0x8C,  CR13:0x00,  CR17:0x3C,  CRA1:0xBD
 CR20:0x82,  CR22:0xD3,  CR23:0xD3,  CR24:0x8B
 CR27:0x62,  CR29:0xFF,  CR2A:0xFF,  CR2B:0xCA
* Temp1 exists at Bank 1, Temp2 exists at Bank 2.
Using ISA-IO access method!!
* Winbond Chip W83627HF/THF/THF-A found.
piano2nd# mbmon

Temp.= 98.0, 34.5, 37.0; Rot.=    0,    0,    0
Vcore = 2.06, 3.02; Volt. = 3.38, 5.67,  8.45,   4.18,  2.39 

ヨカタ( ´ ▽ ` )ノ

でも

piano2nd# munin-node-configure

mbmon_                     | no   |

な、まんま。(ーー;)

だけど、

root@piano2nd:~ # /usr/local/bin/mbmon -c 1 -r
TEMP0 : 98.0
TEMP1 : 37.0
TEMP2 : 36.5
FAN0  :    0
FAN1  :    0
FAN2  :    0
VC0   :  +2.02
VC1   :  +3.02
V33   :  +3.38
V50P  :  +5.64
V12P  :  +8.51
V12N  :  +4.18
V50N  :  +2.39

となるので、

root@piano2nd:~ # cd /usr/local/etc/munin/plugins/
root@piano2nd:/usr/local/etc/munin/plugins # ln -s /usr/local/share/munin/plugins/mbmon_ ./mbmon_FAN
root@piano2nd:/usr/local/etc/munin/plugins # ln -s /usr/local/share/munin/plugins/mbmon_ ./mbmon_Voltage
root@piano2nd:/usr/local/etc/munin/plugins # ln -s /usr/local/share/munin/plugins/mbmon_ ./mbmon_TEMP

root@piano2nd:/usr/local/etc/munin/plugins # /usr/local/etc/rc.d/munin-node restart

で、グラフ化可能となります。が、TEMP0の98度は???なので、消しておく。w

/usr/local/share/munin/plugins/mbmon_

case $what in
	TEMP)
		echo 'graph_title Motherboard Temperature'
		#echo 'graph_order TEMP0 TEMP2 TEMP1'
		echo 'graph_order TEMP2 TEMP1'
		echo 'graph_category sensors'
		echo 'graph_vlabel C'
		echo 'graph_scale no'
		#echo 'TEMP0.label Temperature 1'
		##echo 'TEMP0.label Temperature 1'
		echo 'TEMP1.label Temperature 2'
		echo 'TEMP2.label Temperature 3'
		exit 0
		;;

bind9

munin de bind9 をモニターするよ

/var/named/etc/namedb/log/named.log

14-Feb-2014 03:27:45.586 security: client 107.170.18.26#27634 (.): view external: query (cache) './ANY/IN' denied

/var/named/etc/namedb/log/queries.log

14-Feb-2014 04:38:56.343 queries: client 184.154.224.9#22139 (.): view external: query: . IN ANY +E (219.117.246.211)
/usr/local/share/munin/plugins/bind9
/usr/local/share/munin/plugins/bind9_rndc
ln -s '/usr/local/share/munin/plugins/bind9' '/usr/local/etc/munin/plugins/bind9'
ln -s '/usr/local/share/munin/plugins/bind9_rndc' '/usr/local/etc/munin/plugins/bind9_rndc'
/usr/local/etc/rc.d/munin-node restart

/usr/local/share/munin/plugins/bind9

[bind9]
user root ←これを加えとく
#    env.logfile   /var/log/bind9/query.log 
    env.logfile   /var/named/etc/namedb/log/query.log

You must also configure query logging in your named.conf. Use a stanza
such as this:

 logging {
     channel query {
#        file "query.log" versions 2 size 1m;
         file "query.log" versions 30 size 100m;
         print-time yes;
         severity info;
     };

     category queries { query; };
 };

=head1 SEE ALSO

=over

=item * L<http://blog.larsstrand.org/2008/02/how-to-monitor-bind-with-munin.html>

=item * BIND Administrator Reference Manual

=back

=head1 AUTHOR

Nicolai Langfeldt

=head1 LICENSE

GPLv2

=head1 MAGIC MARKERS

  #%# family=manual

=cut

use strict;

#my $QUERYLOG = $ENV{logfile} || '/var/log/bind9/query.log';
my $QUERYLOG = $ENV{logfile} || '/var/named/etc/namedb/log/query.log';
#my $STATEFILE= "$ENV{MUNIN_PLUGSTATE}/bind9.state";
my $STATEFILE= "$ENV{MUNIN_PLUGSTATE}/named.log";

my $OTHER=0;

Guard@8.2-RELEASE

********************************************************************
Unless this file already existed, a sample configuration file
has been placed in /usr/local/etc/munin/munin.conf.

Please edit it according to your needs.

The Munin server will be run from cron under the user 'munin'.
********************************************************************
===> Correct pkg-plist sequence to create group(s) and user(s)
===>   Compressing manual pages for munin-master-1.4.7_3
===>   Registering installation for munin-master-1.4.7_3
===>  Cleaning for munin-master-1.4.7_3
guard# reash
reash: Command not found.
guard# rehash
guard# mkdir /usr/local/www/apache22/data/munin
guard# chown -R munin:munin /usr/local/www/apache22/data/munin
guard# cd /usr/local/www
guard# ll
total 8
drwxr-xr-x  6 root   wheel  512 Feb 12 10:12 apache22
drwxr-xr-x  2 root   wheel  512 Aug 10 14:25 cgi-bin
drwxr-xr-x  2 root   wheel  512 Oct 30  2011 icons
drwxr-xr-x  2 munin  munin  512 Aug 10 14:25 munin
guard# cp cgi-bin/munin-cgi-graph apache22/cgi-bin
guard# cp -rp munin apache22/data
guard# echo munin_node_enable="YES" >> /etc/rc.conf
guard# /usr/local/sbin/munin-node restart
guard#
guard#
guard# apachectl restart
guard# ln -s /usr/local/share/munin/plugins/memory /usr/local/etc/munin/plugins/memory
guard# ln -s /usr/local/share/munin/plugins/cpu /usr/local/etc/munin/plugins/cpu
guard# ln -s /usr/local/share/munin/plugins/coretemp /usr/local/etc/munin/plugins/coretemp
guard# cat /var/log/munin/munin-node.log
Process Backgrounded
2012/08/10-14:28:11 Munin::Node::Server (type Net::Server::Fork) starting! pid(88883)
Resolved [*]:4949 to [0.0.0.0]:4949, IPv4
Binding to TCP port 4949 on host 0.0.0.0 with IPv4
Setting gid to "0 0"
2012/08/10-14:30:00 CONNECT TCP Peer: "[127.0.0.1]:62397" Local: "[127.0.0.1]:4949"
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/site_perl/5.10.1/Net/Server.pm line 600.
2012/08/10-14:35:00 CONNECT TCP Peer: "[127.0.0.1]:26369"  ocal: "[127.0.0.1]:4949"
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/site_perl/5.10.1/Net/Server.pm line 600.
2012/08/10-14:40:00 CONNECT TCP Peer: "[127.0.0.1]:31368" Local: "[127.0.0.1]:4949"
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/site_perl/5.10.1/Net/Server.pm line 600.

普通に kill -HUP すると、再起動できず?

2012/08/10-15:12:45 HUP'ing server
Insecure dependency in exec while running with -T switch at /usr/local/lib/perl5/site_perl/5.10.1/Net/Server.pm line 861.
Process Backgrounded
2012/08/10-15:15:32 Munin::Node::Server (type Net::Server::Fork) starting! pid(89478)

munin-node の再起動

FreeBSD で ports を使ってインストールした場合には, 「/usr/local/sbin/munin-node restart 」になる.

/usr/local/sbin/munin-node restart

mbmon

https://bompopo.wordpress.com/2009/10/09/mbmon%E3%81%A7hw%E6%83%85%E5%A0%B1%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B/

guard# mbmon -D
Probe Request: none
>>> Testing Reg's at ISA-IO <<<
[ISA Port IO-Base:0x290]
Probing Winbond/Asus/LM78/79 chip:
  CR40:0x03,  CR41:0x00,  CR42:0x00,  CR43:0xFF
  CR44:0xFF,  CR45:0x00,  CR46:0x3F,  CR47:0x25
  CR48:0x2D,  CR49:0x00,  CR4A:0x20,  CR4B:0x04
  CR4C:0x90,  CR4D:0x95,  CR4E:0x00,  CR4F:0xA3
  CR56:0x00,  CR58:0xC1,  CR59:0x71,  CR5D:0x05
  CR3E:0x8C,  CR13:0x00,  CR17:0x3C,  CRA1:0xBE
  CR20:0x85,  CR22:0xD3,  CR23:0xD3,  CR24:0x91
  CR27:0x62,  CR29:0xFF,  CR2A:0xFF,  CR2B:0xCA
* Temp1 exists at Bank 1, Temp2 exists at Bank 2.
Using ISA-IO access method!!
* Winbond Chip W83627HF/THF/THF-A found.
guard# kldload smb.ko
guard# kldload ichsmb.ko
guard# kldstat
Id Refs Address    Size     Name
 1    8 0xc0400000 bb5504   kernel
 2    1 0xc6e49000 3000     smb.ko
 3    2 0xc7854000 3000     smbus.ko
 4    1 0xc8ed6000 4000     ichsmb.ko
guard# mbmon

Temp.= 98.0, 40.5, 33.0; Rot.=    0,    0,    0
Vcore = 2.14, 3.04; Volt. = 3.38, 5.67,  8.88,   4.34,  2.54


Temp.= 98.0, 40.5, 33.0; Rot.=    0,    0,    0
Vcore = 2.16, 3.04; Volt. = 3.38, 5.67,  8.88,   4.34,  2.54

Temp.= 98.0, 40.5, 33.0; Rot.=    0,    0,    0
Vcore = 2.16, 3.04; Volt. = 3.38, 5.67,  8.82,   4.34,  2.54
^C

次回起動時には自動でモジュールをロードするために、loader.confに以下を記述。

/boot/loader.conf

smb_load="YES"
ichsmb_load="YES"

coretemp

guard# kldload coretemp
guard# kldstat
Id Refs Address    Size     Name
 1   10 0xc0400000 bb5504   kernel
 2    1 0xc6e49000 3000     smb.ko
 3    2 0xc7854000 3000     smbus.ko
 4    1 0xc8ed6000 4000     ichsmb.ko
 5    1 0xc8e5d000 3000     coretemp.ko
guard# sysctl -a | grep temper
dev.cpu.0.temperature: 34.0C
dev.cpu.1.temperature: 31.0C

/boot/loader.conf

coretemp_load="YES"

guard# portinstall sysutils/ipmitool

/boot/loader.conf

ipmi_load="YES"

guard# munin-node-configure -suggest

http://techno-st.net/2009/12/10/munin-munin-node-configure.html

Plugin                     | Used | Suggestions
------                     | ---- | -----------
amavis                     | no   | no
apache_accesses            | no   | no [LWP::UserAgent not found]
apache_processes           | no   | no [LWP::UserAgent not found]
apache_volume              | no   | no [LWP::UserAgent not found]
apc_envunit_               | no   | no [no units to monitor]
courier_mta_mailqueue      | no   | no [spooldir not found]
courier_mta_mailstats      | no   | no [could not find executable]
courier_mta_mailvolume     | no   | no [could not find executable]
cpu                        | yes  | yes
cupsys_pages               | no   | no [could not find logdir]
dev_cpu_                   | no   | no [function not supported by kernel]
df                         | no   | yes
df_inode                   | no   | yes
exim_mailqueue             | no   | no [no exiqgrep]
exim_mailstats             | no   | no ['/usr/local/sbin/exim -bP log_file_path' returned an error]
fail2ban                   | no   | no [/usr/bin/fail2ban-client not found]
hddtemp_smartctl           | yes  | no [first drive not supported, configure the plugin]
http_loadtime              | no   | no [need time and wget programs]
if_                        | no   | yes (+em0)
if_errcoll_                | no   | yes (+em0)
iostat                     | no   | yes
jmx_                       | no   | no [java runtime not found at /usr/bin/java]
load                       | no   | yes
lpstat                     | no   | no [lpstat not found]
memory                     | yes  | yes
munin_stats                | no   | yes
mysql_                     | no   | no
netstat                    | no   | yes
nginx_request              | no   | no [LWP::UserAgent not found]
nginx_status               | no   | no [LWP::UserAgent not found]
ntp_kernel_err             | no   | yes
ntp_kernel_pll_freq        | no   | yes
ntp_kernel_pll_off         | no   | yes
ntp_offset                 | no   | yes
nvidia_                    | no   | no [no nvclock executable at /usr/bin/nvclock, please configure]
open_files                 | no   | yes
postfix_mailqueue          | yes  | yes
postfix_mailvolume         | no   | yes
postgres_bgwriter          | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_cache_            | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_checkpoints       | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_connections_      | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_connections_db    | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_locks_            | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_querylength_      | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_scans_            | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_size_             | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_transactions_     | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_tuples_           | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_users             | no   | no [DBD::Pg not found, and cannot do psql yet]
postgres_xlog              | no   | no [DBD::Pg not found, and cannot do psql yet]
processes                  | no   | yes
ps_                        | no   | no
qmailqstat                 | no   | no
sendmail_mailqueue         | no   | yes
sendmail_mailstats         | no   | yes
sendmail_mailtraffic       | no   | yes
slapd_                     | no   | no [Net::LDAP not found]
slapd_bdb_cache_           | no   | no [Can't execute db_stat file '/usr/bin/db4.6_stat']
slony_lag_                 | no   | no [DBD::Pg not found, and cannot do psql yet]
smart_                     | no   | no [smartmontools not found]
snort_alerts               | no   | no [/var/snort/snort.stats not readable]
snort_bytes_pkt            | no   | no [/var/snort/snort.stats not readable]
snort_drop_rate            | no   | no [/var/snort/snort.stats not readable]
snort_pattern_match        | no   | no [/var/snort/snort.stats not readable]
snort_pkts                 | no   | no [/var/snort/snort.stats not readable]
snort_traffic              | no   | no [/var/snort/snort.stats not readable]
squeezebox_                | no   | no [no connection on localhost port 9090]
squid_cache                | no   | no [could not connect: Invalid argument]
squid_objectsize           | no   | no [could not connect: Connection refused]
squid_requests             | no   | no [could not connect: Invalid argument]
squid_traffic              | no   | no [could not connect: Invalid argument]
swap                       | yes  | yes
systat                     | no   | yes
tomcat_                    | no   | no
users                      | no   | yes
varnish_                   | no   | no [which varnishstat returns blank]
vmstat                     | no   | yes
zimbra_                    | no   | no [No Text::CSV_XS]
# The following plugins caused errors:
# mysql_:
#       Non-zero exit during autoconf (2)
  110  5:34    ps aux | grep munin
  111  5:34    kill 879
  112  5:34    ps aux | grep munin
  113  5:34    ll
  114  5:35    make deinstall
  115  5:35    cd ../munin-master
  116  5:35    ll
  117  5:35    make deinstall
  118  5:35    vipw
  119  5:37    portinstall sysutils/munin-node
  120  5:38    rehash
  121  5:38    portinstall sysutils/munin-master
  122  5:40    rehash
  123  5:40    /usr/local/sbin/munin-node restart
  124  5:41    ps aux | grep munin
  125  5:43    date
  126  5:45    munin-node-configure -suggest
  127  5:45    munin-node-configure --shell
  128  5:47    /usr/local/sbin/munin-node restart
  129  5:48    munin-node-configure --shell | sh
  130  5:51    history

perl祭りのあと、munin cron で エラー 2013年5月10日

Can't locate RRDs.pm in @INC (@INC contains: /usr/local/lib/perl5/5.14.2/BSDPAN /usr/local/lib/perl5/site_perl
/5.14.2/mach /usr/local/lib/perl5/site_perl/5.14.2     /usr/local/lib/perl5/5.14.2/mach /usr/local/lib/perl5/5.14.2 .)
at /usr/local/lib/perl5/site_perl/5.14.2/Munin/Master/UpdateWorker.pm line 19.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.14.2/Munin/Master/UpdateWorker.pm line 19.
Compilation failed in require at /usr/local/lib/perl5/site_perl/5.14.2/Munin/Master/Update.pm line 17.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.14.2/Munin/Master/Update.pm line 17.
Compilation failed in require at /usr/local/share/munin/munin-update line 14.
BEGIN failed--compilation aborted at /usr/local/share/munin/munin-update line 14.

rrdtoolの再インストールで治癒

   64  6:18    cd /usr/ports/databases/rrdtool
   65  6:18    make deinstall
   66  6:18    portinstall databases/rrdtool
   67  6:20    rehash

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS