- 現在との差分 を表示
- ソース を表示
- MacOSX/HigiSierra/snmpd へ行く。
1: 2019-05-25 (土) 17:48:33 nobuaki | |||
---|---|---|---|
Line 1: | Line 1: | ||
+ | *macOSでSNMPDが利用できるまで [#i6707f32] | ||
+ | **はじめに [#o020977d] | ||
+ | |||
+ | macOSをサーバとして運用するので,SNMPによって性能などの監視を行いたい.SNMPはSNMPDで情報を得ることができるが,macOSはデフォルトではSNMPDが起動してないので,その起動や,諸設定を行う. | ||
+ | 今回は,macOS 10.13.6のHigh Sierraで動作確認した. | ||
+ | |||
+ | **現状確認. [#s736da2f] | ||
+ | |||
+ | まずは,現在SNMPプロセスが起動してない事を確認. | ||
+ | |||
+ | $ ps -ef|grep snmp🆑 | ||
+ | 501 66796 65920 0 4:51PM ttys003 0:00.00 grep snmp | ||
+ | $ | ||
+ | プロセスは起動してない. | ||
+ | macOSの場合はLaunchDaemonでサーバプロセスを管理しているが,その設定ファイルを確認する. | ||
+ | $ locate snmp|grep plist🆑 | ||
+ | /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist | ||
+ | $ | ||
+ | 確認できた設定ファイルの中身を表示. | ||
+ | $ cat /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist | ||
+ | <?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"> | ||
+ | <plist version="1.0"> | ||
+ | <dict> | ||
+ | <key>Disabled</key> | ||
+ | <true/> | ||
+ | <key>Label</key> | ||
+ | <string>org.net-snmp.snmpd</string> | ||
+ | <key>KeepAlive</key> | ||
+ | <true/> | ||
+ | <key>Program</key> | ||
+ | <string>/usr/sbin/snmpd</string> | ||
+ | <key>ProgramArguments</key> | ||
+ | <array> | ||
+ | <string>snmpd</string> | ||
+ | <string>-f</string> | ||
+ | </array> | ||
+ | <key>ProcessType</key> | ||
+ | <string>Background</string> | ||
+ | </dict> | ||
+ | </plist> | ||
+ | $ | ||
+ | |||
+ | LaunchDaemonでSNMPDを起動する. | ||
+ | $ sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist🆑 | ||
+ | Password:🆑 | ||
+ | $ | ||
+ | プロセスを確認. | ||
+ | $ ps -ef|grep snmp🆑 | ||
+ | 0 66808 1 0 4:52PM ?? 0:00.23 /usr/libexec/snmpd -f🈁 | ||
+ | 501 66812 65920 0 4:52PM ttys003 0:00.00 grep snmp | ||
+ | $ | ||
+ | 稼働確認できた. | ||
+ | |||
+ | **SNMPで接続してみる [#f8aca566] | ||
+ | |||
+ | SNMPDプロセスが起動したので,次はsnmpwalkコマンドを使って,SNMPで接続して情報を取得する. | ||
+ | コマンドの場所を確認. | ||
+ | $ which snmpwalk🆑 | ||
+ | /usr/bin/snmpwalk🈁 | ||
+ | $ | ||
+ | snmpwalkコマンドで接続してみる. | ||
+ | $ snmpwalk -v 2c -c public localhost🆑 | ||
+ | SNMPv2-MIB::sysContact.0 = STRING: Administrator <postmaster@example.com> | ||
+ | SNMPv2-MIB::sysContact.0 = No more variables left in this MIB View (It is past the end of the MIB tree) | ||
+ | $ | ||
+ | 何の情報も出てないが,Timeoutとかのエラーになってないので,想定内と言える. | ||
+ | |||
+ | |||
+ | **snmpd.confをsnmpconfコマンドを使って対話的に設定する [#gb3ba018] | ||
+ | |||
+ | ***snmpd.confファイルを確認 [#we520918] | ||
+ | |||
+ | snmpconfコマンドを使うと,/usr/share/snmp/snmpd.confが作成されるが,現在存在しているか確認する. | ||
+ | |||
+ | $ ls -lat /usr/share/snmp🆑 | ||
+ | total 60 | ||
+ | drwxr-xr-x 47 root wheel 1504 4 3 2018 .. | ||
+ | drwxr-xr-x 65 root wheel 2080 7 16 2017 mibs | ||
+ | drwxr-xr-x 28 root wheel 896 7 16 2017 . | ||
+ | -rw-r--r-- 1 root wheel 16218 7 16 2017 SensorDat.xml | ||
+ | drwxr-xr-x 69 root wheel 2208 7 16 2017 mib2c-data | ||
+ | -rw-r--r-- 1 root wheel 6531 7 16 2017 mib2c.access_functions.conf | ||
+ | -rw-r--r-- 1 root wheel 2391 7 16 2017 mib2c.check_values_local.conf | ||
+ | -rw-r--r-- 1 root wheel 28202 7 16 2017 mib2c.container.conf | ||
+ | -rw-r--r-- 1 root wheel 8498 7 16 2017 mib2c.genhtml.conf | ||
+ | -rw-r--r-- 1 root wheel 3088 7 16 2017 mib2c.int_watch.conf | ||
+ | -rw-r--r-- 1 root wheel 2027 7 16 2017 mib2c.notify.conf | ||
+ | -rw-r--r-- 1 root wheel 8777 7 16 2017 mib2c.perl.conf | ||
+ | -rw-r--r-- 1 root wheel 19509 7 16 2017 mib2c.raw-table.conf | ||
+ | -rw-r--r-- 1 root wheel 22905 7 16 2017 mib2c.table_data.conf | ||
+ | drwxr-xr-x 5 root wheel 160 7 16 2017 snmpconf-data | ||
+ | -rw-r--r-- 1 root wheel 37700 7 16 2017 mib2c.array-user.conf | ||
+ | -rw-r--r-- 1 root wheel 4646 7 16 2017 mib2c.check_values.conf | ||
+ | -rw-r--r-- 1 root wheel 330 7 16 2017 mib2c.column_defines.conf | ||
+ | -rw-r--r-- 1 root wheel 602 7 16 2017 mib2c.column_enums.conf | ||
+ | -rw-r--r-- 1 root wheel 728 7 16 2017 mib2c.column_storage.conf | ||
+ | -rw-r--r-- 1 root wheel 11942 7 16 2017 mib2c.conf | ||
+ | -rw-r--r-- 1 root wheel 3471 7 16 2017 mib2c.create-dataset.conf | ||
+ | -rw-r--r-- 1 root wheel 22345 7 16 2017 mib2c.iterate.conf | ||
+ | -rw-r--r-- 1 root wheel 15095 7 16 2017 mib2c.iterate_access.conf | ||
+ | -rw-r--r-- 1 root wheel 948 7 16 2017 mib2c.mfd.conf | ||
+ | -rw-r--r-- 1 root wheel 9182 7 16 2017 mib2c.old-api.conf | ||
+ | -rw-r--r-- 1 root wheel 4455 7 16 2017 mib2c.scalar.conf | ||
+ | -rw-r--r-- 1 root wheel 431 7 16 2017 snmp_perl_trapd.pl | ||
+ | $ | ||
+ | snmpd.confは存在しなかった. | ||
+ | |||
+ | ***snmpconfのコマンドヘルプの確認 [#pdd8658e] | ||
+ | |||
+ | sndmpdは,snmpd.confで設定を制御するが,まずは/usr/bin/snmpconfコマンドを使ってカスタマイズする. | ||
+ | まずは,コマンドヘルプを. | ||
+ | |||
+ | $ /usr/bin/snmpconf -h | ||
+ | /usr/bin/snmpconf [options] [FILETOCREATE...] | ||
+ | options: | ||
+ | -f overwrite existing files without prompting | ||
+ | -i install created files into /usr/share/snmp. | ||
+ | -p install created files into /Users/ujpadmin/.snmp. | ||
+ | -I DIR install created files into DIR. | ||
+ | -a Don't ask any questions, just read in current | ||
+ | current .conf files and comment them | ||
+ | -r all|none Read in all or none of the .conf files found. | ||
+ | -R file,... Read in a particular list of .conf files. | ||
+ | -g GROUP Ask a series of GROUPed questions. | ||
+ | -G List known GROUPs. | ||
+ | -c conf_dir use alternate configuration directory. | ||
+ | -q run more quietly with less advice. | ||
+ | -d turn on debugging output. | ||
+ | -D turn on debugging dumper output. | ||
+ | $ | ||
+ | 新しいファイルを/usr/share/snmp以下に作成するのでiオプションをつけて実行する. | ||
+ | $ sudo /usr/bin/snmpconf -f🆑 | ||
+ | Password:🆑 | ||
+ | |||
+ | The following installed configuration files were found: | ||
+ | |||
+ | 1: ./snmpd.conf | ||
+ | 2: /etc/snmp/snmpd.conf🈁 | ||
+ | |||
+ | Would you like me to read them in? Their content will be merged with the | ||
+ | output files created by this session. | ||
+ | |||
+ | Valid answer examples: "all", "none","3","1,2,5" | ||
+ | |||
+ | Read in which (default = all):🈁 | ||
+ | |||
+ | 他にsnmpd.confファイルが見つかったので,マージするか問い合わせされている. | ||
+ | 今回はマージしないので,noneを選択. | ||
+ | |||
+ | Read in which (default = all): none🆑 | ||
+ | |||
+ | I can create the following types of configuration files for you. | ||
+ | Select the file type you wish to create: | ||
+ | (you can create more than one as you run this program) | ||
+ | |||
+ | 1: snmp.conf | ||
+ | 2: snmptrapd.conf | ||
+ | 3: snmpd.conf | ||
+ | |||
+ | Other options: quit | ||
+ | |||
+ | Select File: | ||
+ | |||
+ | ファイルタイプは,snmpd.confにしたいので,3を選択. | ||
+ | |||
+ | Select File: 3🆑 | ||
+ | |||
+ | The configuration information which can be put into snmpd.conf is divided | ||
+ | into sections. Select a configuration section for snmpd.conf | ||
+ | that you wish to create: | ||
+ | |||
+ | 1: Agent Operating Mode | ||
+ | 2: Monitor Various Aspects of the Running Host | ||
+ | 3: Trap Destinations | ||
+ | 4: System Information Setup🈁 | ||
+ | 5: Extending the Agent | ||
+ | 6: Access Control Setup | ||
+ | |||
+ | Other options: finished🈁 | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | 今回は,ここまでで一旦終了するので,finishedと入力. | ||
+ | |||
+ | Select section: finished🆑 | ||
+ | |||
+ | I can create the following types of configuration files for you. | ||
+ | Select the file type you wish to create: | ||
+ | (you can create more than one as you run this program) | ||
+ | |||
+ | 1: snmp.conf | ||
+ | 2: snmptrapd.conf | ||
+ | 3: snmpd.conf | ||
+ | |||
+ | Other options: quit🈁 | ||
+ | |||
+ | Select File: | ||
+ | |||
+ | 終了するのでquitを入力. | ||
+ | |||
+ | Select File: quit🆑 | ||
+ | |||
+ | Error: An snmpd.conf file already exists in this directory. | ||
+ | |||
+ | 'overwrite', 'skip', 'rename' or 'append'? : | ||
+ | |||
+ | さっきファイルはなかったのに?overwriteを選択. | ||
+ | |||
+ | 'overwrite', 'skip', 'rename' or 'append'? : overwrite | ||
+ | |||
+ | |||
+ | The following files were created: | ||
+ | |||
+ | snmpd.conf installed in /usr/share/snmp | ||
+ | |||
+ | $ | ||
+ | ファイルができたようなので,中身を確認. | ||
+ | $ cat /usr/share/snmp/snmpd.conf | ||
+ | ########################################################################### | ||
+ | # | ||
+ | # snmpd.conf | ||
+ | # | ||
+ | # - created by the snmpconf configuration program | ||
+ | # | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | $ | ||
+ | 何も設定してないので,何もないね. | ||
+ | |||
+ | ***snmpd.confにシステム情報を設定する [#x9a96126] | ||
+ | |||
+ | snmpconfを実行. | ||
+ | |||
+ | $ sudo /usr/bin/snmpconf -i🆑 | ||
+ | Password:🆑 | ||
+ | |||
+ | The following installed configuration files were found: | ||
+ | |||
+ | 1: /etc/snmp/snmpd.conf | ||
+ | 2: /usr/share/snmp/snmpd.conf | ||
+ | |||
+ | Would you like me to read them in? Their content will be merged with the | ||
+ | output files created by this session. | ||
+ | |||
+ | Valid answer examples: "all", "none","3","1,2,5" | ||
+ | |||
+ | Read in which (default = all): | ||
+ | 2番の設定をマージするので2を選択. | ||
+ | |||
+ | Read in which (default = all): 2🆑 | ||
+ | |||
+ | I can create the following types of configuration files for you. | ||
+ | Select the file type you wish to create: | ||
+ | (you can create more than one as you run this program) | ||
+ | |||
+ | 1: snmptrapd.conf | ||
+ | 2: snmp.conf | ||
+ | 3: snmpd.conf | ||
+ | |||
+ | Other options: quit | ||
+ | |||
+ | Select File: | ||
+ | 3番を選択. | ||
+ | |||
+ | Select File: 3🆑 | ||
+ | |||
+ | The configuration information which can be put into snmpd.conf is divided | ||
+ | into sections. Select a configuration section for snmpd.conf | ||
+ | that you wish to create: | ||
+ | |||
+ | 1: Agent Operating Mode | ||
+ | 2: Monitor Various Aspects of the Running Host | ||
+ | 3: Trap Destinations | ||
+ | 4: System Information Setup🈁 | ||
+ | 5: Extending the Agent | ||
+ | 6: Access Control Setup | ||
+ | |||
+ | Other options: finished | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | 今回のセットアップはシステム情報になるので,4を選択. | ||
+ | |||
+ | Select section: 4🆑 | ||
+ | |||
+ | Section: System Information Setup | ||
+ | Description: | ||
+ | This section defines some of the information reported in | ||
+ | the "system" mib group in the mibII tree. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: The [typically physical] location of the system.🈁 | ||
+ | 2: The contact information for the administrator | ||
+ | 3: The proper value for the sysServices object. | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | ****syslocationの設定 [#kb35eb3c] | ||
+ | |||
+ | 最初は,物理的な場所を設定するので,1を選択. | ||
+ | |||
+ | Select section: 1🆑 | ||
+ | |||
+ | Configuring: syslocation | ||
+ | Description: | ||
+ | The [typically physical] location of the system. | ||
+ | Note that setting this value here means that when trying to | ||
+ | perform an snmp SET operation to the sysLocation.0 variable will make | ||
+ | the agent return the "notWritable" error code. IE, including | ||
+ | this token in the snmpd.conf file will disable write access to | ||
+ | the variable. | ||
+ | arguments: location_string | ||
+ | |||
+ | The location of the system: | ||
+ | |||
+ | 任意のロケーション情報を入力する.ここでは,BCPセンタようなのでBCPと入力. | ||
+ | |||
+ | The location of the system: BCP🆑 | ||
+ | |||
+ | Finished Output: syslocation BCP🈁 | ||
+ | |||
+ | Section: System Information Setup | ||
+ | Description: | ||
+ | This section defines some of the information reported in | ||
+ | the "system" mib group in the mibII tree. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: The [typically physical] location of the system. | ||
+ | 2: The contact information for the administrator🈁 | ||
+ | 3: The proper value for the sysServices object. | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | ****syscontactの設定 [#ad120da0] | ||
+ | |||
+ | 次に,管理者の連絡先を入力するために2を選択. | ||
+ | |||
+ | Select section: 2🆑 | ||
+ | |||
+ | Configuring: syscontact | ||
+ | Description: | ||
+ | The contact information for the administrator | ||
+ | Note that setting this value here means that when trying to | ||
+ | perform an snmp SET operation to the sysContact.0 variable will make | ||
+ | the agent return the "notWritable" error code. IE, including | ||
+ | this token in the snmpd.conf file will disable write access to | ||
+ | the variable. | ||
+ | arguments: contact_string | ||
+ | |||
+ | The contact information: | ||
+ | |||
+ | メールアドレスを設定. | ||
+ | |||
+ | The contact information: 管理者メールアドレス | ||
+ | |||
+ | Finished Output: syscontact 管理者メールアドレス | ||
+ | |||
+ | Section: System Information Setup | ||
+ | Description: | ||
+ | This section defines some of the information reported in | ||
+ | the "system" mib group in the mibII tree. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: The [typically physical] location of the system. | ||
+ | 2: The contact information for the administrator | ||
+ | 3: The proper value for the sysServices object.🈁 | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | ****sysservicesの設定 [#db86c98b] | ||
+ | |||
+ | sysServices Objectの設定を行うので,3を入力. | ||
+ | |||
+ | Select section: 3🆑 | ||
+ | |||
+ | Configuring: sysservices | ||
+ | Description: | ||
+ | The proper value for the sysServices object. | ||
+ | arguments: sysservices_number | ||
+ | |||
+ | does this host offer physical services (eg, like a repeater) [answer 0 or 1]:🈁 | ||
+ | |||
+ | Yesの場合1を,Noの場合0を入力. | ||
+ | |||
+ | does this host offer physical services (eg, like a repeater) [answer 0 or 1]: 0🈁 | ||
+ | does this host offer datalink/subnetwork services (eg, like a bridge): 0🈁 | ||
+ | does this host offer internet services (eg, supports IP): 1🈁 | ||
+ | does this host offer end-to-end services (eg, supports TCP): 1🈁 | ||
+ | does this host offer application services (eg, supports SMTP): 1🈁 | ||
+ | |||
+ | ・物理層でのサービスをしてないので,0を選択. | ||
+ | ・データリンク層でのサービスをしてないので,0を入力. | ||
+ | ・IP層でサービスをしているので1を入力. | ||
+ | ・TCP層でサービスをしているので1を入力. | ||
+ | ・アプリケーション層でサービスをしているので1を入力. | ||
+ | |||
+ | このように答えると,sysservicesは76となる. | ||
+ | |||
+ | Finished Output: sysservices 76🈁 | ||
+ | |||
+ | Section: System Information Setup | ||
+ | Description: | ||
+ | This section defines some of the information reported in | ||
+ | the "system" mib group in the mibII tree. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: The [typically physical] location of the system. | ||
+ | 2: The contact information for the administrator | ||
+ | 3: The proper value for the sysServices object. | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | ****設定を確認し保存する [#ld81ef08] | ||
+ | |||
+ | これまで設定した内容を確認するのでlistと入力. | ||
+ | |||
+ | Select section: list🆑 | ||
+ | Lines defined for section "System Information Setup" so far: | ||
+ | syslocation BCP🈁 | ||
+ | syscontact 管理者メールアドレス🈁 | ||
+ | sysservices 76🈁 | ||
+ | |||
+ | Section: System Information Setup | ||
+ | Description: | ||
+ | This section defines some of the information reported in | ||
+ | the "system" mib group in the mibII tree. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: The [typically physical] location of the system. | ||
+ | 2: The contact information for the administrator | ||
+ | 3: The proper value for the sysServices object. | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | ここまでの内容で保存するのでfinishedやquitを入力して終了する. | ||
+ | |||
+ | Select section: finished🆑 | ||
+ | |||
+ | The configuration information which can be put into snmpd.conf is divided | ||
+ | into sections. Select a configuration section for snmpd.conf | ||
+ | that you wish to create: | ||
+ | |||
+ | 1: Agent Operating Mode | ||
+ | 2: Monitor Various Aspects of the Running Host | ||
+ | 3: Trap Destinations | ||
+ | 4: System Information Setup | ||
+ | 5: Extending the Agent | ||
+ | 6: Access Control Setup | ||
+ | |||
+ | Other options: finished | ||
+ | |||
+ | Select section: finished🆑 | ||
+ | |||
+ | I can create the following types of configuration files for you. | ||
+ | Select the file type you wish to create: | ||
+ | (you can create more than one as you run this program) | ||
+ | |||
+ | 1: snmptrapd.conf | ||
+ | 2: snmpd.conf | ||
+ | 3: snmp.conf | ||
+ | |||
+ | Other options: quit🆑 | ||
+ | |||
+ | Select File: quit | ||
+ | |||
+ | |||
+ | The following files were created: | ||
+ | |||
+ | snmpd.conf installed in /usr/share/snmp | ||
+ | $ | ||
+ | 保存されたsnmpd.confファイルを確認する. | ||
+ | |||
+ | $ cat /usr/share/snmp/snmpd.conf | ||
+ | ########################################################################### | ||
+ | # | ||
+ | # snmpd.conf | ||
+ | # | ||
+ | # - created by the snmpconf configuration program | ||
+ | # | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ########################################################################### | ||
+ | # SECTION: System Information Setup | ||
+ | # | ||
+ | # This section defines some of the information reported in | ||
+ | # the "system" mib group in the mibII tree. | ||
+ | |||
+ | # syslocation: The [typically physical] location of the system. | ||
+ | # Note that setting this value here means that when trying to | ||
+ | # perform an snmp SET operation to the sysLocation.0 variable will make | ||
+ | # the agent return the "notWritable" error code. IE, including | ||
+ | # this token in the snmpd.conf file will disable write access to | ||
+ | # the variable. | ||
+ | # arguments: location_string | ||
+ | |||
+ | syslocation BCP | ||
+ | |||
+ | # syscontact: The contact information for the administrator | ||
+ | # Note that setting this value here means that when trying to | ||
+ | # perform an snmp SET operation to the sysContact.0 variable will make | ||
+ | # the agent return the "notWritable" error code. IE, including | ||
+ | # this token in the snmpd.conf file will disable write access to | ||
+ | # the variable. | ||
+ | # arguments: contact_string | ||
+ | |||
+ | syscontact server@ujp.jp | ||
+ | |||
+ | # sysservices: The proper value for the sysServices object. | ||
+ | # arguments: sysservices_number | ||
+ | |||
+ | sysservices 76 | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | $ | ||
+ | |||
+ | 設定が保存されていることを確認. | ||
+ | |||
+ | **監視設定を定義する [#n6d72e5b] | ||
+ | |||
+ | プロセス,ディスク容量,ロードアベレージ,ファイルサイズなどの監視を行う設定を行う. | ||
+ | |||
+ | $ sudo /usr/bin/snmpconf -i🆑 | ||
+ | Password:🆑 | ||
+ | |||
+ | The following installed configuration files were found: | ||
+ | |||
+ | 1: /etc/snmp/snmpd.conf | ||
+ | 2: /usr/share/snmp/snmpd.conf🈁 | ||
+ | |||
+ | Would you like me to read them in? Their content will be merged with the | ||
+ | output files created by this session. | ||
+ | |||
+ | Valid answer examples: "all", "none","3","1,2,5" | ||
+ | |||
+ | Read in which (default = all): 2🆑 | ||
+ | |||
+ | I can create the following types of configuration files for you. | ||
+ | Select the file type you wish to create: | ||
+ | (you can create more than one as you run this program) | ||
+ | |||
+ | 1: snmp.conf | ||
+ | 2: snmptrapd.conf | ||
+ | 3: snmpd.conf🈁 | ||
+ | |||
+ | Other options: quit | ||
+ | |||
+ | Select File: 3🆑 | ||
+ | |||
+ | The configuration information which can be put into snmpd.conf is divided | ||
+ | into sections. Select a configuration section for snmpd.conf | ||
+ | that you wish to create: | ||
+ | |||
+ | 1: Agent Operating Mode | ||
+ | 2: Monitor Various Aspects of the Running Host🈁 | ||
+ | 3: Trap Destinations | ||
+ | 4: System Information Setup | ||
+ | 5: Extending the Agent | ||
+ | 6: Access Control Setup | ||
+ | |||
+ | Other options: finished | ||
+ | |||
+ | Select section: 2🆑 | ||
+ | |||
+ | Section: Monitor Various Aspects of the Running Host | ||
+ | Description: | ||
+ | The following check up on various aspects of a host. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: Check for processes that should be running.🈁 | ||
+ | 2: Check for disk space usage of a partition. | ||
+ | 3: Check for unreasonable load average values. | ||
+ | 4: Check on the size of a file. | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | ***プロセスの監視を行う [#sd7352fc] | ||
+ | |||
+ | Check for processes that should be running.を選択する. | ||
+ | |||
+ | Select section: 1🆑 | ||
+ | |||
+ | Configuring: proc | ||
+ | Description: | ||
+ | Check for processes that should be running. | ||
+ | proc NAME [MAX=0] [MIN=0] | ||
+ | |||
+ | NAME: the name of the process to check for. It must match | ||
+ | exactly (ie, http will not find httpd processes). | ||
+ | MAX: the maximum number allowed to be running. Defaults to 0. | ||
+ | MIN: the minimum number to be running. Defaults to 0. | ||
+ | |||
+ | The results are reported in the prTable section of the UCD-SNMP-MIB tree | ||
+ | Special Case: When the min and max numbers are both 0, it assumes | ||
+ | you want a max of infinity and a min of 1. | ||
+ | |||
+ | Name of the process you want to check on: | ||
+ | |||
+ | ここでは,Sambaのプロセスを監視する.プロセス名はsmbd. | ||
+ | |||
+ | Name of the process you want to check on: /usr/sbin/smbd🆑 | ||
+ | Maximum number of processes named '/usr/sbin/smbd' that should be running [default = 0]:🆑 | ||
+ | Minimum number of processes named '/usr/sbin/smbd' that should be running [default = 0]:🆑 | ||
+ | |||
+ | Finished Output: proc /usr/sbin/smbd | ||
+ | |||
+ | Section: Monitor Various Aspects of the Running Host | ||
+ | Description: | ||
+ | The following check up on various aspects of a host. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: Check for processes that should be running. | ||
+ | 2: Check for disk space usage of a partition. | ||
+ | 3: Check for unreasonable load average values. | ||
+ | 4: Check on the size of a file. | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | ***ディスクの空き容量の監視を行う [#za2b539e] | ||
+ | |||
+ | /Volumes/RAID0_12TBというボリュームが95%を超えるかどうかを監視する. | ||
+ | |||
+ | select section: 2🆑 | ||
+ | |||
+ | Configuring: disk | ||
+ | Description: | ||
+ | Check for disk space usage of a partition. | ||
+ | The agent can check the amount of available disk space, and make | ||
+ | sure it is above a set limit. | ||
+ | |||
+ | disk PATH [MIN=100000] | ||
+ | |||
+ | PATH: mount path to the disk in question. | ||
+ | MIN: Disks with space below this value will have the Mib's errorFlag set. | ||
+ | Can be a raw integer value (units of kB) or a percentage followed by the % | ||
+ | symbol. Default value = 100000. | ||
+ | |||
+ | The results are reported in the dskTable section of the UCD-SNMP-MIB tree | ||
+ | |||
+ | Enter the mount point for the disk partion to be checked on: /Volumes/RAID0_12TB🆑 | ||
+ | Enter the minimum amount of space that should be available on /Volumes/RAID0_12TB: 95%🆑 | ||
+ | |||
+ | Finished Output: disk /Volumes/RAID0_12TB 95%🈁 | ||
+ | |||
+ | Section: Monitor Various Aspects of the Running Host | ||
+ | Description: | ||
+ | The following check up on various aspects of a host. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: Check for processes that should be running. | ||
+ | 2: Check for disk space usage of a partition. | ||
+ | 3: Check for unreasonable load average values. | ||
+ | 4: Check on the size of a file. | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | ***ロードアベレージを監視する [#rdf49c82] | ||
+ | |||
+ | ロードアベレージは,CPU1つがビジー状態だと1なので,今回は4coreマシンなので,4の倍数で値を設定した. | ||
+ | |||
+ | Select section: 3🆑 | ||
+ | |||
+ | Configuring: load | ||
+ | Description: | ||
+ | Check for unreasonable load average values. | ||
+ | Watch the load average levels on the machine. | ||
+ | |||
+ | load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0] | ||
+ | |||
+ | 1MAX: If the 1 minute load average is above this limit at query | ||
+ | time, the errorFlag will be set. | ||
+ | 5MAX: Similar, but for 5 min average. | ||
+ | 15MAX: Similar, but for 15 min average. | ||
+ | |||
+ | The results are reported in the laTable section of the UCD-SNMP-MIB tree | ||
+ | |||
+ | Enter the maximum allowable value for the 1 minute load average: 12🆑 | ||
+ | Enter the maximum allowable value for the 5 minute load average: 8🆑 | ||
+ | Enter the maximum allowable value for the 15 minute load average: 4🆑 | ||
+ | |||
+ | Finished Output: load 12 8 4🈁 | ||
+ | |||
+ | Section: Monitor Various Aspects of the Running Host | ||
+ | Description: | ||
+ | The following check up on various aspects of a host. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: Check for processes that should be running. | ||
+ | 2: Check for disk space usage of a partition. | ||
+ | 3: Check for unreasonable load average values. | ||
+ | 4: Check on the size of a file. | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | ***ファイルサイズの監視 [#s9889750] | ||
+ | |||
+ | 継続することで大きくなるファイルを監視する.ここではsyslog.logとしている. | ||
+ | ファイルサイズは30000KB(30Mbyte)とした. | ||
+ | |||
+ | Select section: 4🆑 | ||
+ | |||
+ | Configuring: file | ||
+ | Description: | ||
+ | Check on the size of a file. | ||
+ | Display a files size statistics. | ||
+ | If it grows to be too large, report an error about it. | ||
+ | |||
+ | file /path/to/file [maxsize_in_kilobytes] | ||
+ | |||
+ | if maxsize is not specified, assume only size reporting is needed. | ||
+ | |||
+ | The results are reported in the fileTable section of the UCD-SNMP-MIB tree | ||
+ | |||
+ | Enter the path to the file you wish to monitor: /var/log/system.log🆑 | ||
+ | Enter the maximum size (in kilobytes) allowable for /var/log/system.log: 30000🆑 | ||
+ | |||
+ | Finished Output: file /var/log/system.log 30000 | ||
+ | |||
+ | Section: Monitor Various Aspects of the Running Host | ||
+ | Description: | ||
+ | The following check up on various aspects of a host. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: Check for processes that should be running. | ||
+ | 2: Check for disk space usage of a partition. | ||
+ | 3: Check for unreasonable load average values. | ||
+ | 4: Check on the size of a file. | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: | ||
+ | |||
+ | |||
+ | 設定を確認し,終了する. | ||
+ | |||
+ | Select section: list | ||
+ | Lines defined for section "Monitor Various Aspects of the Running Host" so far: | ||
+ | proc /usr/sbin/smbd | ||
+ | disk /Volumes/RAID0_12TB 95% | ||
+ | disk /Volumes/zeusHD 80% | ||
+ | load 12 8 4 | ||
+ | file /var/log/system.log 30000 | ||
+ | |||
+ | Section: Monitor Various Aspects of the Running Host | ||
+ | Description: | ||
+ | The following check up on various aspects of a host. | ||
+ | |||
+ | Select from: | ||
+ | |||
+ | 1: Check for processes that should be running. | ||
+ | 2: Check for disk space usage of a partition. | ||
+ | 3: Check for unreasonable load average values. | ||
+ | 4: Check on the size of a file. | ||
+ | |||
+ | Other options: finished, list | ||
+ | |||
+ | Select section: finished | ||
+ | |||
+ | The configuration information which can be put into snmpd.conf is divided | ||
+ | into sections. Select a configuration section for snmpd.conf | ||
+ | that you wish to create: | ||
+ | |||
+ | 1: Agent Operating Mode | ||
+ | 2: Monitor Various Aspects of the Running Host | ||
+ | 3: Trap Destinations | ||
+ | 4: System Information Setup | ||
+ | 5: Extending the Agent | ||
+ | 6: Access Control Setup | ||
+ | |||
+ | Other options: finished | ||
+ | |||
+ | Select section: finished | ||
+ | |||
+ | I can create the following types of configuration files for you. | ||
+ | Select the file type you wish to create: | ||
+ | (you can create more than one as you run this program) | ||
+ | |||
+ | 1: snmp.conf | ||
+ | 2: snmptrapd.conf | ||
+ | 3: snmpd.conf | ||
+ | |||
+ | Other options: quit | ||
+ | |||
+ | Select File: quit | ||
+ | |||
+ | |||
+ | The following files were created: | ||
+ | |||
+ | snmpd.conf installed in /usr/share/snmp | ||
+ | $ |
- 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: 2958,
today: 4,
yesterday: 1