2 Démarrage et arrêt de SNMP.
Le service ‘snmpd’ se lance et s’arrête par le gestionnaire de ressources AIX. Par défaut, le service est lancé automatiquement au démarrage du système. Pour le vérifier, consulter le fichier ‘/etc/rc.tcpip’. ‘startsrc –s snmpd’ : Lancement du sous-système.‘refresh –s snmpd’ : Relance du sous-système et relecture du fichier de paramétrage.‘stopsrc –s snmpd’ : Arrêt du processus ‘snmpd’. Plusieurs autres processus sont lancés en même temps de ‘snmpd’. Il s’agit des sous-systèmes ‘hostmib2’, ‘aixmibd’ et ‘snmpmibd’.3 Fichier de paramétrage /etc/snmpdv3.conf.
Le paramétrage de SNMPD en V3 se fait au travers du fichier ‘/etc/snmpdv3.conf’. Les définitions des objets se trouvent dans le fichiet ‘/etc/mib.defs’. Ce fichier est généré par la commande : ‘cd /usr/samples/snmpd ; mosy –o /etc/mib.defs ibm.my mibII.my’ D’autres fichiers ‘.my’ peuvent être compilés et intégrés dans le ‘/etc/mib.defs’.4 Options.
Voir documentation sur SNMP V3.5 Commandes.
‘clsnmp –v walk system’ : Affiche le contenu de l’arbre ‘system’.snmpinfo –m dump –v |pg : Affichage des informations complètes.6 Exemple SNMPv3.conf.
VACM_GROUP group1 SNMPv1 public
- VACM_VIEW default
V
iew internet - included - # exclude snmpv3 related MIBs from the default viewVACM_VIEW defaultView snmpModules - excluded -VACM_VIEW defaultView 1.3.6.1.6.3.1.1.4 - included -VACM_VIEW defaultView 1.3.6.1.6.3.1.1.5 - included - # exclude aixmibd managed MIBs from the default view#VACM_VIEW defaultView 1.3.6.1.4.1.2.6.191 - excluded - VACM_ACCESS group1 - - noAuthNoPriv SNMPv1 defaultView - defaultView - NOTIFY notify1 traptag trap - TARGET_ADDRESS Target1 UDP 127.0.0.1 traptag trapparms1 - - - TARGET_PARAMETERS trapparms1 SNMPv1 SNMPv1 public noAuthNoPriv - COMMUNITY public public noAuthNoPriv 0.0.0.0 0.0.0.0 - DEFAULT_SECURITY no-access - - logging file=/usr/tmp/snmpdv3.log enabledlogging size=10000000 level=0 smux 1.3.6.1.4.1.2.3.1.2.1.2 gated_password # gated smux 1.3.6.1.4.1.2.3.1.2.3.1.1 muxatmd_password #muxatmd
Test de trap SNMP. Une fois le serveur SNMP prêt à recevoir, lancer la commande : ‘snmptrap -h Serveur_SNMP -c public -m Hello’ 7 Extrait documentation IBM(Anglais).
7.1 Purpose
Converts the ASN.1 definitions of Structure and Identification of Management Information (SMI) and Management Information Base (MIB) modules into objects definition files for the snmpinfo command.7.2 Syntax
mosy -o OutputFile [ -s ] InputFile ...7.3 Description
The mosy command reads in the ASN.1 definitions of SMI and MIB modules and produces objects definition files in specific formats. The resulting objects definition files are used by the snmpinfo command.The InputFile parameter files are required to be in the smi.my or mibII.my format. Sample files are the /usr/samples/snmpd/smi.my and /usr/samples/snmpd/mibII.my files. See the smi.my and the mibII.my files for information on the required format of the file specified by the InputFile parameter.The mosy -o command is used to create the objects definition file specified by the OutputFile parameter for the snmpinfo command. This file is normally the /etc/mib.defs file.The objects definition file can be created with one pass of the mosy compiler if the smi.my and mibII.my files are both specified as InputFile parameters. The smi.my file must precede the mibII.my file on the command line.The mosy -o command can also be used to create subfiles. If subfiles are created separately from the SMI and MIB modules, you must concatenate the various subfiles before the snmpinfo command can successfully use the resultant mib.defs file. The SMI subfile must be at the top of the final objects definition file.You can add objects definitions for experimental MIB modules or private-enterprise-specific MIB modules to the /etc/mib.defs file, but you must first obtain the private MIB module from the vendor that supports those MIB variables.To update the /etc/mib.defs file to incorporate a vendor's private or experimental MIB objects definitions, create a subfile and then concatenate that subfile to the existing MIB II /etc/mib.defs file. See example 3.7.4 Flags
7.5 Parameters
InputFile | Defines the ASN.1 object definitions module for input to the mosy compiler. This file can be formatted according to either the smi.my or mibll.my file format. |
7.6 Examples
1. To create an objects definition file for use by the snmpinfo command with one pass of the mosy command, enter:2. mosy -o /etc/mib.defs /usr/samples/snmpd/smi.my
/usr/samples/snmpd/mibII.my
In this example, /usr/samples/snmpd/smi.my and /usr/samples/snmpd/mibII.my are both specified as input files and the resultant objects definition file is the /etc/mib.defs file.3. To create objects definition subfiles, enter: 4. mosy -o /tmp/smi.obj /usr/samples/snmpd/smi.my
5. mosy -o /tmp/mibII.obj /usr/samples/snmpd/mibII.my
cat /tmp/smi.obj /tmp/mibII.obj > /etc/mib.defs
In this example, the first command creates an SMI objects file, /tmp/smi.obj, from the /usr/samples/snmpd/smi.my file. The second command creates the MIB objects definition file, /tmp/mibII.obj, from the /usr/samples/snmpd/mibII.my file. The final command concatenates the subfiles, placing the SMI objects definition file first in the resultant /etc/mib.defs file.6. To add private enterprise specific MIB objects definitions to an existing /etc/mib.defs file for use by the snmpinfo command, enter: 7. mosy -o /tmp/private.obj /tmp/private.my
8. cat /etc/mib.defs /tmp/private.obj > /tmp/mib.defs
mv /tmp/mib.defs /etc/mib.defs
In this example, the first command creates the /tmp/private.obj objects definition file. The second command concatenates the /etc/mib.defs MIB objects definition file with the /tmp/private.obj private MIB file and places the concatenated contents into the /tmp/mib.defs temporary MIB objects definition file. The final command moves the temporary file to the /etc/mib.defs file for use by the snmpinfo command. 7.7 Files
/etc/mib.defs | Defines the Management Information Base (MIB) variables the SNMP agent should recognize and handle. The format of the /etc/mib.defs file is required by the snmpinfo command. |
/usr/samples/snmpd/smi.my | Defines the ASN.1 definitions by which the SMI is defined as in RFC 1155. |
/usr/samples/snmpd/mibII.my | Defines the ASN.1 definitions for the MIB II variables as defined in RFC 1213. |