Ad Widget

Collapse

Move a web scenario to another host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wizhippo
    Junior Member
    • Oct 2007
    • 2

    #1

    Move a web scenario to another host

    I have created a web scenario but associated with the wrong host.

    Is this possible?
    Last edited by wizhippo; 14-12-2007, 19:27. Reason: Clarified
  • wizhippo
    Junior Member
    • Oct 2007
    • 2

    #2
    i found a workaround

    I used firefox to view the hidden form fields. then changed the hostid to the hostid of the proper server. Worked fine.

    Comment

    • z4g
      Junior Member
      • Jun 2008
      • 8

      #3
      Moving Web Scenario

      Thanks wizhippo, that helped me a lot.

      Just to explain the way it worked for me for future generations ; )

      1. Use Firefox 3.0 with "un-hide fields" add-on
      2. Go to Configuration --> Web --> Scenario name
      3. Right Click anywhere on the page and choose Show hidden fields
      4. Change the host id under form 2 and 3

      Thats it.

      Comment

      • paul.vanbommel
        Junior Member
        • Jun 2011
        • 1

        #4
        how to migrate a web scenario

        We migrated Zabbix servers recently. Everything went very well. I had to get my Oracle DBA to help write up some functions and procedures to migrate the trend* data for some custom checks the old zabbix server was doing on a NetApp(not via SNMP). I didn't want to lose the trends.

        Now my Web Scenarios are tied to the old zabbix server's agent(luckily that server is still running for now, but is slatted for decommissioning). That addon for Firefox doesn't work on the version we have.

        Has anyone ever managed to change this in the back end MySQL database.
        I tried with an SQL statement, but it didn't seem to have the desired effect, so I put it back to avoid any issues. (I'm not a DBA, so I was treading lightly)

        Here is the SQL line I used (hostid used is that on the new zabbix server and 'Zabbix' is the name of the scenario)

        Code:
        update items set hostid = 10326 where itemid in (select itemid from httptestitem where httptestid = (select httptestid from httptest where name = 'Zabbix'));
        I only have a few weeks before my contract is up and I would like to get this one last zabbix related issue off my plate. If I can't migrate these checks, I will have to build them from scratch and lose all the old trend history.

        I find one of the features lacking in Zabbix is the ability to Move trend data from one host to another. It will let you clone the items and such, but it will not let you copy the history and trends for a given item. (or web scenario)
        Any enhancements in that area would be appreciated.

        Comment

        • bsteph
          Junior Member
          • Sep 2012
          • 15

          #5
          Any luck

          I was going down the same path, trying to manually update the item table, but also had no luck. Has anyone found a way to migrate the scenarios to another host?

          Comment

          • Beredix
            Junior Member
            • Mar 2014
            • 1

            #6
            Replying on old post to get a googleable solution:

            This looks like it's working on our installation of Zabbix 2.2:

            New hostid will be 10134
            Webscenario is named web1

            * Find a valid application on the host (I chose 466)
            select *
            from applications
            where hostid=10134

            update httptest set hostid = 10134,applicationid=466 where name = 'web1';

            update items set hostid = 10134
            where itemid in (select itemid from httptestitem where httptestid = (select httptestid from httptest where name = 'web1'));

            update items_applications
            set applicationid=466
            where itemid in (select itemid from httptestitem where httptestid = (select httptestid from httptest where name = 'web1'))
            or itemid in (select itemid from items where key_ like 'web.test.%[web1%');

            update items set hostid = 10134
            where itemid in (select itemid from httpstepitem where httpstepid in (select httpstepid from httpstep where httptestid = (select httptestid from httptest where name = 'web1')));
            Last edited by Beredix; 26-03-2014, 15:19. Reason: extra semicolon in past edit

            Comment

            • moses.moore
              Junior Member
              • Dec 2014
              • 24

              #7
              I tried editing the form fields in the browser, but it doesn't seem to work anymore (Zabbix 2.4.4). So I'll be editing the zabbix internals via MySQL database by hand again.

              Comment

              • BrianLakstins
                Junior Member
                • May 2021
                • 1

                #8
                I'm using a Postgresql database using Zabbix 6.2.4. I searched for how to do this and came to this page, so I thought I'd add what worked for me.

                Access the database with a query tool. I shut down my Zabbix instance before doing this.

                Get the host ids for each server:

                SELECT * FROM public.hosts
                where name like 'SERVERNAMETO%'

                SELECT * FROM public.hosts
                where name like 'SERVERNAMEFROM%

                Then update the host id for the web secneario:

                update public.httptest
                set hostid=SERVERNAMETOHISTID where hostid=SERVERNAMEFROMHOSTID

                ​​​

                Comment

                Working...