1title Extending the Agent 2description You can extend the snmp agent to have it return information 3description that you yourself define. 4 5token exec 6info run a simple command using exec() 7info arguments: [oid] name /path/to/executable arguments 8question 1 The OID where the results table should be display [default=extTable] 9question 2 The "name" to associate with this command when displaying the results. 10question 3 The path to the program to be run. 11question 4 The arguments to pass to $3 12 13token pass 14info Run a command that intepretes the request for an entire tree. 15info The pass program defined here will get called for all 16info requests below a certain point in the mib tree. It is then 17info responsible for returning the right data beyond that point. 18info # 19info arguments: miboid program 20info # 21info example: pass .1.3.6.1.4.1.2021.255 /path/to/local/passtest 22info # 23info See the snmpd.conf manual page for further information. 24info # 25info Consider using "pass_persist" for a performance increase. 26question 1 The OID where the script should take control of 27question 2 The path to the program that should be called 28 29token pass_persist 30info Run a persistant process that intepretes the request for an entire tree. 31info The pass program defined here will get called for all 32info requests below a certain point in the mib tree. It is then 33info responsible for returning the right data beyond that point. 34info The pass_persist scripts must be able to stay running and accept input 35info from stdin. 36info # 37info arguments: miboid program 38info # 39info example: pass_persist .1.3.6.1.4.1.2021.255 /path/to/local/pass_persisttest 40info # 41info See the snmpd.conf manual page for further information. 42steal pass 43 44token proxy 45info Proxy requests to an external agent running somewhere else 46info This passes all requests for a certain point of the mib tree to 47info an external agent using snmp requests and then returning the 48info results to the caller that spoke to our agent. 49info arguments: [snmpcmd args] host oid [remoteoid] 50question 1 Enter the "snmpcmd" arguments that specify how to talk to the remote host 51question 2 The host you want to pass the requests to 52qusetion 3 The oid that we should pass beyond 53question 4 The oid of the remote site that we should talk to if different from $3 54 55token sh 56info run a simple command using system() 57info arguments: [oid] name command arguments 58info similar to exec, but implemented using system() instead of exec() 59info # 60info For security reasons, exec should be preferred. 61steal exec 62 63token dlmod 64info dynamically extend the agent using a shared-object 65info arguments: module-name module-path 66question 1 Enter the name of the module 67question 2 Enter the path to the $1 module 68 69