概要
InterScan Web Security Suite (以下、IWSS) の snmpd のポートを変更するにはどうすれば良いですか。
詳細
IWSS の snmpd で使用するポート番号を変更する方法
- /etc/iscan/intscan.ini ファイルを開きます。
- [snmp] セクションにある svc_port パラメータに、任意のポート番号を指定し、保存します。
- snmpd を再起動します。
# /etc/iscan/S99ISsnmpd stop
# /etc/iscan/S99ISsnmpd start
# /etc/iscan/S99ISsnmpd start
- /usr/iwss/bin/svc_snmpmonitor.sh ファイルを開き、手順 2 で設定したポート番号を以下の行の "localhost" 以降に追記します。以下は、ポート番号を 10161 に変更した場合の例です。
【変更前】
errmsg=`$SNMPWALK -v 2c localhost -c iscan UCD-SNMP-MIB::prErrMessage.$1 | cut -d' ' -f4-`
【変更後】
errmsg=`$SNMPWALK -v 2c localhost:10161 -c iscan UCD-SNMP-MIB::prErrMessage.$1 | cut -d' ' -f4-`
errmsg=`$SNMPWALK -v 2c localhost -c iscan UCD-SNMP-MIB::prErrMessage.$1 | cut -d' ' -f4-`
【変更後】
errmsg=`$SNMPWALK -v 2c localhost:10161 -c iscan UCD-SNMP-MIB::prErrMessage.$1 | cut -d' ' -f4-`
■IWSS3.1の場合
【変更前】
# set default port number
SNMPPORT=161
【変更後】
# set default port number
SNMPPORT=10161
【変更前】
# set default port number
SNMPPORT=161
【変更後】
# set default port number
SNMPPORT=10161
- /usr/iwss/bin/svc_snmpmonitor.sh シェルを実行し、以下のように正常に実行されることを確認します。
# /usr/iwss/bin/svc_snmpmonitor.sh
logtodb is up and running.
isdelvd is up and running.
postmaster is up and running.
ismetricmgmtd is up and running.
logtodb is up and running.
isdelvd is up and running.
postmaster is up and running.
ismetricmgmtd is up and running.
スクリプト実行時、PostgresSQLに関して以下のようなメッセージが出力されることが確認されておりますが、このメッセージに関しては無視して頂き問題ございません。
Start service...
run /etc/iscan/S99ISdatabase start
start postmaster and wait for postmaster
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start....FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 4389) running in data directory "/var/iwss/postgres/pgdata"?
....
pg_ctl: this data directory appears to be running a pre-existing postmaster
stopped waiting
pg_ctl: could not start server
Examine the log output.
[svc_snmpmonitor.sh] はプロセスの起動監視を行うスクリプトとなり、スクリプト内でPostgreSQLの起動スクリプトを実行しておりますが、以上の例ではプロセスID:4389で既にPostgreSQLプロセスが起動済である為、上記のようなメッセージが出力されております。
Start service...
run /etc/iscan/S99ISdatabase start
start postmaster and wait for postmaster
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start....FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 4389) running in data directory "/var/iwss/postgres/pgdata"?
....
pg_ctl: this data directory appears to be running a pre-existing postmaster
stopped waiting
pg_ctl: could not start server
Examine the log output.
[svc_snmpmonitor.sh] はプロセスの起動監視を行うスクリプトとなり、スクリプト内でPostgreSQLの起動スクリプトを実行しておりますが、以上の例ではプロセスID:4389で既にPostgreSQLプロセスが起動済である為、上記のようなメッセージが出力されております。