SMUX Enterprise OID readfds

 

SMUX Enterprise OID readfds

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

目录(?)[+]

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]
     */
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值