- 現在との差分 を表示
- ソース を表示
- MacOSX/HigiSierra/snmpd へ行く。
1: 2019-05-25 (土) 17:48:33 nobuaki | 2: 2019-05-25 (土) 18:14:10 nobuaki | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | *macOSでSNMPDが利用できるまで [#i6707f32] | + | *macOSでSNMPDが利用できるまで [#f79dc999] |
- | **はじめに [#o020977d] | + | **はじめに [#qfd28db1] |
macOSをサーバとして運用するので,SNMPによって性能などの監視を行いたい.SNMPはSNMPDで情報を得ることができるが,macOSはデフォルトではSNMPDが起動してないので,その起動や,諸設定を行う. | macOSをサーバとして運用するので,SNMPによって性能などの監視を行いたい.SNMPはSNMPDで情報を得ることができるが,macOSはデフォルトではSNMPDが起動してないので,その起動や,諸設定を行う. | ||
今回は,macOS 10.13.6のHigh Sierraで動作確認した. | 今回は,macOS 10.13.6のHigh Sierraで動作確認した. | ||
- | **現状確認. [#s736da2f] | + | **現状確認. [#e466386e] |
まずは,現在SNMPプロセスが起動してない事を確認. | まずは,現在SNMPプロセスが起動してない事を確認. | ||
Line 19: | Line 19: | ||
$ | $ | ||
確認できた設定ファイルの中身を表示. | 確認できた設定ファイルの中身を表示. | ||
- | $ cat /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist | + | $ cat /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist🆑 |
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
Line 42: | Line 42: | ||
</plist> | </plist> | ||
$ | $ | ||
- | + | Disabled担っているので,起動してないのかな. | |
- | LaunchDaemonでSNMPDを起動する. | + | LaunchDaemonでSNMPDをroot権限で起動する. |
$ sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist🆑 | $ sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist🆑 | ||
Password:🆑 | Password:🆑 | ||
Line 54: | Line 54: | ||
稼働確認できた. | 稼働確認できた. | ||
- | **SNMPで接続してみる [#f8aca566] | + | **SNMPで接続してみる [#wc20b48c] |
SNMPDプロセスが起動したので,次はsnmpwalkコマンドを使って,SNMPで接続して情報を取得する. | SNMPDプロセスが起動したので,次はsnmpwalkコマンドを使って,SNMPで接続して情報を取得する. | ||
Line 69: | Line 69: | ||
- | **snmpd.confをsnmpconfコマンドを使って対話的に設定する [#gb3ba018] | + | **snmpd.confをsnmpconfコマンドを使って対話的に設定する [#e81854ac] |
- | ***snmpd.confファイルを確認 [#we520918] | + | ***snmpd.confファイルを確認 [#fc05a79a] |
snmpconfコマンドを使うと,/usr/share/snmp/snmpd.confが作成されるが,現在存在しているか確認する. | snmpconfコマンドを使うと,/usr/share/snmp/snmpd.confが作成されるが,現在存在しているか確認する. | ||
Line 108: | Line 108: | ||
snmpd.confは存在しなかった. | snmpd.confは存在しなかった. | ||
- | ***snmpconfのコマンドヘルプの確認 [#pdd8658e] | + | ***snmpconfのコマンドヘルプの確認 [#l645bb8a] |
sndmpdは,snmpd.confで設定を制御するが,まずは/usr/bin/snmpconfコマンドを使ってカスタマイズする. | sndmpdは,snmpd.confで設定を制御するが,まずは/usr/bin/snmpconfコマンドを使ってカスタマイズする. | ||
まずは,コマンドヘルプを. | まずは,コマンドヘルプを. | ||
- | $ /usr/bin/snmpconf -h | + | $ /usr/bin/snmpconf -h🆑 |
/usr/bin/snmpconf [options] [FILETOCREATE...] | /usr/bin/snmpconf [options] [FILETOCREATE...] | ||
options: | options: | ||
Line 209: | Line 209: | ||
さっきファイルはなかったのに?overwriteを選択. | さっきファイルはなかったのに?overwriteを選択. | ||
- | 'overwrite', 'skip', 'rename' or 'append'? : overwrite | + | 'overwrite', 'skip', 'rename' or 'append'? : overwrite🆑 |
Line 218: | Line 218: | ||
$ | $ | ||
ファイルができたようなので,中身を確認. | ファイルができたようなので,中身を確認. | ||
- | $ cat /usr/share/snmp/snmpd.conf | + | $ cat /usr/share/snmp/snmpd.conf🆑 |
########################################################################### | ########################################################################### | ||
# | # | ||
Line 246: | Line 246: | ||
何も設定してないので,何もないね. | 何も設定してないので,何もないね. | ||
- | ***snmpd.confにシステム情報を設定する [#x9a96126] | + | ***snmpd.confにシステム情報を設定する [#fa90f29a] |
snmpconfを実行. | snmpconfを実行. | ||
Line 317: | Line 317: | ||
Select section: | Select section: | ||
- | ****syslocationの設定 [#kb35eb3c] | + | ****syslocationの設定 [#df51d017] |
最初は,物理的な場所を設定するので,1を選択. | 最初は,物理的な場所を設定するので,1を選択. | ||
Line 335: | Line 335: | ||
The location of the system: | The location of the system: | ||
- | 任意のロケーション情報を入力する.ここでは,BCPセンタようなのでBCPと入力. | + | 任意のロケーション情報を入力する.ここでは,BCPセンタ用なのでBCPと入力. |
The location of the system: BCP🆑 | The location of the system: BCP🆑 | ||
Line 356: | Line 356: | ||
Select section: | Select section: | ||
- | ****syscontactの設定 [#ad120da0] | + | ****syscontactの設定 [#q1ebc60e] |
次に,管理者の連絡先を入力するために2を選択. | 次に,管理者の連絡先を入力するために2を選択. | ||
Line 395: | Line 395: | ||
Select section: | Select section: | ||
- | ****sysservicesの設定 [#db86c98b] | + | ****sysservicesの設定 [#o32f3a58] |
sysServices Objectの設定を行うので,3を入力. | sysServices Objectの設定を行うので,3を入力. | ||
Line 416: | Line 416: | ||
does this host offer application services (eg, supports SMTP): 1🈁 | does this host offer application services (eg, supports SMTP): 1🈁 | ||
- | ・物理層でのサービスをしてないので,0を選択. | + | -物理層でのサービスをしてないので,0を選択. |
- | ・データリンク層でのサービスをしてないので,0を入力. | + | -データリンク層でのサービスをしてないので,0を入力. |
- | ・IP層でサービスをしているので1を入力. | + | -IP層でサービスをしているので1を入力. |
- | ・TCP層でサービスをしているので1を入力. | + | -TCP層でサービスをしているので1を入力. |
- | ・アプリケーション層でサービスをしているので1を入力. | + | -アプリケーション層でサービスをしているので1を入力. |
このように答えると,sysservicesは76となる. | このように答えると,sysservicesは76となる. | ||
Line 441: | Line 441: | ||
Select section: | Select section: | ||
- | ****設定を確認し保存する [#ld81ef08] | + | ****設定を確認し保存する [#kc760eb9] |
これまで設定した内容を確認するのでlistと入力. | これまで設定した内容を確認するのでlistと入力. | ||
Line 504: | Line 504: | ||
保存されたsnmpd.confファイルを確認する. | 保存されたsnmpd.confファイルを確認する. | ||
- | $ cat /usr/share/snmp/snmpd.conf | + | $ cat /usr/share/snmp/snmpd.conf🆑 |
########################################################################### | ########################################################################### | ||
# | # | ||
Line 544: | Line 544: | ||
# arguments: contact_string | # arguments: contact_string | ||
- | syscontact server@ujp.jp | + | syscontact 管理者メールアドレス |
# sysservices: The proper value for the sysServices object. | # sysservices: The proper value for the sysServices object. | ||
Line 563: | Line 563: | ||
設定が保存されていることを確認. | 設定が保存されていることを確認. | ||
- | **監視設定を定義する [#n6d72e5b] | + | **監視設定を定義する [#n33fcb26] |
プロセス,ディスク容量,ロードアベレージ,ファイルサイズなどの監視を行う設定を行う. | プロセス,ディスク容量,ロードアベレージ,ファイルサイズなどの監視を行う設定を行う. | ||
- | $ sudo /usr/bin/snmpconf -i🆑 | + | $ sudo /usr/bin/snmpconf -i🆑 |
- | Password:🆑 | + | Password:🆑 |
- | The following installed configuration files were found: | + | The following installed configuration files were found: |
- | 1: /etc/snmp/snmpd.conf | + | 1: /etc/snmp/snmpd.conf |
- | 2: /usr/share/snmp/snmpd.conf🈁 | + | 2: /usr/share/snmp/snmpd.conf🈁 |
- | Would you like me to read them in? Their content will be merged with the | + | Would you like me to read them in? Their content will be merged with the |
- | output files created by this session. | + | output files created by this session. |
- | Valid answer examples: "all", "none","3","1,2,5" | + | Valid answer examples: "all", "none","3","1,2,5" |
- | Read in which (default = all): 2🆑 | + | Read in which (default = all): 2🆑 |
- | I can create the following types of configuration files for you. | + | I can create the following types of configuration files for you. |
- | Select the file type you wish to create: | + | Select the file type you wish to create: |
- | (you can create more than one as you run this program) | + | (you can create more than one as you run this program) |
- | 1: snmp.conf | + | 1: snmp.conf |
- | 2: snmptrapd.conf | + | 2: snmptrapd.conf |
- | 3: snmpd.conf🈁 | + | 3: snmpd.conf🈁 |
- | Other options: quit | + | Other options: quit |
- | Select File: 3🆑 | + | Select File: 3🆑 |
- | The configuration information which can be put into snmpd.conf is divided | + | The configuration information which can be put into snmpd.conf is divided |
- | into sections. Select a configuration section for snmpd.conf | + | into sections. Select a configuration section for snmpd.conf |
- | that you wish to create: | + | that you wish to create: |
- | 1: Agent Operating Mode | + | 1: Agent Operating Mode |
- | 2: Monitor Various Aspects of the Running Host🈁 | + | 2: Monitor Various Aspects of the Running Host🈁 |
- | 3: Trap Destinations | + | 3: Trap Destinations |
- | 4: System Information Setup | + | 4: System Information Setup |
- | 5: Extending the Agent | + | 5: Extending the Agent |
- | 6: Access Control Setup | + | 6: Access Control Setup |
- | Other options: finished | + | Other options: finished |
- | Select section: 2🆑 | + | Select section: 2🆑 |
- | Section: Monitor Various Aspects of the Running Host | + | Section: Monitor Various Aspects of the Running Host |
- | Description: | + | Description: |
- | The following check up on various aspects of a host. | + | The following check up on various aspects of a host. |
- | Select from: | + | Select from: |
- | 1: Check for processes that should be running.🈁 | + | 1: Check for processes that should be running.🈁 |
- | 2: Check for disk space usage of a partition. | + | 2: Check for disk space usage of a partition. |
- | 3: Check for unreasonable load average values. | + | 3: Check for unreasonable load average values. |
- | 4: Check on the size of a file. | + | 4: Check on the size of a file. |
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
- | Other options: finished, list | ||
- | Select section: | ||
- | ***プロセスの監視を行う [#sd7352fc] | + | ***プロセスの監視を行う [#o288cf0a] |
Check for processes that should be running.を選択する. | Check for processes that should be running.を選択する. | ||
Line 669: | Line 671: | ||
Select section: | Select section: | ||
- | ***ディスクの空き容量の監視を行う [#za2b539e] | + | ***ディスクの空き容量の監視を行う [#lff26ec6] |
/Volumes/RAID0_12TBというボリュームが95%を超えるかどうかを監視する. | /Volumes/RAID0_12TBというボリュームが95%を超えるかどうかを監視する. | ||
Line 710: | Line 712: | ||
Select section: | Select section: | ||
- | ***ロードアベレージを監視する [#rdf49c82] | + | ***ロードアベレージを監視する [#h7027a1b] |
ロードアベレージは,CPU1つがビジー状態だと1なので,今回は4coreマシンなので,4の倍数で値を設定した. | ロードアベレージは,CPU1つがビジー状態だと1なので,今回は4coreマシンなので,4の倍数で値を設定した. | ||
Line 751: | Line 753: | ||
Select section: | Select section: | ||
- | ***ファイルサイズの監視 [#s9889750] | + | ***ファイルサイズの監視 [#hc53d10b] |
継続することで大きくなるファイルを監視する.ここではsyslog.logとしている. | 継続することで大きくなるファイルを監視する.ここではsyslog.logとしている. |
- MacOSX/HigiSierra/snmpd のバックアップ一覧
- MacOSX/HigiSierra/snmpd のバックアップ差分(No. All)
- 1: 2019-05-25 (土) 17:48:33 nobuaki
- 2: 2019-05-25 (土) 18:14:10 nobuaki
- 3: 2019-05-27 (月) 21:08:51 nobuaki
- 現: 2020-08-16 (日) 02:12:00 nobuaki
Counter: 2960,
today: 1,
yesterday: 1