带有 net-snmp 的 Informix snmp 子代理

带有 net-snmp 的 Informix snmp 子代理

有没有人成功配置了 informix 10 snmp 子代理与 linux 或 windows 中的 net-snmp 一起工作?

答案1

好吧,我敢肯定某人有!

但我怀疑您问的是这是否可能。这取决于 Informix 子代理的行为方式。它很可能实现以下之一:直接 SNMP(在这种情况下,您需要使用 Net-SNMP “代理”它)、AgentX(IETF 设计的子代理协议,Net-SNMP 支持它)或 SMUX(Net-SNMP 也支持的较旧的子代理协议)。

所以“我可以吗”的答案肯定是“可以”。

答案2

我正在重写我的答案,因为今天我已经将 Informix SNMP 配置为在 Linux 和 AIX 上运行。不是 Windows...

今天我使用带有 SNMP 服务的 Zabbix Server 对其进行监控。我为 Informix 创建了一个 Zabbix 模板,您可以在此处找到:https://www.zabbix.org/wiki/Zabbix_Templates#Database

使用 Zabbix 模板,我编写了一个自述文件,其中解释了如何使用 AIX 配置 Informix SNMP,但它也适用于 Linux。

我将在此复制此自述文件的部分内容:

About SNMP and Informix
    Informix have a special service for SNMP where is installed on default
    installation, you will found it on : $INFORMIXDIR/snmp
    **** As far I know , there is no additional licence to use it.

    There you will found the runsnmp.ksh script and .mib files rdbms, apps, omni
    for SNMP v1 and v2. For this template I was used the SNMP v2 MIBs .

    You can found the last documentation (Informix v12.10) here :
      http://pic.dhe.ibm.com/infocenter/informix/v121/topic/com.ibm.snmp.doc/snmp.htm
    or PDF here:
      http://www-01.ibm.com/support/docview.wss?uid=swg27023505

    Informix offer the SNMP Master agent and the sub-agent.
    On "perfect world" , you should use only the sub-agent and integrate it
    with the Master Agent of your machine/OS where Informix is running
    (supposing have a SNMP service active on your OS)
    But this requires some compatibility and manual configuration (very annoying)
    If you want try this, please read the official documentation/manual.

    In past I already try configure the Informix sub-agent with Linux Red Hat
    Master Agent, without success, the workaround is use the Informix SNMP
    Master Agent.
    Today I work with AIX environment and to keep it simple I choose
    work with Informix SNMP Master Agent (I not try configure the Informix
    sub-agent with AIX SNMP Master Agent). Our AIX have SNMP service active, this
    way we have two Master Agent on same OS, what is 100% possible, but requires
    adjustments of the configuration on Informix SNMP Master Agent.

    Delay on recent releases:
    The SNMP service seems to have been forgotten by engineers from IBM and
    a lot of new features aren't included into it.
    I have open a feature request on IBM RFE site to improve/update the SNMP service:
        Headline: improve/update SNMP service
        ID: 35921
        http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=35921
    If you have interest on it , please follow the link, sign up and vote on
    the feature, if have suggestion use the comment tab.


