OK. I got this working. The right format is: extend -cacheTime 2 myextend /bin/bash /path/to/my-script [parms-to-script]
Note that this code is added in version net-snmp 5.8. So this feature does not work in lower version. Thanks. From: Gao, Jiafu (RIS-BCT) Sent: Friday, July 12, 2019 9:17 AM To: 'net-snmp-users@lists.sourceforge.net' <net-snmp-users@lists.sourceforge.net> Subject: Re: Customize SNMP Extension CacheTime I see the following code in 5.8 (extend.c): void extend_parse_config(const char *token, char *cptr) { … cptr = copy_nword(cptr, exec_name, sizeof(exec_name)); if (strcmp(exec_name, "-cacheTime") == 0) { char cache_timeout_str[32]; The question is how -cacheTime s set? I assume it is in extend line the snmpd.conf. I tried several formats, none of them work: extend myextend -cacheTime 2 /bin/bash /path/to/my-script parm1-to-script extend myextend /bin/bash -cacheTime 2 /path/to/my-script parm1-to-script extend myextend /bin/bash /path/to/my-script -cacheTime 2 parm1-to-script Anyone knows the right format to define extend with –cacheTime option? Thanks, Jeff From: Gao, Jiafu (RIS-BCT) via Net-snmp-users [mailto:net-snmp-users@lists.sourceforge.net] Sent: Thursday, July 11, 2019 4:53 PM To: net-snmp-users@lists.sourceforge.net<mailto:net-snmp-users@lists.sourceforge.net> Subject: Customize SNMP Extension CacheTime *** External email: use caution *** ________________________________ Hi, I am using SNMP extension to help load balance my servers, and need to customize cache time. The default cache time for extension is 5 seconds. I need to change it to lower or higher for business purpose. However, the value seems to be read-only: snmpset -v2c –c<com> localhost 'NET-SNMP-ENTEND-MIB::nsExtendCacheTime."my-ext"' integer 2 Error in packet. Reason: noAccess Failed object: NET-SNMP-EXTEND-MIB::nsExtendCacheTime."my-ext" Is there a way to change the nsExtendCacheTime with writing an subagent/AgentX/extension module? It introduces lots of overhead of coding, deployment, and maintenance. Thanks! Jeff ________________________________ ---------------------------------------- The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. This message may be an attorney-client communication and/or work product and as such is privileged and confidential. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. ---------------------------------------- The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. This message may be an attorney-client communication and/or work product and as such is privileged and confidential. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message.
_______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users