Ad Widget

Collapse

Deleting a proxy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikesphar
    Junior Member
    • Jun 2012
    • 12

    #1

    Deleting a proxy

    So during initial development of our Zabbix deployment I had a remote proxy agent for a while, but have since stopped using it. Yesterday just to clean up unnecessary things I tried to delete that proxy but I'm getting a database error and can't figure out what the issue is.

    When I tried to just delete the proxy from within Administration -> DM, I received a SQL error. So I thought maybe I had to delete the host first. I deleted the host, which worked, but a day later I'm still getting SQL errors when I try to delete the proxy.

    This is the error I get:
    Code:
    Error in query [DELETE FROM interface WHERE  (hostid IN ('100100000010131')) ] [Cannot delete or update a parent row: a foreign key constraint fails (`zabbix`.`items`, CONSTRAINT `c_items_4` FOREIGN KEY (`interfaceid`) REFERENCES `interface` (`interfaceid`))]
    SQL statement execution has failed "DELETE FROM interface WHERE  (hostid IN ('100100000010131')) "
    My proxy was set to active, and at some point when fiddling with it I changed it to Passive. Now if I try to change it back to Active I get this error:
    Code:
    Interface is linked to item "Aborted clients" on "".
    Any suggestions? I know I could go into the database and start deleting records manually but I'd like to know the "proper" way to remove a proxy from the system. I looked around but didn't find any special documentation on any extra steps to do that.

    I thought maybe I needed to let Housekeeping go through and clean up items from deleted hosts, but Housekeeping runs every hour and I haven't seen errors or warnings from it.

    My zabbix server is 2.0.3 though it's likely the proxy was still 2.0.0 or 2.0.1 since I had stopped using it a while back I don't think I remembered to update it with the rest.
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    If the housekeeper runs without any error does not mean that there is no work left.

    What is the result of the the query:
    Code:
    SELECT COUNT(*) FROM housekeeper;

    Comment

    • mikesphar
      Junior Member
      • Jun 2012
      • 12

      #3
      Housekeeper currently has no rows:

      Code:
      mysql> select count(*) from housekeeper;
      +----------+
      | count(*) |
      +----------+
      |        0 |
      +----------+
      1 row in set (0.00 sec)
      But still get the same errors trying to change or delete the proxy from Administration -> DM.

      Comment

      • BDiE8VNy
        Senior Member
        • Apr 2010
        • 680

        #4
        Sorry, I've taken a accurately look at the SQL error only now.
        Is it possible that there are still some hosts configured to use this proxy?

        Comment

        • mikesphar
          Junior Member
          • Jun 2012
          • 12

          #5
          Not that I could find. The Administration -> DM page for the proxy said the host count was zero, and the detail page for the proxy has no hosts listed under Proxy Hosts. I also scrolled through every page of hosts looking for any that had the proxy listed and did not see any. I even had a light bulb to double check none of the configured web monitoring was using the proxy, but none are. I also thought maybe there was some old disabled discovery actions/rules that referred to it, but no luck there either.

          What I can see in the DB is that the host in question is still in the hosts table, with a status of '6'. It appears to be the only host record with that status, and that host record does not appear to be visible at all through the zabbix UI.

          I still don't know how it got into this state, but it appears I was able to clean things up by:

          1. Manually setting the host status back to 0
          2. Pull up the host again in the zabbix UI. When I did I got what I would describe as a partial screen, with the hostname and links to items, trigger, etc, and buttons for save/clone/delete/etc, but the part of the screen with fields for templates, agent IP addresses, etc were blank.
          3. I clicked "Save" and it gave me an error about interface not existing, but then the resulting configuration page had all the normal fields/objects.
          4. I went to the template section and did "unlink and clear" for the linked templates, and saved the record.
          5. Then I went back to the record and deleted it, which worked.

          At that point now when I go to Administration -> DM, the old proxy is no longer listed.

          Comment

          • wasabi
            Member
            • Mar 2014
            • 30

            #6
            please help with deleting a proxy

            Hello forum,

            As I´m a newbie to Zabbix I ran into the same topic and am not able to follow the solution described.

            Zabbix Version is 2.2.2/mysql, no hosts are linked to that proxy anymore (I deleted them right before trying to delete the proxy itself).

            When trying to delete the proxy in the UI under Administration-DM-Proxies the following error message appears:

            Code:
                Error in query [DELETE FROM interface WHERE hostid='11288'] [Cannot delete or update a parent row: a foreign key constraint fails (`zabbix`.`items`, CONSTRAINT `c_items_4` FOREIGN KEY (`interfaceid`) REFERENCES `interface` (`interfaceid`))]
                SQL statement execution has failed "DELETE FROM interface WHERE hostid='11288'"
            Would you please provide a detailed step by step explanation to solve this issue?

            Thank you in advance and best regards,
            Claudio

            Comment

            • wasabi
              Member
              • Mar 2014
              • 30

              #7
              No idea how to delete a proxy???

              Hi forum,

              can anyone help me with this? It looks strange to me that this does not work. Should I open a bug report?

              TIA,
              Claudio

              Comment

              Working...