--------------------------------------------------------------
How active the SNMP service on Informix?
    Is quite simple, but have a pre-requisite : the SNMP service *needs* run with root user.
    * Log in with root
    * Set your informix enviroment (INFORMIXSERVER, INFORMIXDIR, INFORMIXSQLHOSTS, etc)]
    * cd $INFORMIXDIR/snmp
    * ./runsnmp.ksh start
    And finish!!!

    If you already have a Master Agent running on same OS, you can change the
    port used by Informix SNMP Master Agent, for example, changing to port 5161.
    (off course, we need adapt the template to use the correct port)
    * INFORMIXSNMPPORT=5161 ./runsnmp.ksh start
      The output should be something like :
       | runsnmp.ksh FYI   - Using INFORMIXDIR: /xxx/informix
       | runsnmp.ksh FYI   - Using INFORMIXSNMPPORT = 5161
       | runsnmp.ksh FYI   - Setting SR_SNMP_TEST_PORT to 5161
       | runsnmp.ksh FYI   - Setting SR_TRAP_TEST_PORT to 162
       | runsnmp.ksh FYI   - Setting SR_AGT_CONF_DIR to /xxx/informix/snmp/snmpr
       | SNMP Research EMANATE Agent Version 16.2.0.27
       | Copyright 1989-2007 SNMP Research, Inc.
       | runsnmp.ksh FYI   - The SNMP Research Inc. master agent (snmpdm) started (pid  13107646).
       | runsnmp.ksh FYI   - The server discovery daemon (onsrvapd) started (pid  13434922).
    Will be created tree LOG files (Master, srvprd, sub-agent) on /tmp (by default) :
       | /tmp> ls -ltr on*log *snmp*
       | -rw-rw-r--    1 informix informix       1090 Jun 10 17:22 onsrvapd.517185c724026.log
       | -rw-rw-r--    1 informix informix       4011 Jun 11 08:06 onsnmp.idsbkp.517185c8580f4.log
       | -rw-------    1 root     system      9204234 Jun 13 12:10 snmpd.log


    If you check your PIDs with ps -fe , you should found at least 3 PIDs : snmpdm, onsrvapd and onsnmp
    bellow is the output on my AIX 5.3 where the snmpmibd and snmpd is the AIX SNMP service.
       | > ps -fe | egrep "snmp|onsrv"
       |     root 135182  77830   0   Apr 19      -  4:35 /usr/sbin/snmpmibd
       |     root 143414  77830   0   Apr 19      -  8:27 /usr/sbin/snmpd
       | informix 147494      1   0   Apr 19      -  8:54 /xxx/informix/bin/onsrvapd
       |     root 356500      1   0   Apr 19      -  3:39 /xxx/informix/bin/snmpdm (5161)
       | informix 360692 147494   0   Apr 19      - 6046:38 onsnmp -nidsbkp -k5 -p5 -l/tmp -g32 -r4

        * Master Agent = snmpdm
        * Server Discovery = onsrvapd
             The discovery process discovers multiple server instances running on the host.
             These instances might belong to different versions that are installed on different
             directories. Whenever a server instance is brought online, the discovery process
             detects it and spawns an instance of OnSNMP to monitor the database server.
        * Sub Agent = onsnmp


--------------------------------------------------------------
How the SNMP items was discovered and included into this Template?

    * First I was used the Zabbix plugin SNMP Browser
        https://www.zabbix.com/wiki/howto/monitor/snmp/snmp_builder
        https://github.com/atimonin/snmpbuilder
      For each item showed what I have interest to monitor , I have added
      manually into the template.

    Since this plugin isn't prepared to Zabbix 2.0.5 (when I download it) I need 
    to patch it manually and do some manual adjustments to work. After that 
    works fine, but be careful, I lost it when I update my zabbix with the 
    RPM manager(zypper/opensuse).

    * Other way I use is the smnpwalk command on Linux BOX (net-snmp RPM package),
    with this command I able to identify the items too.
    (for nice output need to copy the *V2.mib files from $INFORMIXDIR/snmp
    to /usr/share/snmp/mibs , this on OpenSuse 12.3, this location may vary on
    other Linux distribution)
        | $ snmpwalk -m Informix-MIB -c public -v 2c 101.0.123.220:5161 | head
        | SNMPv2-MIB::sysDescr.0 = STRING: AIX release:3 version:5 machine:000000000
        | SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::zeroDotZero
        | DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (25647272) 2 days, 23:14:32.72
        | SNMPv2-MIB::sysContact.0 = STRING: SNMP Research Inc., +1 (865) 573-1434, [email protected]
        | SNMPv2-MIB::sysName.0 = STRING: P550.xxx.corp
        | SNMPv2-MIB::sysLocation.0 = STRING:
        | SNMPv2-MIB::sysServices.0 = INTEGER: 72
        | SNMPv2-MIB::snmpInPkts.0 = Counter32: 41470
        | SNMPv2-MIB::snmpOutPkts.0 = Counter32: 41519
        | SNMPv2-MIB::snmpInBadVersions.0 = Counter32: 0
        |
        | $ snmpwalk -m Informix-MIB -c public -v 2c 101.0.123.220:5161 | grep -i start
        | RDBMS-MIB::rdbmsSrvInfoStartupTime.893002000 = STRING: 2013-4-22,12:6:39.0,+3:0
        | RDBMS-MIB::rdbmsSrvParamComment.893002000."AFF_SPROC".1 = STRING: Affinity start processor
        | $ snmpget -m Informix-MIB -On -c public -v 2c 101.0.200.200:5161 RDBMS-MIB::rdbmsSrvInfoStartupTime.893002000
        | .1.3.6.1.2.1.39.1.6.1.1.893002000 = STRING: 2013-4-22,12:6:39.0,+3:0

相关内容