Ad Widget

Collapse

Zabbix SQL Error whilst using the API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deanvum
    Junior Member
    • May 2023
    • 4

    #1

    Zabbix SQL Error whilst using the API

    Greetings.

    I have been experiencing some difficulty Interacting with the Zabbix API.

    Let me briefly explain the Scenario.

    We have 2 Instances of Zabbix Running a Production environment and a newly created "Lab"/"Testing" environment. I have been tasked to re write the implementation of a Automated Sync Service that Creates/Updates Hosts on Zabbix. Previously we made use of a "Zabbix" API Nuget Package. https://github.com/HenriqueCaires/ZabbixApi. This Package has served us well and is currently our primary means of Interacting with Our Zabbix Instance.

    However due to some constraints We decided to Implement an in-house solution that would replace, this package.

    The issue and reason for this Forum Post is that I am facing a SQL Error on certain Items.

    During some API Inserts and Updates our Zabbix Instance returns an HTTP Success Message. However the Response states that there is an "Application Error. SQL Statement execution has failed". I have tested various different hosts and determined that it may be related to template/interface assignment. Although I cant be certain as we have a great deal of hosts. with multiple templates assigned based on business logic.

    Please see Below Image that demonstrates the issue.



    Click image for larger version

Name:	Zabbix_Forum.jpg
Views:	222
Size:	297.9 KB
ID:	464757
    Has anyone ever faced such an issue? Perhaps there is a simple solution to this. I would really appreciate any advice.

    Best wishes.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    Anything in DB logs?

    Comment

    • deanvum
      Junior Member
      • May 2023
      • 4

      #3
      I will have a look Cyber. If I find something I will report back.

      Comment

      • deanvum
        Junior Member
        • May 2023
        • 4

        #4
        Thank you Cyber,

        That was extremely helpful. Turns out that the Proxy didn't exist and a key constraint was being violated.

        Comment

        • zumi.fi
          Junior Member
          • Jan 2023
          • 2

          #5
          Originally posted by deanvum
          Thank you Cyber,

          That was extremely helpful. Turns out that the Proxy didn't exist and a key constraint was being violated.
          Thanks! This was the issue for me too. Old script pointed to an old proxy. Just corrected the new id to script

          Comment

          Working...