Configuring Snmptrapd on Linux Systems

To setup Snmptrapd on Linux, do the following:

  1. Key shell scripts essential for Snmptrapd configuration are bundled with the eG agent package for Linux. Installing the eG agent therefore, will automatically create the /opt/egurkha/agent/snmptrapd directory containing the check_trapd, start_trapd, and cron_trapd files and a sub-directory named log.
  2. Next, execute the shell script defined within the cron_trapd file by issuing the command crontab cron_trapd from the /opt/egurkha/agent/snmptrapd directory. This command will invoke the check_trapd script.


    If the SetUI operation not permitted error appears while executing the crontab cron_trapd command, do the following:

    • Verify whether the root-user is the owner of crontab. If not, issue the command - chown root:root crontab  - to change the ownership of crontab.
    • Then, execute the command: chmod +s crontab to give the appropriate execution privileges to the user running the crontab command. .
  3. The primary responsibility of the check_trapd script is to start the Snmptrapd process using the start_trapd file. Additionally, the check_trapd will check if the snmptrapd.log file has reached a size of 1MB. If so, it will delete the file and restart the Snmptrapd process so as to prevent the log from growing excessively.
  4. The start_trapd file will contain the port at which the Snmptrapd process listens for SNMP traps from SNMP agents. The default SNMP trap port is 162. However, in Unix environments, a default Snmptrapd process already runs at this port. Therefore, for Unix environments, the port has been set to 6667. This default port setting can be modified by editing the port parameter of the start_trapd file.


    Ensure that the port number and community string (default: public) specified in the start_trapd file is the same as the SNMP port of the application or network device from which the SNMP traps originate.