IBM's AIX SNMP dameon's configuration file is /etc/snmpdv3Important configuration settings to change are: VACM_VIEW default View 184.108.40.206.220.127.116.11.18.104.22.168 - included - VACM_VIEW default View 22.214.171.124.126.96.36.199.191.1.6 - included - # exclude snmpv3 related MIBs from the default view VACM_VIEW default View snmp Modules - excluded - VACM_VIEW default View 188.8.131.52.184.108.40.206.4 - included - VACM_VIEW default View 220.127.116.11.18.104.22.168.5 - included - VACM_ACCESS group1 - - no Auth No Priv SNMPv1 default View - default View - NOTIFY notify1 traptag trap - TARGET_ADDRESS Target1 UDP 127.0.0.1 traptag trapparms1 - - - TARGET_PARAMETERS trapparms1 SNMPv1 SNMPv1 public no Auth No Priv - # The line below only sets the community string, but allows access # from any IP using the 0.0.0.0 (IP) and 0.0.0.0 (netmask) wildcard #COMMUNITY SECro SECro no Auth No Priv 0.0.0.0 0.0.0.0 - # If we want to restrict access by IP, we need to allow localhost # communication with the SNMP subagents (aixmibd, snmpmibd, ...) COMMUNITY SECro SECro no Auth No Priv 127.0.0.1 255.255.255.255 - # Here we restrict the SNMP access to the Nagios server IP address COMMUNITY SECro SECro no Auth No Priv 192.168.1.34 255.255.255.255 - DEFAULT_SECURITY no-access - - logging file=/usr/tmp/snmpdv3enabled logging size=100000 level=0 smux 22.214.171.124.126.96.36.199.188.8.131.52 gated_password # gated smux 184.108.40.206.220.127.116.11.18.104.22.168.1 muxatmd_password #muxatmd We typically start all three AIX SNMP MIB subagents on our systems: aixmibd, hostmibd and snmpmibd.To make it effective all the way down the call chain, you must follow the setting of the environment variable with an export command. What that means is you can modify the path by appending or prepending the desired directory(s) in existing statements modifying the path.at the end (to be searched after all other directories, in case there is a program by the same name in multiple directories) or at the beginning (to be searched before all other directories). gets built by many different components, you might end up with duplicate entries.After updating the SNMP daemon's configuration above, we can manually stop and restart all SNMP related services with the new community string as shown below: # stopsrc -s aixmibd; stopsrc -s hostmibd; stopsrc -s snmpmibd; stopsrc -s snmpd 0513-044 The /usr/sbin/aixmibd Subsystem was requested to stop. The SNMP daemon and SNMP subagents are started in /etc/rc.tcpip.0513-044 The /usr/sbin/hostmibd Subsystem was requested to stop. In order to enable the subagents to be started after a system reboot with the correct community string, we add the "-c SECro" option as shown in the example below.And because any programs you run from a bash prompt are called by bash, the new path is in force for anything you run from the bash prompt.
The bullet-proof way of Appending/Prepending There are a lot of considerations involved in the choice of appending versus prepending.So it's effective inside the "calling" script or program.But of course, it's not effective in any programs or scripts called by the calling program.These agents provide additional system data to be queried through SNMP.Because we changed the community string for the SNMP daemon, the subagents now need to be run with the new community as well.See How to add home directory path to be discovered by Unix which command?