现在的位置: 首页 > 综合 > 正文

SMUX Enterprise OID readfds

2013年02月13日 ⁄ 综合 ⁄ 共 2699字 ⁄ 字号 评论关闭

SMUX

 To turn off SMUX when you don't have the options of recompiling from source
to disable SMUX support, you have to give it an invalid IP address to bind
to. This may be OS specific. On Linux, if I put this in my snmpd.conf:

	smuxsocket 1.0.0.0

I get an error at startup, and lsof or netstat show that snmpd is no longer
listenting on port 199. If you get and error message about the smuxsocket
token not being recongnized, then you're out of luck. You'll have to recompile
from source (or just use local firewall rules to block connections to port
199).

Enterprise OID

 From: Dave Shield, RObert Story

Recent 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-sysoid
Or 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-oid


If you want to change *both* of these,
then use --with-enterprise-oid

Older Versions (4.2.x)
----------------------
In older version, you have to manuall update the version_id in
agent/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 you
register the file descriptor, and will then be passed to the callback
function when it's invoked.


So if you were listening on two separate sockets, for very similar
types of data, then you could use the same callback for both and
use 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" );


void
who_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]
     */
 

抱歉!评论已关闭.