Ad Widget

Collapse

Error "Invalid parameter "/143/valuemapid": value must be 0." on template import

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Argon0
    Member
    • Mar 2023
    • 51

    #1

    Error "Invalid parameter "/143/valuemapid": value must be 0." on template import

    I've created a template using the SNMP2ZABBIX script using a ZD410. Importing keeps failing.... I've tried editing the XML, but changing the <VALUEMAP> <NAME> field does nothing. Telling Zabbix NOT to import values errors with something different.

    Is there any documenation/reference for the error codes? I can't find Valuemapid in the import, but did find info on the VALUE MAP 'command'/Value. I can't see any difference between the file I'm importing and any of the existing files in this respect...:

    Code:
    <value_type>FLOAT</value_type>
    <valuemap>
    <name>​something</name>
    </valuemap>
    I've just had a thought could it be the FLOAT value causing the issue as the documentation here:
    HTML Code:
    https://www.zabbix.com/documentation/4.2/en/manual/xml_export_import/templates
    talks ab out these numerical values :
    integer 0 - float
    1 - character
    2 - log
    3 - unsigned integer
    4 - text


    Template is attached here - had to zip it up...

    I've tried doing the same from SNMPWALK2ZABBIX, but had to edit the script for that (slight error on line 174 looking, I think, to split the MIB name at :: but was failing as there was only 1 instance of that in each/any of the name (code was
    Code:
     name = mib.split("::")[1]
    I changed it to
    Code:
     name = mib.split("::")[0]
    Whcih at least completed and created a template file.
    Attached Files
  • Argon0
    Member
    • Mar 2023
    • 51

    #2
    It's not the FLOAT thing. Changing that to 0, or other numbers (for the CHAR, TEXT, etc...Value Types) gets different errors, which are more readable (for me at least), and I worked out NOT to do that... Despite the documentation saying it's expecitng numbers...

    The SNMPWALK2ZABBIX template also won't import but gets a different message (related to host.. But sorted that out by finding the instance of "ZD410" in the name fiels, and replacing with ZD410.

    Finally got that imported, but it's not so useful as it doesn't have the names of the OIDs just the 0.1.3. etc.. names...

    So I'd really like to get the MIB created Template working as it has sensible names...​

    Comment

    • Argon0
      Member
      • Mar 2023
      • 51

      #3
      Anybody?

      I've enabled debugging but its not helping me!! I get this now:

      Code:
      Invalid parameter "/143/valuemapid": value must be 0. [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerPopupImport->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CConfiguration->import() → CConfigurationImport->import() → CConfigurationImport->processDiscoveryRules() → CConfigurationImport->createItemsWithDependency() → CItemPrototype->create() → CItemPrototype::validateCreate() → CApiService::exception() in include/classes/api/services/CItemPrototype.php:434]
      I can't define valuemapid anywhere in the template, that I can find, everytime I try putting it in I get an error that the key is invalid, no matter what section I put it in... Is this something expected in old XMLs? (the template referes to Zabbix 4.4).​

      Comment

      • Argon0
        Member
        • Mar 2023
        • 51

        #4
        After checking the CItemPrototype.php file line 434 I could see what was throwing the error, it is doing a check of parameters sent through to the Create Item prototype routine, and erroring on the 143rs item_prototype.

        SO, I commented this out and the no. at the start of the line changed... So I deleted this prototype (but wonder if changing the Value_Type to something not needing a ValueMapID might work instead.. hmm... I reiterated, and removed all the item_protoypes which were causing problems [39 of them out of 500+]. Now I'm going through the list seeing if there is anything there I NEED!

        Attached is the erroring sections....

        Any ideas what is causing them to fail?

        Sample:
        Code:
                                <item_prototype>
                                    <name>DISMAN-EVENT-MIB::mteEventActions[{#SNMPINDEX}]</name>
                                    <type>SNMPV2</type>
                                    <description>The actions to perform when this event occurs. For \'notification\', Traps and/or Informs are sent according to the configuration in the SNMP Notification MIB. For \'set\', an SNMP Set operation is performed according to control values in this entry.</description>
                                    <applications>
                                        <application>
                                            <name>ZEBRA-Link-OS_v6</name>
                                        </application>
                                    </applications>
                                    <port>{$SNMP_PORT}</port>
                                    <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                                    <key>.1.3.6.1.2.1.88.1.4.2.1.3.[{#SNMPINDEX}]</key>
                                    <snmp_oid>.1.3.6.1.2.1.88.1.4.2.1.3.{#SNMPINDEX}</snmp_oid>
                                    <delay>1h</delay>
                                    <history>2w</history>
                                    <trends>0</trends>
                                    <value_type>TEXT</value_type>
                                    <valuemap>
                                        <name>DISMAN-EVENT-MIB::mteEventActions</name>
                                    </valuemap>
                                </item_prototype>​
        "
        Attached Files

        Comment

        • Argon0
          Member
          • Mar 2023
          • 51

          #5
          After doing the above the template imported. Not sure it is any use yet, but about to find out.

          Comment

          • Argon0
            Member
            • Mar 2023
            • 51

            #6
            Hmmm... Well, there is a LOT in there. But none of it has any relation to the counters, etc.. in the MIB (by name anyway). Anybody got a good (proven) way to turn a MIB into a template for what's there? Tempted to start a fresh thread....

            Comment

            • bweblusrqjvjfwj
              Junior Member
              • Aug 2023
              • 1

              #7
              hi ,I have some issue
              Click image for larger version

Name:	image.png
Views:	2075
Size:	49.6 KB
ID:	469637

              I use this
              HTML Code:
              https://github.com/Sean-Bradley/SNMP2ZABBIX
              to covert mib to template

              use python SNMP2ZABBIX.py ./SANGFOR-GENERAL-AND-SSL-MIB 1.3.6.1.4


              Attached Files

              Comment

              Working...