7
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

vyos(SNMP対応機器)をmuninで監視する

Last updated at Posted at 2015-01-14

#vyattaの設定

### snmpの設定をします
$ conf
$ set service snmp community コミュニティー名
$ commit
$ save

### muninのアクセスを許可します
$ sudo vim /etc/munin/munin-node.conf
cidr_allow 192.168.0.0/16
cidr_allow 172.16.0.0/8
cidr_allow 10.0.0.0/8

### localeがないので追加+設定する。これしないとrestartのとき、下記エラーが出る
# Stopping Munin-Node: done.
# Starting Munin-Node:perl: warning: Setting locale failed.
# perl: warning: Please check that your locale settings:
# 	LANGUAGE = (unset),
# 	LC_ALL = (unset),
# 	LANG = "en_US.UTF-8"
#     are supported and installed on your system.
# perl: warning: Falling back to the standard locale ("C").
#  done.

### en_US.UTF-8を入れておきましょう
$ sudo dpkg-reconfigure locales

### サービス再起動
$ apt-get install chkconfig
$ sudo chkconfig munin-node on
$ sudo service munin-node restart

#muninサーバの設定

$ sudo yum install -y net-snmp-utils

### 実際に動くか確かめてみよう!
$ snmpwalk -v 2c -c コミュニティー名 192.168.1.100

### muninで監視出来るようにします
$ su -

### ここから全てroot作業
### /etc/munin/plugins/にあるsnmp_ファイルに向けて設定を行います
$ vim /etc/munin/plugin-conf.d/munin-node
[snmp_*]
env.version 2
env.community コミュニティー名

$ vim /etc/munin/munin.conf
### アンダーバーはダメみたいです。なのでsnmp-にしてます
[192.168.1.100]
  address 192.168.1.100
  use_node_name yes

### 獲れるデータを確認
$ munin-node-configure --snmp 192.168.1.100 --snmpversion 2 --snmpcommunity コミュニティー名

### 確認したら反映。リンクが貼られます。
### 必要な物だけリンクを貼ってください。
$ munin-node-configure --snmp 192.168.1.100 --snmpversion 2 --snmpcommunity コミュニティー名 --shell sh
ln -s '/usr/share/munin/plugins/snmp__cpuload' '/etc/munin/plugins/snmp_192.168.1.100_cpuload'
ln -s '/usr/share/munin/plugins/snmp__df' '/etc/munin/plugins/snmp_192.168.1.100_df'
ln -s '/usr/share/munin/plugins/snmp__df_ram' '/etc/munin/plugins/snmp_192.168.1.100_df_ram'
ln -s '/usr/share/munin/plugins/snmp__if_' '/etc/munin/plugins/snmp_192.168.1.100_if_1'
ln -s '/usr/share/munin/plugins/snmp__if_err_' '/etc/munin/plugins/snmp_192.168.1.100_if_err_1'
ln -s '/usr/share/munin/plugins/snmp__if_err_' '/etc/munin/plugins/snmp_192.168.1.100_if_err_2'
ln -s '/usr/share/munin/plugins/snmp__if_err_' '/etc/munin/plugins/snmp_192.168.1.100_if_err_3'
ln -s '/usr/share/munin/plugins/snmp__if_err_' '/etc/munin/plugins/snmp_192.168.1.100_if_err_4'
ln -s '/usr/share/munin/plugins/snmp__if_err_' '/etc/munin/plugins/snmp_192.168.1.100_if_err_5'
ln -s '/usr/share/munin/plugins/snmp__if_err_' '/etc/munin/plugins/snmp_192.168.1.100_if_err_7'
ln -s '/usr/share/munin/plugins/snmp__if_err_' '/etc/munin/plugins/snmp_192.168.1.100_if_err_8'
ln -s '/usr/share/munin/plugins/snmp__if_err_' '/etc/munin/plugins/snmp_192.168.1.100_if_err_9'
ln -s '/usr/share/munin/plugins/snmp__if_multi' '/etc/munin/plugins/snmp_192.168.1.100_if_multi'
ln -s '/usr/share/munin/plugins/snmp__load' '/etc/munin/plugins/snmp_192.168.1.100_load'
ln -s '/usr/share/munin/plugins/snmp__memory' '/etc/munin/plugins/snmp_192.168.1.100_memory'
ln -s '/usr/share/munin/plugins/snmp__netstat' '/etc/munin/plugins/snmp_192.168.1.100_netstat'
ln -s '/usr/share/munin/plugins/snmp__processes' '/etc/munin/plugins/snmp_192.168.1.100_processes'
ln -s '/usr/share/munin/plugins/snmp__swap' '/etc/munin/plugins/snmp_192.168.1.100_swap'
ln -s '/usr/share/munin/plugins/snmp__uptime' '/etc/munin/plugins/snmp_192.168.1.100_uptime'
ln -s '/usr/share/munin/plugins/snmp__users' '/etc/munin/plugins/snmp_192.168.1.100_users'
ln -s '/usr/share/munin/plugins/snmp__winload' '/etc/munin/plugins/snmp_192.168.1.100_winload'
ln -s '/usr/share/munin/plugins/snmp__winmem' '/etc/munin/plugins/snmp_192.168.1.100_winmem'

### munin restart
$ service munin-node restart

#確認してみます

$ telnet localhost 4949
nodes
list [上記で出たSNMPで管理したいIP]

あとはmuninの画面上で確認してください

7
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?