![]() | |
Sun Java(TM) System Directory Server 5.2 2005Q1 �z��n |
�� 14 ��
�ϥ� SNMP �ʵ�ؿ��A��²����z�q�T��w (SNMP) �O�@�ӼзǤƪ��z�q�T��w�A�i�ΨӧY�ɺʵ�P�z�˸m��3�ε{���CDirectory Server ���Ѥ@�Ӧ��N�z�{�������A��i�H��� SNMP �z��3�ε{���ʵ�C�o����3�ε{�����M�w�ؿ��A�������A�A�è�o����䬡�ʪ���T�C
Directory Server SNMP ���N�z�{���t����Ū�ȡCSNMP �z3�ε{���L�k�b��A���W���ʧ@�C
�@��Ө��A�� 13 ���u�ϥΰO���ɺʵ� Directory Server�v���ҭz���s��P��~�O���ɥi�H���ѧ�Ժɪ���A����T�A�� LDAP �O�ΨӦw���s��έק��A���t�m���ҿ�q�T��w�C���L�ASNMP ���N�z�{���T�ꤹ�\ Directory Server ��ҰѻP�{�������z�t�ΡC
�����]�t�U�C�D�D�G
Sun Java System ��A������ SNMPSNMP ��z3�ε{������3�ε{���M���N�z�{���Φ��N�z�{�����˸m�i��d�ߡCSNMP �N�z�{���Φ��N�z�{���|�����Ӧ�3�ε{���θ˸m����T�A�H�^3�Ӧ� SNMP �z��d�ߡC�b�ѥN�z�{�����z��T�w (MIB) �ҩw�q����椤�A��T�O�H�ܼƪ������غc�Ӧ��C
���z��|�g�`�d�ߦ��N�z�{������ SNMP �ܼơA���N�z�{���h�Ǧ^�n�D���ȡCSNMP �]�w�q�@�M���A��N�z�{�����ǰe Trap �T�����Ҧ����z��A�H��i�ƥ�C�p�G�b�Ұ� Directory Server �`�n�{�����e���b��榸�N�z�{���M�D�N�z�{���A�h Directory Server ���N�z�{���b Directory Server �Ұʩ���ɶǰe SMUX Trap �ܥD�N�z�{���C�D�N�z�{���N���ഫ�� SNMP Trap�C
�D��W�i�H�w�˦h�Ӧ��N�z�{���C�Ҧp�A�p�G�N Directory Server�B3�ε{����A���M�l���A�� (Messaging Server) �����w�˦b�P�@�x�D��W�A�h�C�@�Ӧ�A�������N�z�{�����|�P�P�@�ӥD�N�z�{���i��q�T�C
�b UNIX ��Ҥ��A��w�w�� Administration Server �ɡA�|�� Directory Server �Ψ�L Sun Java System ���~���� SNMP �D�N�z�{�� (MAGT) �C
�p�����ϥ� SNMP �ʵ��A�����ԲӸ�T�A�аѾ\ Administration Server Administration Guide�C
�]�w��A�����z�L SNMP ����ʵ�@��{�Ǧp�U�G
- �sĶ Directory Server MIB�A�ñN����X�i�z�� SNMP �z�t�ΡC�аѾ\�t�Τ��C
- �b�z���q���W�]�w SNMP�A�p�]�w SNMP�ҭz�C
- �z�L Directory Server Console �t�m SNMP ���N�z�{���C�аѾ\�b Directory Server ���t�m SNMP�C
- �z�L Directory Server Console �Ұ� SNMP ���N�z�{���C�аѾ\�ҰʻP���� SNMP ���N�z�{���C
- �s��� MIB �w�q�� SNMP ��z����A�óz�L�N�z�{���N�����}�C�o�ӨB�J�����̱z�� SNMP �z�t�Φөw�C
�U�C�U�`�y�z Directory Server �t�m�S�w���B�J�C
Directory Server MIB ���zDirectory Server �� MIB ���U�C�����ѧO�X�G
iso.org.dod.internet.private.enterprises.netscape.nsldap
(nsldapd OBJECT IDENTIFIER ::= { 1.3.6.1.4.1.1450.7 })���w�q�b�U�C�ɮפ��G
ServerRoot/plugins/snmp/netscape-ldap.mib
MIB �w�q�F�i�z�L SNMP �ʵ��ܼơA�H���ܼƤ��t���ƭ������C�ؿ� MIB �&��|�Ӥ��P����z�����G
- �@�~�� - �]�t�ؿ���s���B�@�~�B�ѷӤο�~���έp��ơC�o���ܼƭȤ]�s�b�ؿ� cn=snmp,cn=monitor ���ت��ݩʤ��C�аѾ\ Directory Server Administration Reference�C
- ���ت� - �]�t�ؿ���ؼƩM���ا֨��I;�C�o���ܼƭȤ]�P�ؿ� cn=snmp,cn=monitor ���ت��ݩʤ����@�~�ܼƲV�b�@�_�C�аѾ\ Directory Server Administration Reference�C
- ���ʪ� - �]�t���ؿ��A���q�T���̪� 5 �ӥؿ��A�����έp��ơC�аѾ\ Directory Server Administration Reference�C
- ����� - �]�t�y�z�o�� Directory Server ��Ҫ��ܼơA�Ҧp���A�� ID �M�����C�аѾ\ Directory Server Administration Reference�C
�b�i�H�ϥΥؿ� MIB ���e�A�����N���P�z�i�H�b�U�C�ؿ��쪺 MIB �@�_�sĶ�G
ServerRoot/plugins/snmp/mibs
�p����� MIB �sĶ�覡����T�A�аѾ\ SNMP ���~���C
�]�w SNMP�b Solaris ���x�W
Solaris �W��ij���t�m���N Directory Service �D�N�z�{�� (MPS/MAGT) ���J Solaris ��ͥN�z�{���[�c���C�b���t�m���ASolaris �N�z�{�� snmpdx �t�d�Ұ� MPS �N�z�{���ñN Directory Server SNMP �n�D��e�� MPS �N�z�{���C�o��ܤ��n�D�O�_�P Directory Server ����A�Ҧ� SNMP �z�Τ�ݳ��i�H�p���зdzs���� 161 �W�� Solaris �N�z�{���C
�z�������s�t�m MPS �N�z�{���A�ϥ��b���P���s���� (��ij�� 1161) �W���A�q�Ӥ��|�P Solaris �N�z�{���Ĭ�C�U�C���Ѫ��d�ҵ{�ǥ]�t�ӨB�J�C�b Administration Server Administration Guide ���A���Ѧ��t�m MPS �N�z�{�����i�@�B����C��Ъ`�N�A���t�m�ݭn�H Solaris �N�z�{���Ұ� MPS �N�z�{���A�ҥH�z����ϥ� Administration Server �ӱҰʩΰ��� MPS �N�z�{���C
���J snmpdx SNMP �D�N�z�{�� - Solaris �d���̷Ӧ��{�Ǵ��J Solaris snmpdx �N�z�{�� (man snmpdx(1M))�CSolaris snmpdx �N�z�{���i�H�b�зdzs���� 161 �W���A�ñN Directory SNMP �n�D��e�� Directory Server�C
�H�z���ؿ��ҦW�٨�N slapd-instance�C
- �H�W�ŨϥΪ̨���n�J�C
- �� MPS �N�z�{���إߵ�U�ɡG/etc/snmp/conf/mps.reg
�N�U�C���e�[�J���ɮפ��G
#
# Registration file for MPS Agent.
#
##########
# agents #
##########
agents = {
{
name = "mps"
subtrees = {
# Directory Server
1.3.6.1.4.1.1450.7,
# Web Server
1.3.6.1.4.1.1450.1.60
}
timeout = 2000000
watch-dog-time = 86400
port = 1161
}
}
- �� MPS �N�z�{���إ߸귽�ɮסG/etc/snmp/conf/mps.rsrc
�N�U�C���e�[�J���ɮפ��G
#
# Resource file for MPS Agent.
#
resource =
{
{
registration_file = "/etc/snmp/conf/mps.reg"
policy = "spawn"
type = "legacy"
command = "install-dir/plugins/snmp/magt/magt
install-dir/plugins/snmp/magt/CONFIG
install-dir/plugins/snmp/magt/INIT"}
}
- �N�U�C�U��[�J install-dir/plugins/snmp/magt/CONFIG ������
TRANSPORT extraordinary SNMP
OVER UDP SOCKET
AT PORT 1161
- ���s�}��A�M���ˬd magt �{�ǬO�_�b�s���� 1161 �W���C�Ҧp�G
$ pgrep magt
21954
$ netstat -a | grep 1161
*.1161 Idle
*.1161 Idle
- �p�b Directory Server ���t�m SNMP �ҭz�A�t�m Directory Server ���N�z�{���C�ϥιw�]�s���� 199�C
�z�i�H�b /etc/init.d ���إߤ@�ӧt���U�C�X�檺�Ұʵ{���ɥH�b�}��ɦ۰ʱҰʦ��N�z�{���C���N�z�{���u�b MPS �N�z�{���w�ҰʮɱҰʡC
$ cd install-dir/bin/slapd/server
[ -x ./64/ns-slapd ] && [ "?bin/isainfo -b 2> /dev/null? = 64 ] && cd ./64
./ns-ldapagt -d install-dir/slapd-instance
- �ˬd���N�z�{���O�_���C�Ҧp�G
$ pgrep ns-ldapagt
22411
�b Linux ���x�W
- �b Red Hat Linux Advanced Server �W�A�i���ˬd�H�T�O��� snmpd �����C�ШϥΥH�U��O�G
$ pgrep snmpd
�p�G��� snmpd �b��椤�A�ШϥΥH�U��O�N�䰱��G
/etc/rc.d/init.d/snmpd stop
- �p�G�z�n����� snmpd�A���ܧ��� snmpd ���s���X�C�o�O�]���̾ڹw�] Directory Server MPS (MAGT) �D�N�z�{���έ�� snmpd ���ϥγs���� 161�C
�Y�n�ܧ�s���X�A�Эק� /etc/rc.d/init.d/snmpd ���� OPTIONS �ܼơA�p�U�ҥܡG
OPTIONS="-s -l /dev/null -P /var/run/snmpd.pid -a -p 1161" adding -p 1161
�o�˴N�|�N snmpd �s�����ܧ� 1161�C
- �Ұʭ�� snmpd�A�а��G
/etc/rc.d/init.d/snmpd start
Linux �W�� SNMP ����
��b Linux �W�t�m SNMP �ɡA�ЦҶq�U�C�X�I�G
- ��̷��b Directory Server ���t�m SNMP �ҭz�Ӱt�m Directory Server SNMP ���N�z�{���ɡA�Шϥιw�]�s���� 199�C
- �p�G�z�n�ϥε{���ɨӱҰʡB����έ��s�Ұ� Directory Server�B���� MAGT (MPS) SNMP �D�N�z�{���� SNMP ���N�z�{���A�Шϥ��{���X�d�� 14-1 �����{���X�C�b /etc/init.d ���إ��ɦW�� directorysnmp ���{���ɡC
�{���X�d�� 14-1 SNMP Linux �{���� directorysnmp
#!/bin/sh
DIR=""
BASEDIR=`/bin/rpm -qa --queryformat '%{INSTPREFIXES}' sun-directory\* | head -1`
[ -r "$BASEDIR/directory-server/5.2/shared/config/serverroot.conf" ] || exit 0
VAR=`/bin/cat $BASEDIR/directory-server/5.2/shared/config/serverroot.conf`
for di in $VAR/slapd-*
do
[ -d "$di" ] && DIR="$DIR $di"
done
start() {
[ ! -z "$DIR" ] || exit 0
# Start the Directory Server or Servers
for di in $DIR; do
$di/start-slapd
done
# Start the master agent
cd $VAR/plugins/snmp/magt
./magt ./CONFIG ./INIT >/dev/null 2>&1 &
# Give the master agent a chance to start.
#
loop_counter=1
max_count=10
while [ $loop_counter -le $max_count ]; do
n=`/usr/bin/pgrep -f magt | /usr/bin/wc -l`
if [ $n -gt 0 ]; then break; fi
loop_counter=`expr $loop_counter + 1`
sleep 1
done
if [ $n -eq 0 ]; then
echo "Directory Server agents not started."
exit 1
fi
# Start the subagent
cd $VAR/bin/slapd/server
for di in $DIR; do
./ns-ldapagt -d $di >/dev/null 2>&1 &
done
}
stop() {
[ ! -z "$DIR" ] || exit 0
# Stop the subagent
for di in $DIR; do
lkfile=${di}/logs/NSLDAPAGT.LK
if [ -r $lkfile ]; then
pid=`/usr/bin/cut -f 1 -d' ' $lkfile`
kill $pid >/dev/null 2>&1
fi
done
# Stop the master agent
/usr/bin/pkill magt
# Stop the Directory Server
for di in $DIR; do
$di/stop-slapd
done
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
�b Directory Server ���t�m SNMP�b���x�W�]�w SNMP �N�z�{���ΪA�ȫ�A�z�����t�m Directory Server ��Ҥ��� SNMP �ѼơC�Y�n�q Directory Server Console �t�m SNMP �]�w�G
- �b Directory Server Console �̤W�h�� [�t�m] ���ҤW�A���t�m�𪬥ؿ�ڳ�����A���`�I�A�A���k���O���� [SNMP] ���ҡC
- ��� [�ҥβέp��Ʀ���] �֨���C���ﵽ�귽�ϥα��ΡA�w�]���p�U���|���� SNMP �ܼƪ��έp��ơC�p�G�z���ϥ� SNMP�A�]���z�L LDAP �ʵ� cn=snmp,cn=monitor ���ت��ݩʡA�z3����o�Ӯ֨���O��Ϊ��A�C
- �b��3����r��줤�A��J�D�N�z�{�����D��W�٩M�s���X�C
�w�]�Ȥ'O�O localhost �M�s���� 199�C
- �b [�y�z�ݩ�] ����r��줤��J��T�C�o�ǭȱN�ϬM�b����A�����}�� SNMP ����?�G
- ��@�U [�x�s] �H�x�s�ܧ�C
- �̥H�U���`�ҭz�A�Ұʩέ��s�Ұ� SNMP ���N�z�{���C
�ҰʻP���� SNMP ���N�z�{���H�U�{�Ǵy�z�p��q Directory Server Console �ҰʡB���s�Ұʩΰ��� SNMP ���N�z�{���C
�ҰʡB����M���s�Ұ� SNMP ���N�z�{���G