Ad Widget

Collapse

Import fortigate template: Invalid parameter error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • musc1
    Junior Member
    • Jul 2021
    • 7

    #1

    Import fortigate template: Invalid parameter error

    Hi all,

    I tried to import an xml template created from Fortigate MIB using the tool found here https://github.com/Sean-Bradley/SNMP2ZABBIX and I face a problem.
    When I try to import the template from Zabbix GUI, I checked all the options of "Create new" as I have a similar template already installed in Zabbix, and at the end the following error appears:

    Invalid parameter "/1/mappings/7": value (value)=(0) already exists.

    What is causing the problem? I already managed to import the yaml template found in https://github.com/mbdraks/fortinet-zabbix and it's fine. But with my custom made template is not working and shows me this issue.

    The filesize is almost 2MB but I don't find what is causing the problem.

    Appreciate any help.

    Thank you!
    Phil
    Last edited by musc1; 08-07-2021, 10:30.
  • musc1
    Junior Member
    • Jul 2021
    • 7

    #2
    Hi,

    I have an update. I changed the template and I managed to overcome the above error but I face the following error:
    • Item will not be refreshed. Specified update interval requires having at least one either flexible or scheduling interval.
    Do you have any idea how to fix the template?

    Comment

    • Morton1451
      Junior Member
      • Jul 2021
      • 1

      #3
      I faced similar kind of issue last time, I am still searching for some proper solution.

      LBrands Aces
      Last edited by Morton1451; 13-07-2021, 08:30.

      Comment

      • owarzecha
        Junior Member
        • Aug 2021
        • 1

        #4
        Hello,

        i was able to find the duplicate values with this Powershell-Script:
        Code:
        $FILE="D:\Downloads\template_SC2.xml"
        # Read XML document
        [xml]$xml = gc "$FILE"
        $Nodes = $xml.SelectNodes('zabbix_export/value_maps/value_map')
        foreach ($Node in $Nodes){
            #Write-Host $Node.name
            $Mappings = $Node.SelectNodes("mappings/mapping")
            [System.Collections.ArrayList]$val_ar = @()
            foreach ($Mapping in $Mappings){
                if ($val_ar.Contains($Mapping.value)){
                    Write-Warning "Duplicate Value in:"
                    Write-Warning $Node.name
                }else{
                    [void]$val_ar.Add($Mapping.value)
                }
            }
        }

        Comment

        Working...