SMUX Enterprise OID readfds

来源:互联网 发布:网络共享中心打不开 编辑:程序博客网 时间:2024/04/29 20:48
 

SMUX Enterprise OID readfds

 152人阅读 评论(0) 收藏 举报

目录(?)[+]

SMUX

 To turn off SMUX when you don't have the options of recompiling from sourceto disable SMUX support, you have to give it an invalid IP address to bindto. This may be OS specific. On Linux, if I put this in my snmpd.conf:smuxsocket 1.0.0.0I get an error at startup, and lsof or netstat show that snmpd is no longerlistenting on port 199. If you get and error message about the smuxsockettoken not being recongnized, then you're out of luck. You'll have to recompilefrom source (or just use local firewall rules to block connections to port199).

Enterprise OID

 From: Dave Shield, RObert StoryRecent Versions (5.x)---------------------If you want to *just* change the sysObjectID numbering,(and leave the notifications using the Net-SNMP enterprise OID)then use  --with-enterprise-sysoidOr you could just use the snmpd.conf directive 'sysobjectid'to set this at run time.If you want to *just* change enterprise-specific notification OID(and leave the sysObjectID using the Net-SNMP values)then use  --with-enterprise-notification-oidIf you want to change *both* of these,then use --with-enterprise-oidOlder Versions (4.2.x)----------------------In older version, you have to manuall update the version_id inagent/agent_trap.c:80   oid version_id[]    = { EXTENSIBLEMIB, AGENTID, OSTYPE };

readfds

 > can you please tell me the meaning of the third argument. obviously the > first parameter to register_readfd is a file descriptor and second is the > callback function.Correct.The third parameter is arbitrary data that you can specify when youregister the file descriptor, and will then be passed to the callbackfunction when it's invoked.So if you were listening on two separate sockets, for very similartypes of data, then you could use the same callback for both anduse this third parameter to distinguish between them:fd1 = open( "/proc/tweedledum" );fd2 = open( "/proc/tweedledee" );register_readfd( fd1, who_broke_the_rattle(), "tweedledee" );register_readfd( fd2, who_broke_the_rattle(), "tweedledum" );voidwho_broke_the_rattle( int fd, void *data ){    char *he_did = (char *)data;    printf("%s broke the rattle!/n", he_did );}

Baby Steps Flow

     /**     * Baby Steps Flow diagram (rev 2003.09.29.1330)     *     * Legend: (test) [optional] <required>     *     * OLD              NEW     * ========  ============================================     * +++           [pre_request]     *                    |     *               (row exists?) N ->(row_creation) N >-->+     *                    |                   | Y           |     *                    |<------------------+             |     *                   /|/                               /|/     * RESERVE1  <object_syntax_checks>                     |     *                    |                                 |      *                  (err?)  Y >------------------------>+     *                    |                                 |     *                   /|/                               /|/     * +++          (row existed?) N --->[row_creation]     |     *                    |                   |             |     *                    |<--------------N (err?)          |     *                    |                   | Y           |     *                    |                   |             |     *                    |       [row_creation_cleanup]--->+     *                   /|/                                |     * RESERVER2     [undo_setup]                           |     *                    |                                 |     *                  (err?)  Y --->-------->--------->+  |     *                    |                              | /|/     * ACTION        <set_values>                        |  |     *                    |                              |  |     *                  (err?)  Y >---------+           /|/ |     *                    |                 |            |  |     * +++        [consistency_checks]      |            |  |     *                    |                /|/           |  |     * UNDO             (err?)  Y >-------[undo]-------->+  |     *                    |                              |  |     *            [reversible_commit]                    |  |     * +++                |                              | /|/     *                  (err?)  Y >--[reverse_commit]    |  |     *                    |              |               |  |     * COMMIT        <final_commit>      |               |  |     *                    |              |               |  |     *                  (err?)  Y >--[log msg]           |  |     *                    |              |               |  |     *                    |             /|/             /|/ |     *                    | <-----------<+---<-----------+  |     *                   /|/                                |     * FREE          [undo_cleanup]                         |     *                    |                                /|/     *                    |<--------------<-----------------+     *                   /|/     *               [post_request]     */