Назад | Перейти на главную страницу

Субагент Informix snmp с net-snmp

Кто-нибудь успешно настроил субагент informix 10 snmp для работы с net-snmp в Linux или Windows?

Я переписываю свой ответ, потому что сегодня я уже настроил Informix SNMP для работы в Linux и AIX. Не окна ...

Сегодня я отслеживаю это с помощью Zabbix Server со службой SNMP. Я создал шаблон Zabbix для Informix, который вы можете найти здесь: https://www.zabbix.org/wiki/Zabbix_Templates#Database

С шаблоном Zabbix я написал файл readme, в котором есть объяснения по настройке Informix SNMP с AIX, но он также подходит для Linux.

Я скопирую часть этого файла readme сюда:

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, info@snmp.com
        | 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

Что ж, чтобы ответить на вопрос, я уверен кто то есть!

Но я подозреваю, что вы спрашиваете, возможно ли это. И это будет зависеть от того, как себя ведет субагент Informix. Скорее всего, он реализует одно из следующих: напрямую SNMP (в этом случае вам нужно «прокси» к нему с помощью Net-SNMP), AgentX (который является протоколом субагента, разработанным IETF, и Net-SNMP поддерживает его) или SMUX (который является более старым субагентом. протокол, который также поддерживает Net-SNMP).

Так что ответ на «могу ли я», безусловно, «да».