エージェントアクセス制御ファイルは、SNMP 関連のコミュニティ情報を保存する構成ファイルです。各サブエージェントとマスターエージェントには、独自のアクセス制御ファイルがあります。このファイル名には拡張子を付けることができます。拡張子は acl にすることをお勧めします。このファイルは、/etc/snmp/conf というディレクトリに保存する必要があります。
<snmp_security> : <acls> <trap_block>
<acls> : /*empty*/ | “acl” “=” {<acls_list> }
<acls_list> : /*empty*/ | <acls_list> <acl_item>
<acl_item> : {<communities_stmt> <acl_access> <hosts> }
<communities_stmt> : “communities” “=” <communities_set>
<communities_set> : <communities_set> , <community_elem> |
<community_elem>
<community_elem>: alphanumeric_string
<acl_access> : “access” “=” <acl_access_type>
<acl_access_type> : read-only | read-write
<hosts> : “managers” “=” <hosts_list>
<hosts_list> : <hosts_list> , <host_item> | <host_item>
<host_item> : alphanumeric_string
<trap_block> : “trap” “=” { <traps_list> }
<traps_list> : /*empty*/ | <trap_list> < trap_item>
<trap_item> : { <trap_community_string> <trap_interest_hosts>
<enterprise_list> }
<trap_community_string> : “trap-community” “=” alphanumeric_string
<trap_interest_hosts_list> : <trap_interest_hosts_list> ,
<trap_interest_host_item> |
<trap_interest_host_item>
<trap_interest_host_item> : alphanumeric_string
<enterprise_list> : /*empty*/ | <enterprise_list> <enterprise_item>
<enterprise_item> : { <enterprise_stmt> <trap_number_stmt> }
<enterprise_stmt> : “enterprise” “=” quouted_alphanumeric_string
<trap_number_stmt> : “trap-num” “=” <trap_number_list>
<trap_number_list> : <trap_number_item>
<trap_number_item> : <trap_range>
<trap_range> : integer - integer | integer
acl = {
{
communities = public, private
access = read-only
managers = hubble, snowbell, nanak
}
{
communities = jerry
access = read-write
managers = hubble, telescope
}
}
trap = {
{
trap-community = SNMP-trap
hosts = hubble, snowbell
{ enterprise = “Sun”
trap-num = 1, 2-5
}
{
enterprise = “3Com”
trap-num = 4 }
}
{
trap-community = competitor-trap
hosts = hp_server, ibm_server, sgi
{
enterprise = “sun”
trap-num = 1,3 }
{
enterprise = “snmp”
trap-num = 1-32
}
}
}
アクセス制御リストファイルには、2 つのグループの構成変数が保存されています。
acl - このグループの変数は、コミュニティ名、アクセス権、および SNMP 要求を受け付けるホスト名の 3 つが 1 組となって定義され、それが多数記述されます。なお、あらかじめ設定しておいたコミュニティ名が含まれていなければ、この SNMP 要求は受け付けられません。前述のアクセス制御リストファイルの例では、public と private というコミュニティ名を含むホスト hubble、snowbell、および nanak からの GET および GET_NEXT SNMP 要求だけが受け付けられます。このグループには、3 つの組み合わせを複数指定できます。
マスターエージェントには、SNMP PDU を受け取るための適切なアクセス権とコミュニティがあります。ただし、同じ SNMP PDU がサブエージェントに転送される場合、マスターエージェントは受信するための適正な権限がなかったり、適正なコミュニティが含まれていない場合、その PDU を拒否することがあります。マスターエージェントに適切なコミュニティとアクセス権がなければ、サブエージェントに SNMP PDU を受信するためのアクセス権とコミュニティがあったとしても、そのような PDU はサブエージェントに到達することはありません。
trap - この変数のグループは、サブエージェントから受信するトラップを送信したり、転送したりするための情報で構成されます。マスターエージェントは、トラップを転送する際にこのグループで指定された情報を使います。この情報には、構成されたトラップ番号を送るためのホスト名を指定します。トラップの PDU には、指定したトラップのコミュニティが含まれます。これらのトラップは、最初にサブエージェントによって生成され、次にマスターエージェントに送信されます。